Demodulation Reference Sequence (DMRS)
The demodulation reference signal (DMRS) is used for estimating channel for demodulating the data carried by a certain physical channel. The DMRS is transmitted for every physical channel in downlink and uplink for coherent detection of data. The DMRS is generated using a seed which is different for each physical channel. The parameter used for generating the DMRS for each channel is given in following table.
Physical channel |
Parameters |
Number |
---|---|---|
PBCH |
cell-ID, ssbIndex, \(L_{max}\), half frame Index |
4 |
PDCCH |
scramblingID, symbolNumber, slotNumber |
3 |
PDSCH |
scramblingID, symbolNumber, slotNumber |
3 |
The details of DMRS generation for PBCH, PDCCH and PDSCH is defined in section 7.4.1.1, section 7.4.1.3 and, section 7.4.1.4 respectively of [3GPPTS38211_DMRS].
Important
The seed (\(c_{init}\)) value is computed using the parameters defined in
table-1
for respective physical channels.
When all the parameters are scalar::
nssbCandidatesInHrf = 8
nID = 671
ssbIndex = 5
hrfBit = 0
dmrsLen = 144
dmrsObject = DMRS("PBCH", nID, ssbIndex, nssbCandidatesInHrf, hrfBit)
dmrsSequence = dmrsObject(dmrsLen)
When some parameters are arrays::
symbNumber = np.array([0,1])
slotNumber = 4
scramblingID = int(np.random.randint(2**16))
dmrsLen = 48
dmrsObject = DMRS("PDCCH", symbNumber, slotNumber, scramblingID)
dmrsSequence = dmrsObject(dmrsLen)
When all possible parameters are arrays::
numSymbols = np.random.randint(2,10)
symbNumber = np.array([4,5,6,4,5,6], dtype = int)
slotNumber = np.array([2,2,2,3,3,3], dtype = int)
scramblingID = int(np.random.randint(65535, dtype = int)) # or Cell-ID for Initial Access
lambDa = np.array([0,0,0,1,1,1], dtype = int)
nSCID = np.array([0,0,0,0,0,0], dtype = int)
lengthDMRS = 240
dmrsObject = DMRS("PDSCH", symbNumber, slotNumber, scramblingID, nSCID, lambDa)
dmrsSequence = dmrsObject(lengthDMRS)
More example on DMRS generation can be found in Tutorials. The details about the input-output interface of the SSS implementation is provided below.
- class toolkit5G.SequenceGeneration.DMRS(purpose, *args)[source]
Generates the demodulation reference signal (DMRS) for physical broadcast channel (PBCH), physical downlink control channel (PDCCH), physical downlink shared channel (PDSCH). The details about the implementation of the DMRS sequence for PBCH, PDCCH and PDSCH are provided in section 7.4.1.1, section 7.4.1.2 and, section 7.4.1.3 of [3GPPTS38211_DMRS] respectively. The first variable
purpose
defines the physical channel for whom DMRS is to be generated and*args
accepts variable inputs with different understanding based on thepurpose
.- Parameters:
purpose (str) – Defines the channel for which DMRS has to be generated. It can take 3 values currently {“PBCH”, “PDCCH”, “PSBCH” , “PDSCH”, “PSCCH”}
*args (list) – Variable length argument list which accepts values based on the parameter
purpose
.- If
purpose
== “PBCH”: arg[0]
is N_cell_ID (int or NumPy array, np.int) - cell IDarg[1]
is ssbIndex (int or NumPy array, np.int) - SSB beam Index which takes the values between 0 andLmax
-1.arg[2]
is Lmax (int) - maximum number of candidate SS/PBCH blocks in a half frame (\(L_{max}\)), it takes a value of4 for carrier frequency < 2 GHz,
8 for 2GHz < carrier frequency < 6 GHz and
64 for carrier frequency in FR2 (mmWave)
arg[3]
is nHF (int) - number of the half-frame in which the PBCH is transmitted in a frame withnHF
= 0 for the first half-frame in the frame andnHF
= 1 for the second half-frame in the frame.
- If
purpose
== “PSBCH” arg[0]
is N_cell_ID_SL (int or NumPy array, np.int) - Physical-layer sidelink synchronization identity.
- If
purpose
== “PDCCH”: arg[0]
is symbolNumber (int or NumPy array, np.int) - It defines the OFDM symbol number (\(l\)), within the slot \(\in \{0,1,2,..,13\}\).arg[1]
is slotNumber (int or NumPy array, np.int) - It defines the slot number within a frame \(n_{s,f}^{\mu} \in \{0,1,2,..,10*2^{\mu}-1\}\) where \({\mu = \frac{\Delta f}{15 kHz}}\).arg[2]
is scramblingID (int) - It is defined by pdcch-DMRS-ScramblingID \(\in \{0,1,2,..,65535\}\) or cell ID \(\in \{0,1,2,..,1007\}\) based on the usage.
- If
purpose
== “PSCCH”: arg[0]
is symbolNumber (int or NumPy array, np.int) - It defines the OFDM symbol number (\(l\)), within the slot \(\in \{0,1,2,..,13\}\).arg[1]
is slotNumber (int or NumPy array, np.int) - It defines the slot number within a frame \(n_{s,f}^{\mu} \in \{0,1,2,..,10*2^{\mu}-1\}\) where \({\mu = \frac{\Delta f}{15 kHz}}\).arg[2]
is scramblingID (int) - It is defined by pscch-DMRS-ScramblingID \(\in \{0,1,2,..,65535\}\) or cell ID \(\in \{0,1,2,..,1007\}\) based on the usage.
- If
purpose
== “PDSCH”: arg[0]
is symbolNumber (int or NumPy array, np.int) - It defines the OFDM symbol number (\(l\)), within the slot \(\in \{0,1,2,..,13\}\).arg[1]
is slotNumber (int or NumPy array, np.int) - It defines the slot number within a frame \(n_{s,f}^{\mu} \in \{0,1,2,..,10*2^{\mu}-1\}\) where \({\mu = \frac{\Delta f}{15 kHz}}\).arg[2]
is scramblingID (int) - It is defined by (\(N_{ID}^{\bar{n}_{SCID}^\bar{\lambda}}\)) ScramblingID0 or ScramblingID1 \(\in \{0,1,2,..,65535\}\).arg[3]
is nSCID (int) - It is defined by nSCID \(\in \{0,1\}\).arg[4]
is lambdaBar (\(\bar{\lambda}\)) (int) - It is defined by CDM group \(\in \{0,1,2\}\).
- If
Important
- For PBCH-DMRS:
If both N_cell_ID and ssbIndex are scalar, N (number of DMRS sequence) = 1.
If N_cell_ID is an array and ssbIndex is scalar N (number of DMRS sequence) = length of N_cell_ID.
If N_cell_ID is a scalar and ssbIndex is an array N (number of DMRS sequence) = length of ssbIndex.
If N_cell_ID is an array and ssbIndex is also an array N (number of DMRS sequence) = length of ssbIndex.
- For PDCCH-DMRS and PSCCH-DMRS:
If both symbolNumber and slotNumber are scalar, N (number of DMRS sequence) = 1.
If symbolNumber is an array and slotNumber is scalar N (number of DMRS sequence) = length of symbolNumber.
If symbolNumber is a scalar and slotNumber is an array N (number of DMRS sequence) = length of slotNumber.
If symbolNumber is an array and slotNumber is also an array, N (number of DMRS sequence) = length of symbolNumber.
- For PDSCH-DMRS:
Length of symbolNumber, slotNumber, nSCID, lambdaBar is either 1 or N (>1).
Then N (number of DMRS sequence) = max(1, N).
- For PSBCH-DMRS:
If N_cell_ID_SL is a scaler, N (number of DMRS sequence) = 1.
If N_cell_ID_SL is an array, N (number of DMRS sequence) = length of N_cell_ID_SL.
- Input:
length (int) – Defines length of the PN Sequence
- Output:
[…, length], np.int8 – Secondary synchronization sequence.
- Raises:
ValueError – [Error-DMRS]: PBCH-DMRS requires 4 parameters (cell-ID, SSB-Index, Lmax, Half frame bit)
ValueError – [Error-DMRS]: PSBCH-DMRS requires only 1 parameters (cell-ID, SSB-Index, Lmax, Half frame bit)
ValueError – [Error-DMRS]: PDSCH-DMRS requires 5 parameters (symbol-Number, slot-Number, scrambling-ID, nSCID and lambdaBar)
ValueError – [Error-DMRS]: PDCCH-DMRS requires 3 parameters (symbol-Number, slot-Number, scrambling-ID)
ValueError – [Error-DMRS]: Invalid Choice of ‘purpose’)
ValueError – [Error]: Size of ‘N_cell_ID’ and ‘ssbIndex’ is inconsistent!
ValueError – [Error]: Size of ‘symbolNumber’, slotNumber, nSCIDBar, and ‘lambdaBar’ is inconsistent!
ValueError – [Error in PDCCH-DMRS]: size of ‘symbolNumber’ and ‘slotNumber’ is inconsistent!
ValueError – [Error in DMRS]: Invalid Choice of ‘purpose’)
ValueError – [Error in PBCH - DMRS]: cell - ID must be integer!
ValueError – [Error in PBCH - DMRS]: cell - ID must be in interval[0 1007]!
ValueError – [Error in PSBCH - DMRS]: cell - ID must be integer!
ValueError – [Error in PSBCH - DMRS]: cell - ID must be in interval[0 671]!
ValueError – [Error in PBCH - DMRS]: SSB - Index must be integer or ndarray of int!
ValueError – [Error in PBCH - DMRS]: Lmax of PN Sequence must be integer!
ValueError – [Error in PBCH-DMRS]: Half frame Bit must be integer!
ValueError – [Error in PBCH-DMRS]: Half frame Bit must be in interval [0 1]!
ValueError – [Error in PDSCH-DMRS]: ‘symbolNumber’ (OFDM symbol number) must be in the range [0-13]!
ValueError – [Error in PDCCH-DMRS]: ‘symbolNumber’ (OFDM symbol number) must be in the range [0-13]!
ValueError – [Error in PD(S|C)CH-DMRS]: ‘symbolNumber’ (OFDM symbol number) must be integer or ndarray of int!
ValueError – [Error in PDSCH-DMRS]: ‘slotNumber’ must be non-negative!
ValueError – [Error in PDSCH-DMRS]: ‘slotNumber’ must be non-negative!
ValueError – [Error in PDSCH-DMRS]: ‘slotNumber’ must be an integer or NumPy array of integers!
ValueError – [Error in PDCCH-DMRS]: ‘slotNumber’ must be non-negative!
ValueError – [Error in PDCCH-DMRS]: ‘slotNumber’ must be an integer or NumPy array of integers!
ValueError – [Error in PD(S|C)CH-DMRS]: scramblingID ($N_ID^0 or N_ID^1$) must be integer!
ValueError – [Error in PD(S|C)CH-DMRS]: scramblingID ($N_ID^0 or N_ID^1$) must be in interval [0 65535]!
ValueError – [Error in PDSCH-DMRS]: ‘nSCID’ must be 0 or 1!
ValueError – [Error in PDSCH-DMRS]: ‘nSCID’ must be an integer or NumPy array of integers!
ValueError – [Error in PDSCH-DMRS]: ‘lambdaBar’ must be 0, 1 or 2!
ValueError – [Error in PDSCH-DMRS]: ‘lambdaBar’ must be an integer or NumPy array of integers!
ValueError – [Error]: ‘length’ of PN Sequence must be a positive (>0) integer!
- References: