Sidelink Synchronization Signal Block (S-SSB) Grid Generation
THe modules maps the sidelink primary synchronization signal (S-PSS), sidelink secondary synchronization signal (S-SSS), demodulation reference signal (DMRS) for PSBCH and PSBCH payload to S-SSB grid. The S-SSB grid in 5G spans 11 or 13 OFDM symbols and 132 subcarriers (11 RBs). This modules can return multiple SSBs carrying same S-PSS, S-SSS but DMRS and different PSBCH information which is typically the case when transmitting multiple S-SSBs in a half frame. In such cases, only the S-SSB index information changes across S-SSBs. The details about the S-SSB generation is provided in section 8.4.2 of 3GPP TS 38.211 [3GPPTS38211_SSSBGrid].
Examples:
When \(\text{N}_{\text{SSBs}} = 1\):
flag = np.random.randint(2)
numIDs = 1 if flag else np.random.randint(1,10)
nid1 = 311
nid2 = 1
nSymb = 11
psbch = 1-2*np.random.randint(2, size=(99*(nSymb-4)))
sssbObj = SSSB_Grid(nid1, nid2, numSymbols = nSymb)
sssb = sssbObj(psbch = psbch)
print("************ Simulation Parameters *************")
print()
print(" nid1: "+str(nid1))
print(" nid2: "+str(nid2))
print("Number of S-SSB Symbols: "+str(nSymb))
print(" Shape of psbch: "+str(psbch.shape))
print(" Shape of sssb: "+str(sssb.shape))
print()
print("********************************************")
******** Simulation Parameters ********* nid1: 311 nid2: 1 Number of S-SSB Symbols: 11 Shape of psbch: (693,) Shape of sssb: (1, 132, 14) ****************************************
# Display the Sidelink-SSB Grid
fig, ax = sssbObj.displayGrid()
When \(\text{N}_{\text{SSBs}} > 1\) :
flag = np.random.randint(2)
numIDs = 1 if flag else np.random.randint(1,10)
nid1 = np.array([311, 210, 64])
nid2 = np.array([0, 1, 0])
nSymb = 13
psbch = 1-2*np.random.randint(2, size=(3, 99*(nSymb-4)))
sssbObj = SSSB_Grid(nid1, nid2, numSymbols = nSymb)
sssb = sssbObj(psbch = psbch)
print("************ Simulation Parameters *************")
print()
print(" nid1: "+str(nid1))
print(" nid2: "+str(nid2))
print("Number of S-SSB Symbols: "+str(nSymb))
print(" Shape of psbch: "+str(psbch.shape))
print(" Shape of sssb: "+str(sssb.shape))
print()
print("********************************************")
******** Simulation Parameters ********* nid1: [311 210 64] nid2: [0 1 0] Number of S-SSB Symbols: 13 Shape of psbch: (3, 891) Shape of sssb: (3, 132, 14) ****************************************
# Display the Sidelink-SSB Grid
fig, ax = sssbObj.displayGrid(option=0)
More example on S-SSB Resource mapping can be found in Tutorials. The details about the input-output interface of the SSSB_Grid implementation is provided below.
- class toolkit5G.ResourceMapping.SSSB_Grid(nID1, nID2, numSymbols=13)[source]
Generates the sidelink synchronization signal block grid as per Section 7.4.3 of 3GPP TS 38.211.
- Parameters:
nID1 (int or NumPy integer array) – denotes the \(N_{ID,1}^{SL}\). All the values should be taken from the interval \(\{0, 1, 2, \dots, 335\}\).
nID2 (int or NumPy integer array) – denotes the \(N_{ID,2}^{SL}\). All the values should be taken from the interval {0, 1}.
numSymbols (int) – denotes the \(N_{symb}^{S-SSB}\). Values should be taken from the interval {11, 13}.
isNormalized (bool) – Defines the normalization flag. This flag is used to normalize the power of each symbol in SSB to one.
Important
If SSB is un-normalized, the total power is different across symbols.
- Input:
spss ([127,], np.complex64) – Defines Sidelink-PSS Sequence of length 127 to be loaded in the S-SSB. Default value is None. When
spss
is None, it is generated based onnID2
.ssss ([127,], np.complex64) – Defines Sidelink-SSS Sequence of length 127 to be loaded in the S-SSB. Default value is None. When
spss
is None, it is generated based onnID1
andnID2
.dmrsSequence ([:, 33*``numSymbols-4``], np.complex64) – Defines DMRS Sequence of length 144 to be loaded in the S-SSB. Default value is None. When
spss
is None, it is generated based onnID1
andnID2
.psbch ([:, 99*``numSymbols-4``], np.complex64) – Defines PSBCH Payload of length 432 to be loaded in the S-SSB. It shouldn’t have more than 2 dimensions. Default value is None. When
spss
is None, it is generated randomly based on the resources configured in 3GPP standards.
Warning
psbch
anddmrsSequence
shouldn’t have more than 2 dimensions. Moreover, both these variables should have same number of SSBs (pbchSymb.shape[0] should equal dmrsSeq.shape[0]).Important
Cell-ID should be same for all the
pbchSymb
anddmrsSeq
.- Output:
[…, 132, 14], np.complex64 – Sidelink synchronization signal block grid.
- Raises:
ValueError – [Error:SL_SSB] Size mismatch between ‘nID1’ and ‘nID2’!
ValueError – [Error:SL_SSB] length of ‘S-PSS’ must be a 1D or 2D array!
ValueError – [Error:SL_SSB] length of ‘S-PSS’ must be a multiple of 254!
ValueError – [Error:SL_SSB] length of ‘S-SSS’ must be a 1D or 2D array!
ValueError – [Error:SL_SSB] length of ‘S-SSS’ must be a multiple of 254!
ValueError – [Error:SL_SSB] length of ‘S-SSS’ and ‘S-PSS’ is inconsistent!
ValueError – [Error:SL_SSB] length of ‘S-DMRS’ must be a multiple of 33*``numSymbols-4``!
ValueError – [Error:SL_SSB] length of ‘S-SSS’, ‘S-PSS’ and ‘S-DMRS’ is inconsistent!
ValueError – [Error:SL_SSB] length of ‘S-PBCH’ must be a multiple of 99*``numSymbols-4``!
ValueError – [Error:SL_SSB] length of ‘S-SSS’, ‘S-PSS’, ‘S-DMRS’ and ‘S-PBCH’ is inconsistent!
ValueError – [Error S-SSB]: ‘nID1’ must be within 0 and 335!
ValueError – [Error S-SSB]: ‘nID1’ must be within 0 and 335!
ValueError – [Error S-SSB]: ‘nID1’ must be an integer or integer numpy array!
ValueError – [Error S-SSS]: ‘nID2’ must be either 0 or 1!
ValueError – [Error S-SSS]: ‘nID2’ must be either 0 or 1!
ValueError – [Error S-SSS]: ‘nID2’ must be an integer or integer numpy array!
ValueError – [Error S-SSS]: ‘numSymbols’ must be either 11 or 13!
ValueError – [Error S-SSS]: ‘numSymbols’ must be an integer!
- displayGrid(index=0, option=1, displayGrid=True)[source]
Provides the method to display S-SSB grid.
- Input:
index (int) – Define the Index of S-SSB whose grid has to be displayed. It should always be less than number of s-ssb grids.
option (int \(\in \{0,1\}\).) –
If option=0, then heat map of the SSB is displayed.
If option=1, displays the grid locations (relative t-f locations) where S-PSS, S-SSS, DMRS and PSBCH payload are loaded in the S-SSB grid.
- SSSB_Grid.displayGrid(index=0, option=1, displayGrid=True)[source]
Provides the method to display S-SSB grid.
- Input:
index (int) – Define the Index of S-SSB whose grid has to be displayed. It should always be less than number of s-ssb grids.
option (int \(\in \{0,1\}\).) –
If option=0, then heat map of the SSB is displayed.
If option=1, displays the grid locations (relative t-f locations) where S-PSS, S-SSS, DMRS and PSBCH payload are loaded in the S-SSB grid.
- References:
- [3GPPTS38211_SSSBGrid]
(3GPP TS 38.211 version 17.1.0 Release 17) 5G;NR;Physical channels and modulation ‘5.2.2 Low-PAPR sequence generation type 1’