This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


NB-IoT physical downlink shared channel decoding


[cw,stateout,symbols] = lteNPDSCHDecode(enb,chs,sym)
[cw,stateout,symbols] = lteNPDSCHDecode(enb,chs,sym,statein)
[cw,stateout,symbols] = lteNPDSCHDecode(enb,chs,sym,hest,noiseest)
[cw,stateout,symbols] = lteNPDSCHDecode(enb,chs,hest,noiseest,statein)


[cw,stateout,symbols] = lteNPDSCHDecode(enb,chs,sym) performs the inverse of NB-IoT physical downlink shared channel (NPDSCH) processing on the matrix of complex modulated NPDSCH symbols, sym, using cell-wide settings structure, enb, and channel-specific configuration structure, chs. The channel inverse processing includes the deprecoding, layer demapping, soft demodulation, descrambling, and codeword recovery. The deprecoding is performed using matrix pseudo-inversion of the precoding matrices. lteNPDSCHDecode returns a column vector, cw, of soft bit vectors, a structure, stateout, of the decoding state, and a vector, symbols, of received constellation symbol vectors. For more information, see TS 36.211 10.2.3 [1], and lteNPDSCH. cw is optionally scaled by channel state information (CSI) calculated during the equalization process.


[cw,stateout,symbols] = lteNPDSCHDecode(enb,chs,sym,statein) specifies the initial decoder state in the statein structure.

[cw,stateout,symbols] = lteNPDSCHDecode(enb,chs,sym,hest,noiseest) performs the inverse of NPDSCH processing using the channel estimate, hest, and the noise estimate, noiseest.

The behavior varies based on the enb.NBRefP setting. For the TxDiversity transmission scheme (NBRefP = 2), the deprecoding is performed using an orthogonal space frequency block code decoder. For the Port0 transmission scheme (NBRefP = 1), the reception is performed using MMSE equalization. hest is assumed in terms of transmission layers, using the NRS reference signals. Therefore, the MMSE equalization produces MMSE-equalized layers.

[cw,stateout,symbols] = lteNPDSCHDecode(enb,chs,hest,noiseest,statein) performs the inverse of NPDSCH processing using the channel estimate, hest, the noise estimate, noiseest, and the initial decoder state, statein.


collapse all

Generate and receive the NPDSCH symbols subframe by subframe for a bundle of 12 subframes.

Specify the cell-wide settings and channel transmission configuration in parameter structures enb and chs.

enb.NNCellID = 0;
enb.NBRefP = 1;
enb.NFrame = 1;
chs.NSF = 3;
chs.NRep = 4;
chs.RNTI = 0;
chs.NPDSCHDataType = 'NotBCCH';

Set the output codeword length to 960 and generate the codeword bits. Do not provide the encoder or decoder states at the start of the bundle.

cwLen = 960;
estate = [];
dstate = [];
cw = ones(cwLen,1);

Generate the NPDSCH symbols for each of the 12 subframes and then decode them.

for subframeIdx = 0:(chs.NSF*chs.NRep-1)
    enb.NSubframe = subframeIdx;
    [sym,estate] = lteNPDSCH(enb,chs,cw,estate);
    [rxcw,dstate] = lteNPDSCHDecode(enb,chs,sym,dstate);

The value of the field CWSFCount in structure dstate indicates that all three subframes in the codeword have been received four times.

ans = logical

ans = 3×1


Input Arguments

collapse all

eNodeB cell-wide settings, specified as a structure containing these parameter fields.

Parameter FieldRequired or OptionalValuesDescription

Nonnegative integer

NB-IoT physical layer cell identity


Nonnegative integer

Subframe number


0 (default),

nonnegative integer

Frame number


1, 2

Number of narrowband reference signal antenna ports

Channel-specific transmission configuration, specified as a structure that can contain the following parameter fields.

Parameter FieldRequired or OptionalValuesDescription

'NotBCCH' (default),



Type of the data carried by NPDSCH

NSFRequired (See note)


Number of subframes that a codeword is mapped to (not including repetitions)



Number of repetitions

RNTIRequired (See note)


Radio network temporary identifier (16-bit)


'On' (default) or 'Off'

Determines if soft bits are weighted by CSI


  • NSF and RNTI are required only when NPDSCHDataType is not equal to 'SIB1NB'.

  • If NPDSCHDataType = 'SIB1NB', then NSF is set to 8 and RNTI is set to 65535 (SI-RNTI).

Complex modulated NPDSCH symbols, specified as a NRE-by-NRxAnts numeric matrix. NRE is the number of QPSK symbols per antenna assigned to the NPDSCH. NRxAnts is the number of receive antennas.

Data Types: double
Complex Number Support: Yes

Input decoder state for the transmission of a bundle, specified as a structure. statein can be empty only when no information is provided, such as, at the first subframe of a bundle. The statein structure is normally generated and recycled from the stateout of previous calls to lteNPDSCHDecode, as part of a sequence of bundle transmission.

Data Types: struct

Channel estimate, specified as a NRE-by-NRxAnts-by-NBRefP numeric array. NRE is the number of QPSK symbols per antenna assigned to the NPDSCH per subframe. NRxAnts is the number of receive antennas. NBRefP is the number of NRS antenna ports, given by enb.NBRefP.

Data Types: double

Noise estimate of the noise power spectral density per RE on the received subframe, specified as a numeric array.

Data Types: double

Output Arguments

collapse all

Codeword, returned as a vector of bit values required to modulate one codeword.

Data Types: double

Output decoder state for the next subframe, returned as a structure. stateout contains the internal state of each transport block in the following fields:

Parameter FieldValuesDescription

0, 1, 2, …, chs.NSF×chs.NRep–1

0-based index of a subframe in a bundle.



Subframe number at the initialization point of the scrambling sequence.



Frame number at the initialization point of the scrambling sequence.


Numeric column vector

Buffer used to store the soft-combined LLR bits after codeword descrambling. The length of the buffer is the same as the length of the codeword.


Numeric column vector

Counters for the number of repetitions received in the CWBuffer for all the chs.NSF subframes of a codeword. The counters vector is of size chs.NSF-by-1.


false, true

Indicator of whether all subframes in a codeword have been received at least once, that is, all the elements in CWSFCount are greater than or equal to 1.


false, true

Indicator of whether the transmission of all subframes in a bundle is complete.

The output SubframeIdx in stateout is equal to its input in statein increased by 1. When SubframeIdx reaches the maximum value, it wraps around to 0. If inputs do not exist in statein, the default input is 0. An output value 0 indicates that all subframes in a bundle have been received and stored in CWBuffer, so the output EndOfTx is true.

When the subframe under processing is at the initialization point of the scrambling sequence, InitNSubframe is equal to enb.NSubframe, and InitNFrame is equal to enb.NFrame. If the subframe is not at the initialization point, InitNSubframe and InitNFrame are equal to their respective inputs in statein, if the inputs exist. If the inputs do not exist, InitNSubframe is equal to enb.NSubframe and InitNFrame is 0.

At the beginning of a bundle, the function resets CWBuffer, CWSFCount, EndOfCW, and EndOfTx.

Data Types: struct

Received constellation symbols, returned as a complex column vector, resulting from performing the inverse of NPDSCH processing.

Data Types: double


[1] 3GPP TS 36.211. “Physical Channels and Modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network; Evolved Universal Terrestrial Radio Access (E-UTRA). URL:

Introduced in R2018a