Main Content

lteNPBCHDecode

Decode NPBCH symbols

Description

[bits,stateout,symbols,nfmod64,trblk,NBRefP] = lteNPBCHDecode(enb,sym) decodes sym, the NB-IoT physical broadcast channel (NPBCH) symbols, for cell-wide settings enb. The NPBCH decoding inverts the NPBCH encoding process described in section 10.2.4 of [1] and the broadcast channel (BCH) encoding process described in section 5.3.1 of [2]. The function returns bits, a codeword of soft bits, the decoder state for reception of a bundle (a full set of repeated transmissions of a single transport block) stateout, and the received constellation symbols, symbols, by performing the inverse of NPBCH encoding. Frame number modulo 64 nfmod64, decoded BCH information bits trblk, and the number of narrowband reference signal (NRS) antenna ports NBRefP, are returned by performing the inverse of BCH encoding.

[___] = lteNPBCHDecode(enb,sym,statein) decodes the NPBCH symbols for the initial decode state statein.

example

[___] = lteNPBCHDecode(enb,sym,hest,noiseest) decodes the NPBCH symbols for the channel estimate hest and noise estimate noiseest.

example

[___] = lteNPBCHDecode(enb,sym,hest,noiseest,statein) decodes the NPBCH symbols for the channel estimate, noise estimate, and the initial decoder state.

Examples

collapse all

Generate and decode the NPBCH symbols subframe-by-subframe for a bundle of 64 NPBCH subframes.

Specify the cell-wide settings.

enb = struct('NNCellID',0,'NBRefP',1);

To obtain the codeword, generate the MIB and pass it through broadcast channel (BCH) encoding.

mib = randi([0 1],34,1);
cw = lteBCH(mib,1600,enb.NBRefP);

Specify the encoder state as empty.

statein = [];

Generate the NPBCH symbols for each of the 64 NPBCH subframes and then decode them.

for subframeIdx = 0:63
    enb.NSubframe = subframeIdx*10; % As NPBCH is mapped only on 0th subframe of each frame
    sym = lteNPBCH(enb,cw);
    [decoderOut,stateout,symbols,NfMod64,trblk,NBRefP] = ...
        lteNPBCHDecode(enb,sym,statein);
    statein = stateout;
end

To check whether the decoding is successful, display the value of NBRefP.

NBRefP
NBRefP = uint32

1

To obtain NPBCH symbols, decode the waveform that is generated using NB-IoT Downlink Waveform Generator.

Specify the NB-IoT eNodeB configuration with 65 frames.

ngen = NBIoTDownlinkWaveformGenerator;
ngen.Config.NNCellID = 120;
ngen.Config.NBRefP = 2;
ngen.Config.TotSubframes = 650;

Generate the waveform, eNodeBOutput.

[eNodeBOutput,~,ofdmInfo] = ngen.generateWaveform;

Start the decoding process by first initializing the fields of the structure enb.

enb.NNCellID = 120;
enb.NBRefP = 2;

To obtain the resource grid rxgrid, perform OFDM demodulation and generate the NPBCH resource element (RE) indices.

The NB-IoT Downlink OFDM is the same as UL-SC-FDMA. Use lteSCFDMADemodulate to perform OFDM demodulation.

enb.NBULSubcarrierSpacing = '15kHz';
rxgrid = lteSCFDMADemodulate(enb,eNodeBOutput); % NB-IoT Downlink OFDM Demodulation
npbchIndices = lteNPBCHIndices(enb);

Extract the REs from the resource grid using the RE indices.

npbchRx = lteExtractResources( ...
    npbchIndices, rxgrid(1:12,1:14,:));

Specify the encoder state as empty.

statein = [];

Decode the NPBCH symbols.

[decoderOut,stateout,symbols,nfmod64,trblk,NBRefP] = lteNPBCHDecode(enb,npbchRx,statein);

To check whether the decoding is successful, display the value of NBRefP.

NBRefP
NBRefP = uint32

2

Input Arguments

collapse all

Cell-wide settings, specified as a structure containing these fields.

Parameter FieldRequired or OptionalValuesDescriptionData Types
NNCellIDRequired

Nonnegative integer

NB-IoT physical layer cell identity

double
NBRefPOptional

1, 2

Number of narrowband reference signal (NRS) antenna ports. The default is to establish NBRefP by decoding the input symbols, sym.

