Decode PDSCH modulation symbols



[cws,symbols] = nrPDSCHDecode(sym,mod,nid,rnti) returns soft bits cws and constellation symbols symbols resulting from the inverse operation of the physical downlink shared channel (PDSCH) processing specified in TS 38.211 Sections 7.3.11–3 [1]. The decoding consists of layer demapping, demodulation of sym with modulation scheme mod, and descrambling with scrambling identity nid. The input rnti is the radio network temporary identifier (RNTI) of the user equipment (UE).

[cws,symbols] = nrPDSCHDecode(___,nVar) specifies the noise variance scaling factor of the soft bits in the PDSCH demodulation, in addition to the input arguments in the previous syntax.


collapse all

Generate and decode PDSCH modulation symbols.

Specify a random sequence of binary values corresponding to a codeword of 8000 bits using 256-QAM modulation. Generate PDSCH modulation symbols for the specified physical layer cell identity number, RNTI, and number of transmission layers.

modulation = '256QAM';
nlayers = 4;
ncellid = 42;
rnti = 6143;
data = randi([0 1],8000,1);
txsym = nrPDSCH(data,modulation,nlayers,ncellid,rnti);

Add an additive white Gaussian noise (AWGN) to the PDSCH symbols. Then demodulate to produce soft bit estimates.

SNR = 30; % SNR in dB
rxsym = awgn(txsym,SNR);
rxbits = nrPDSCHDecode(rxsym,modulation,ncellid,rnti);

Input Arguments

collapse all

Received PDSCH modulation symbols, specified as a complex matrix of size NRE-by-NLayers. NRE is the number of resource elements in a layer, and NLayers is the number of layers. NLayers determines the number of codewords in cws.

  • If NLayers is from 1 to 4, the function returns one codeword in cws.

  • If NLayers is from 5 to 8, the function returns two codewords in cws.

Data Types: single | double
Complex Number Support: Yes

Modulation scheme, specified as 'QPSK', '16QAM', '64QAM', or '256QAM', a string array, or a cell array of character vectors. This modulation scheme specifies the modulation type of the codewords and the number of bits used per modulation symbol. If cws contains two codewords, the modulation scheme applies to both codewords. Alternatively, you can specify different modulation schemes for each codeword by using a string array or a cell array of character vectors.

Modulation SchemeNumber of Bits Per Symbol

Example: To specify different modulation schemes for two codewords, you can use any of these formats: {'QPSK','16QAM'} or ["QPSK","16QAM"].

Data Types: char | string | cell

Scrambling identity, specified as an integer from 0 to 1023. nid is the physical layer cell identity number (0 to 1007) or higher layer parameter dataScramblingIdentityPDSCH (0 to 1023). For more information, see TS 38.331 Section 6.3.2.

Data Types: double

RNTI of the UE, specified as an integer from 0 to 65,535.

Data Types: double

Noise variance, specified as a nonnegative numeric scalar. The soft bits are scaled with the variance of additive white Gaussian noise (AWGN). The default value corresponds to an SNR of 100 dB, assuming unit signal power.


The default value assumes the decoder and coder are connected back-to-back, where the noise variance is zero. To avoid -Inf or +Inf values in the output, the function uses 1e-10 as the default value for noise variance. To get appropriate results when the signal is transmitted through a noisy channel, adjust the noise variance accordingly.

Data Types: double

Output Arguments

collapse all

Approximate log likelihood ratio (LLR) soft bits, returned as a cell array of one or two real column vectors. The output cws inherits the data type of sym. The number of column vectors depends on the number layers in sym. The sign of the output represents the hard bits.

Data Types: double | single | cell

Symbol constellation for each codeword in cws, returned as a cell array of one or two column vectors of complex numbers. symbols inherits the data type of sym.

Data Types: double | single | cell


[1] 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2018b