Sidelink Synchronization Signal Block (SSB) Grid Generation
THe modules maps the primary synchronization signal (PSS), secondary synchronization signal (SSS), demodulation reference signal (DMRS) for PBCH and PBCH payload to SSB grid. The SSB grid in 5G spans 4 OFDM symbols and 240 subcarriers (12 RBs). This modules can return multiple SSBs carrying same PSS, SSS but DMRS and different PBCH information which is typically the case when transmitting multiple SSBs in a half frame. In such cases, only the SSB index information changes across SSBs. The shape of the variable is shown in table-1.
Important
The cell-ID (\(\text{N}_{\text{ID}}\)), half frame index (\(\text{n}_{\text{HF}}\)) and maximum number of SSBs in a half frame (\(\text{L}_{\text{max}}\)) should be same for all the components of SSB.
Reference Signal/Payload |
Dimension |
---|---|
Primary synchronization signal (PSS) |
\(1 \times 127\) |
Secondary synchronization signal (PSS) |
\(1 \times 127\) |
Demodulation reference signal (DMRS) |
\(\text{N}_{\text{SSBs}} \times 144\) |
PBCH Payload |
\(\text{N}_{\text{SSBs}} \times 432\) |
When \(\text{N}_{\text{SSBs}} = 1\):
numSSBs = 1
N_ID1 = np.random.randint(336)
N_ID2 = np.random.randint(3)
N_ID = 3*N_ID1 + N_ID2
nssbCandidatesInHrf = int(np.random.choice([4,8,64]))
ssbIndex = np.random.choice(nssbCandidatesInHrf, size = numSSBs)
hrfBit = 0
# Generate PSS sequence
pssObject = PSS(N_ID2);
pssSequence = pssObject()
# Generate SSS sequence
sssObject = SSS(N_ID1, N_ID2);
sssSequence = sssObject()
# Generate DMRS sequence
dmrsLen = 144;
dmrsObject = DMRS("PBCH", N_ID, ssbIndex, nssbCandidatesInHrf, hrfBit)
dmrsSequence = dmrsObject(dmrsLen)
# Symbol mapping object
mapper = Mapper("qam", 2)
pbchSymbols = mapper(np.random.randint(2, size = (numSSBs, 864))) # Generate symbols from the bits.
# Generate SSB Grid
ssbObject = SSB_Grid(N_ID)
ssb = ssbObject(pssSequence, sssSequence, dmrsSequence, pbchSymbols) # Generate SSB Grid of shape (1, 4, 240)
# Display the location of PSS, SSS, DMRS and PBCH in SSB
ssbObject.displayGrid(option=1)
When \(\text{N}_{\text{SSBs}} > 1\) :
numSSBs = 10
N_ID1 = np.random.randint(336)
N_ID2 = np.random.randint(3)
N_ID = 3*N_ID1 + N_ID2
nssbCandidatesInHrf = int(np.random.choice([4,8,64]))
ssbIndex = np.random.choice(nssbCandidatesInHrf, size = numSSBs)
hrfBit = 0
# Generate PSS sequence
pssObject = PSS(N_ID2);
pssSequence = pssObject()
# Generate SSS sequence
sssObject = SSS(N_ID1, N_ID2);
sssSequence = sssObject()
# Generate DMRS sequence
dmrsLen = 144;
dmrsObject = DMRS("PBCH", N_ID, ssbIndex, nssbCandidatesInHrf, hrfBit)
dmrsSequence = dmrsObject(dmrsLen)
# Symbol mapping object
mapper = Mapper("qam", 2)
pbchSymbols = mapper(np.random.randint(2, size = (numSSBs, 864))) # Generate symbols from the bits.
# Generate SSB Grid
ssbObject = SSB_Grid(N_ID)
ssb = ssbObject(pssSequence, sssSequence, dmrsSequence, pbchSymbols) # Generate SSB Grid of shape (10, 4, 240)
# Display the location of PSS, SSS, DMRS and PBCH in SSB
ssbObject.displayGrid(option=0)
More example on SSB Resource mapping can be found in Tutorials. The details about the input-output interface of the SSB_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 8.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.
- References:
- [3GPPTS38211_SSBGrid]
(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’