double
NSubframeOptional

Nonnegative integer

Subframe number

double
NFrameOptional

0 (default),

nonnegative integer

Initial frame number

double

Data Types: struct

Modulated NPBCH symbols, specified as an NRE-by-NRxAnts complex-valued matrix, where:

  • NRE is a multiple of the number of quadrature phase-shift keying (QPSK) symbols per antenna and per subframe assigned to the NPBCH.

  • NRxAnts is the number of receive antennas.

Data Types: double
Complex Number Support: Yes

Initial encoder state for transmission of a bundle, specified as a structure containing the fields listed in the stateout output. At the start of the bundle transmission, set statein to empty. The lteNPBCHDecode function manages the state during subsequent calls for the transmissions of the bundle and resets it automatically at the end of the bundle.

Data Types: struct

Channel estimate, specified as an NRE-by-NRxAnts-by-NNBRefP complex-valued array, where:

  • NRE is a multiple of the number of QPSK symbols per antenna and per subframe.

  • NRxAnts is the number of receive antennas.

  • NNBRefP is the number of NRS antenna ports you specify in the NBRefP field of the enb input.

The lteNPBCHDecode function assumes that this estimate uses the NRSs.

Data Types: double
Complex Number Support: Yes

Noise estimate, specified as a numeric scalar. It is an estimate of the noise power spectral density per resource element on the received subframe. This estimate is provided by the lteDLChannelEstimate function.

Data Types: double

Output Arguments

collapse all

Codeword of soft bits, returned as an N-by-1 binary vector, where N can be a part of the 1600-bit codeword length in multiples of 200 or the entire codeword, depending upon the input NPBCH symbols, sym.

Data Types: double

Output decoder state for the next subframe, returned as a structure. This output contains the internal state of each transport block in these fields.

NameValuesDescriptionData Types
SubframeIdxInteger in the interval [0, 63]Index of a subframe within a bundle, in zero-based form, returned as an integer in the interval [0,63]. The lteNPBCHDecode function returns this field as the SubframeIdx field of the statein input increased by one. When the input value of SubframeIdx in the statein input reaches its maximum value, the function returns this field as 0. If no input exists in statein, the default input is 0. A value of 0 indicates that the transmission has reached the end of a bundle, which the function also indicates by setting the EndOfTx field to true.double
CWBuffer1600-by-1 numeric vectorBuffer to store the soft-combined log-likelihood ratio (LLR) bits after codeword descrambling, returned as a 1600-by-1 numeric vector. The length of this field is the same as the length of the codeword. At the beginning of the bundle, the lteNPBCHDecode function resets this field.double
EndOfTxLogical 1 (true) or 0 (false)End of bundle indicator. The lteNPBCHDecode function returns this field as 1 (true) when the transmission reaches the end of the bundle. Otherwise, the lteNPBCHDecode function returns this field as 0 (false). At the beginning of the bundle, the lteNPBCHDecode function resets this field.logical

Data Types: struct

Received constellation symbols, returned as a complex-valued vector.

Data Types: double

System frame number modulo 64, mod(NFrame,64), returned as an integer in the interval [0, 63]. nfmod64 is obtained when determining the scrambling phase of the input NPBCH symbols, sym.

Data Types: double

Decoded BCH information bits, returned as a 34-by-1 binary column vector.

Data Types: int8

Number of NRS ports, returned as 0, 1, or 2 as determined during the BCH decoding. If the value is 0, a CRC error has been detected, and decoding is unsuccessful.

Data Types: uint32

Tips

To use this function for a bundle transmission, follow these steps:

  1. Call the lteNPBCHDecode function and specify the initial encoder state using the statein input. The stateout output represents the decoder state of the first transmission of the bundle.

  2. Call the lteNPBCHDecode function again and specify the statein input as the stateout output returned by the previous call to the function.

  3. Repeat step 2 until the lteNPBCHDecode function returns the EndOfTx field of the stateout output as 1 (true), indicating the end of the bundle. The lteNPBCHDecode automatically resets the state at the end of the bundle transmission.

References

[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). https://www.3gpp.org.

[2] 3GPP TS 36.212. “Multiplexing and channel coding.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network; Evolved Universal Terrestrial Radio Access (E-UTRA). https://www.3gpp.org.

Version History

Introduced in R2019b

Go to top of page