Main Content

lteNULSCHDecode

Decode NB-IoT UL-SCH codeword

Description

[trBlkOut,blkCRC,stateOut] = lteNULSCHDecode(chs,trBlkLen,cw) returns trBlkOut, a vector of length trBlkLen containing NB-IoT UL-SCH data or uplink control information (UCI) decoded from cw, an NB-IoT uplink shared channel (UL-SCH) codeword of log-likelihood ratios (LLRs). The function also returns blkCRC, the result of type-24A transport block cyclic redundancy check (CRC) decoding, and stateOut, the hybrid automatic repeat request (HARQ) process decoding status. Use this syntax for NB-IoT UL-SCH data or UCI decoding. If you use this syntax for UCI decoding, the function decodes cw without soft combining.

For NB-IoT UL-SCH data decoding, the function inverts the UL-SCH processing described in section 6.3.2 of [1] by deinterleaving, rate recovering, turbo decoding, and type-24A transport block CRC decoding the input codeword.

For UCI decoding, the function inverts the UL-SCH processing described in section 6.3.3 of [1] by slicing the codeword data.

example

[trBlkOut,blkCRC,stateOut] = lteNULSCHDecode(cw) decodes NB-IoT UL-SCH codeword cw by inverting the UL-SCH processing described in section 6.3.3 of [1]. Use this syntax for UCI decoding without soft combining.

example

[trBlkOut,blkCRC,stateOut] = lteNULSCHDecode(___,stateIn) specifies stateIn, the initial decoder state for each transport block in an active HARQ process, in addition to any input combination from previous syntaxes.. If you use this syntax for UCI decoding, the function decodes cw with soft combining.

Examples

collapse all

Generate a codeword by applying UCI encoding to a control information bit. Recover the control information by decoding.

Create a control information bit for encoding.

trBlkIn = 1;

Generate the UL-SCH codeword.

cw = lteNULSCH(trBlkIn);

Recover the transport block by decoding the NB-IoT UL-SCH codeword.

[trBlkOut,blkCRC,stateOut] = lteNULSCHDecode(cw);

Confirm that the recovered bit matches the input control information bit.

disp(isequal(trBlkIn,trBlkOut))
   1

Generate an NB-IoT UL-SCH data codeword by encoding a 136-bit transport block. Split the codeword into two NPUSCH transmissions in two consecutive slots. Decode the NPUSCH transmission, and then decode the received NB-IoT UL-SCH codeword.

Configure UE-specific settings.

ue = struct('NBULSubcarrierSpacing','15kHz','NNCellID',10,'NSlot',0);

Specify a channel transmission configuration.

chs = struct('NPUSCHFormat','Data','NBULSubcarrierSet',0:11,'NRUsc',length(0:11),'NRep',1, ...
    'NRU',1,'NULSlots',2,'Modulation','QPSK','RV',0,'NTurboDecIts',5,'RNTI',20);

Generate a transport block for encoding.

trBlkLen = 136;
trBlkIn = randi([0 1],trBlkLen,1);

Get the codeword length by generating the NPUSCH RE indices and associated information.

[~,info] = lteNPUSCHIndices(ue,chs);
outLen = info.G;

Generate the UL-SCH codeword.

cwIn = lteNULSCH(chs,outLen,trBlkIn);

Initialize the encoder state for the NPUSCH and the decoder states for the NPUSCH and UL-SCH.

npuschStateIn = struct();
npuschDecodeStateIn = struct();
stateIn = struct();

Generate NPUSCH symbols for slot 0, and then return the decoder state by decoding the NPUSCH symbols.

[symSlot0,npuschStateOut] = lteNPUSCH(ue,chs,cwIn,npuschStateIn);
[~,npuschDecodeStateOut,~] = lteNPUSCHDecode(ue,chs,symSlot0,npuschDecodeStateIn);

Generate NPUSCH symbols for slot 1, and then return the decoder state by decoding the NPUSCH symbols.

ue.NSlot = 1;
[symSlot1,~] = lteNPUSCH(ue,chs,cwIn,npuschStateOut);
[cw,~,~] = lteNPUSCHDecode(ue,chs,symSlot1,npuschDecodeStateOut);

Decode received NB-IoT UL-SCH data codeword.

[trBlkOut,blkCRC,stateOut] = lteNULSCHDecode(chs,trBlkLen,cw,stateIn);

Confirm that the recovered NB-IoT UL-SCH matches the original transport block.

disp(isequal(trBlkIn,trBlkOut))
   1

Input Arguments

collapse all

Channel transmission configuration, specified as a structure containing these fields.

FieldValuesDescriptionData Types
NPUSCHFormat'Data' (default), 'Control'

Narrowband physical uplink shared channel (NPUSCH) format

To indicate that the NPUSCH carries narrowband uplink shared channel (UL-SCH) data, specify this field as 'Data'. To indicate that the NPUSCH carries uplink control information, specify this field as 'Control'.

char, string
NRU1, 2, 3, 4, 5, 6, 8, 10Number of resource units (RUs)double
NULSlots2, 4, 8, 16Number of slots per RUdouble
Modulation'BPSK', 'QPSK'

Modulation type, specified as one of these values:

To enable binary phase-shift keying (BPSK), specify this field as 'BPSK'. To enable quadrature phase-shift keying (QPSK), specify this field as 'QPSK'.

char, string
RV0, 2Redundancy version indicatordouble
NTurboDecIts5 (default), integer in the interval [1, 30]Number of turbo decoder iteration cyclesdouble

Data Types: struct

Transport block length, specified as a positive integer. The function rate recovers and turbo decodes the cw input to the value of this input.

Data Types: double

NB-IoT UL-SCH codeword of LLRs, specified as a binary-valued column vector.

Data Types: double

Initial decoder buffer state for each transport block in an active HARQ process, specified as a structure containing this field.

FieldValuesDescriptionData Types
CBSBuffersCell arrayLLR soft buffer state for the transport block input to the turbo decoder after rate recoverycell

Data Types: struct

Output Arguments

collapse all

Decoded NB-IoT UL-SCH data or UCI information bits, returned as a binary-valued column vector.

Data Types: int8

Type-24A transport block CRC decoding error indicator, returned as 0 or 1. When the lteNULSCHDecode function decodes cw with zero errors, it returns this output as 0. Otherwise, the function returns this output as 1.

Data Types: logical

Output decoder buffer state for each transport block in an active HARQ process, returned as a structure containing these fields.

FieldValuesDescriptionData Types
CBSBuffersCell arrayLLR soft buffer state for the transport block input to the turbo decoder after rate recoverycell
BLKCRC1, 0

Type-24A transport block CRC decoding error indicator

When the function decodes cw with zero errors, it returns this output as 0 (false). Otherwise, the function returns this output as 1 (true).

logical

Data Types: struct

References

[1] 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.

See Also

Functions

Introduced in R2020a