Main Content

nrDLSCHDecoder

Apply DL-SCH decoder processing chain

Description

The nrDLSCHDecoder System object™ applies the downlink shared channel (DL-SCH) decoder processing chain to the soft bits corresponding to one or two DL-SCH-encoded transport blocks. The DL-SCH decoding process consists of rate recovery, low-density parity-check (LDPC) decoding, desegmentation, and cyclic redundancy check (CRC) decoding. The object implements the inverse operation of the DL-SCH encoding process specified in TS 38.212 Section 7.2 [1].

To apply the DL-SCH decoder processing chain:

  1. Create the nrDLSCHDecoder object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

decDL = nrDLSCHDecoder creates a DL-SCH decoder System object.

decDL = nrDLSCHDecoder(Name,Value) creates the object with properties set by using one or more name-value pairs. Enclose the property name inside quotes, followed by the specified value. Unspecified properties take default values.

Example: For example, nrDLSCHDecoder('MultipleHARQProcesses',true) creates the object and enables multiple hybrid automatic repeat-request (HARQ) processes.

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Enable multiple HARQ processes, specified as one of these values:

  • 0 (false) — The object uses a single HARQ process.

  • 1 (true) — The object uses multiple HARQ processes, at most 32.

In both cases, to enable soft combining of retransmissions before LDPC decoding, the object maintains a soft buffer for each HARQ process.

Data Types: logical | double

Since R2025a

Enable support for transmission based on code block groups (CBGs), specified as one of these values:

  • 0 (false) — Disable support for CBG-based transmission. The object uses transmission based on transport blocks (TBs).

  • 1 (true) — Enable support for CBG-based transmission. The object takes an additional input argument, cbgti, that specifies CBG transmission information used with the current transmission, and returns an additional output argument, cbgerr, that provides CRC error flags per CBGs. If the number of rows in cbgti is 1, the processing is equivalent to the TB-based transmission.

Data Types: logical | double

Since R2025a

Flush soft buffer automatically, specified as one of these values:

  • 1 (true) — The object automatically flushes the soft buffer associated with a transport block on a transport block CRC pass.

  • 0 (false) — The object does not flush the soft buffer automatically. The object continues soft-combining any retransmissions for the associated HARQ process.

Note

To flush the soft buffer manually at any time, call the resetSoftBuffer function.

Data Types: logical | double

Target code rate, specified as a numeric scalar or a 1-by-2 numeric vector. The values must be in the interval (0, 1). The default value corresponds to 526/1024. If you specify TargetCodeRate as a scalar, the object applies scalar expansion when processing two transport blocks. To specify different target code rates for each transport block, specify TargetCodeRate as a vector.

Tunable: Yes

Data Types: double

Length of decoded transport block, or transport blocks, in bits, specified as a positive scalar integer or a 1-by-2 integer vector. If you specify TransportBlockLength as a scalar, the object applies scalar expansion when processing two transport blocks. To specify a different length for the decoded transport blocks, specify TransportBlockLength as a vector.

Tunable: Yes

Data Types: double

Limited buffer size used for rate recovery, specified as a positive integer. The default value corresponds to 384×66, which is the maximum coded length of a code block. The default value implies no limit on the buffer size.

Tunable: Yes

Data Types: double

Maximum LDPC decoding iterations, specified as a positive integer. Since early termination is enabled, decoding stops once parity-checks are satisfied. In this case, fewer iterations take place than the maximum specified by this argument.

Data Types: double

LDPC decoding algorithm, specified as one of these values:

  • 'Belief propagation' — Use this option to specify the belief-passing or message-passing algorithm.

  • 'Layered belief propagation' — Use this option to specify the layered belief-passing algorithm, which is suitable for quasi-cyclic parity-check matrices (PCMs).

  • 'Normalized min-sum' — Use this option to specify the layered belief propagation algorithm with normalized min-sum approximation.

  • 'Offset min-sum' — Use this option to specify the layered belief propagation algorithm with offset min-sum approximation.

For more information on these algorithms, see LDPC Decoding Algorithms.

Data Types: char | string

Scaling factor for normalized min-sum decoding, specified as a real scalar in the range (0, 1].

Dependencies

To enable this property, set the LDPCDecodingAlgorithm property to 'Normalized min-sum'.

Data Types: double

Offset for offset min-sum decoding, specified as a nonnegative finite real scalar.

Dependencies

To enable this property, set the LDPCDecodingAlgorithm property to 'Offset min-sum'.

Data Types: double

Since R2024a

Enable cell output format, irrespective of the number of codewords, specified as one of these logical values:

  • 0 (false) — This option corresponds to the default behavior of the object in which the trblk output is returned as a column vector for a single codeword or as a cell array for two codewords.

  • 1 (true) — The object returns trblk as a cell array irrespective of the number of codewords.

Data Types: logical | double

Since R2025a

Transport block sizes per each HARQ process, returned as one of these values:

The array rows correspond to HARQ processes. The two array columns correspond to the two possible transport blocks.

Data Types: double

Usage

Description

trblk = decDL(softbits,mod,nLayers,rv) applies the DL-SCH decoder processing chain to the input softbits and returns the decoded bits. mod specifies the modulation scheme. nLayers specifies the number of transmission layers. rv specifies the redundancy version of the transmission.

example

trblk = decDL(___,harqID) specifies the HARQ process number harqID used with the current transmission in addition to the input arguments in the previous syntax. To use this syntax, set the MultipleHARQProcesses property to true. When the property is set to false, the object uses HARQ process number 0.

When the object receives codewords with different redundancy version for an individual HARQ process, the object uses soft buffer state retention to enable soft combining of retransmissions. When you enable multiple HARQ processes, the object maintains independent buffers for each process.

Upon successful decoding of the input, the object automatically resets the soft buffer for a HARQ process. To reset the soft buffer manually, call the resetSoftBuffer function.

[trblk,blkerr] = decDL(___) returns an error flag, using the input arguments in any of the previous syntaxes. A value of 1 in blkerr indicates an error during transport block decoding.

[trblk,blkerr,cbgerr] = decDL(___,cbgti) specifies the CBG transmission information used with the current transmission in addition to the input arguments in any of the previous syntaxes. The object returns also the CRC error flags per CBGs, cbgerr. A value of 1 in cbgerr indicates that the corresponding CBG in the corresponding transport block failed the CRC check in the current transmission. The CRC pass is assumed for CBGs not transmitted in the current transmission. To use this syntax, set the CBGTransmission property to true. (since R2025a)

Input Arguments

expand all

Approximate log-likelihood ratio (LLR) soft bits, corresponding to one or two DL-SCH-encoded transport blocks, specified as a real column vector or a cell array of two real column vectors.

Data Types: single | double

Modulation scheme, specified as 'QPSK', '16QAM', '64QAM', '256QAM', '1024QAM', a string array, or cell array of character vectors. This modulation scheme determines the modulation type and number of bits used per modulation symbol. For two transport blocks, the modulation scheme applies to both blocks. Alternatively, you can specify different modulation schemes for each transport block by using a string array or a cell array of character vectors.

Modulation SchemeNumber of Bits Per Symbol
'QPSK'2
'16QAM'4
'64QAM'6
'256QAM'8
'1024QAM'10

Data Types: char | string

Number of transmission layers, specified as an integer from 1 to 8. For nLayers > 4, the object expects two encoded transports blocks as input.

Data Types: double

Redundancy version, specified as one of these options:

  • Integer from 0 to 3 — Use this option to specify the redundancy version for a single encoded transport block.

  • 1-by-2 vector of integers from 0 to 3 — Use this option to specify the redundancy version for two encoded transport blocks.

Data Types: double

HARQ process number, specified as an integer from 0 to 31. To specify a value other than 0, set the MultipleHARQProcesses object property to true.

Data Types: double

Since R2025a

CBG transmission information used in the current transmission, specified as an N-by-1 or N-by-2 binary array. N is the maximum number of CBGs defined by the higher-layer parameter maxCodeBlockGroupsPerTransportBlock. Alternatively, N can also be 1, in which case the object uses TB-based transmission. Array values 1 and 0 indicate whether the corresponding CBG in the corresponding transport block is present or absent in the current transmission, respectively.

The array columns correspond to transport blocks. If you specify an N-by-1 column vector in case of two transport blocks (nLayers > 4), the object applies the same CBG information to both transport blocks. If you specify an N-by-2 array in case of one transport block (nLayers <= 4), the object ignores the second column.

Note

To use this argument, set the CBGTransmission property to true.

Data Types: double

Output Arguments

expand all

Decoded DL-SCH transport blocks, returned as a binary column vector or cell array of two binary column vectors. The TransportBlockLength property specifies the length of the column vectors.

Result of DL-SCH transport block decoding for each transport block, returned as a logical scalar or logical vector of length 2. A value of 1 in blkerr indicates an error during transport block decoding.

Data Types: logical

Since R2025a

CRC error per CBG, returned as an N-by-1 or N-by-2 logical array. N is the number of rows in the cbgti input. Array values 1 and 0 indicate whether the corresponding CBG in the corresponding transport block has failed or passed the CRC check in the current transmission, respectively.

For one transport block (nLayers <= 4), cbgerr has the same size as cbgti. For two transport blocks (nLayers > 4), cbgerr is of size N-by-2, irrespective of the size of cbgti.

Note

To use this argument, set the CBGTransmission property to true.

Data Types: double

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

resetSoftBufferReset soft buffer for HARQ process in UL-SCH or DL-SCH decoder
infoDL-SCH or UL-SCH decoding status information
stepRun System object algorithm
cloneCreate duplicate System object
isLockedDetermine if System object is in use
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Generate a random sequence of binary values corresponding to one transport block of length 5120.

trBlkLen = 5120;
trBlk = randi([0 1],trBlkLen,1,'int8');

Create and configure a DL-SCH encoder System object with the specified target code rate.

targetCodeRate = 567/1024;
encDL = nrDLSCH;
encDL.TargetCodeRate = targetCodeRate;

Load the transport block into the DL-SCH encoder.

setTransportBlock(encDL,trBlk);

Call the encoder with 64-QAM modulation scheme, 1 transmission layer, an output length of 10,240 bits, and redundancy version 0. The encoder applies the DL-SCH processing chain to the transport block loaded into the object.

mod = '64QAM';
nLayers = 1;
outlen = 10240;
rv = 0;
codedTrBlock = encDL(mod,nLayers,outlen,rv);

Create and configure a DL-SCH decoder System object.

decDL = nrDLSCHDecoder;
decDL.TargetCodeRate = targetCodeRate;
decDL.TransportBlockLength = trBlkLen;

Call the DL-SCH decoder on the soft bits representing the encoded transport block. Use the configuration parameters specified for the encoder. The error flag in the output indicates that the block decoding does not have errors.

rxSoftBits = 1.0 - 2.0*double(codedTrBlock);
[decbits,blkerr] = decDL(rxSoftBits,mod,nLayers,rv)
decbits = 5120×1 int8 column vector

   1
   1
   0
   1
   1
   0
   0
   1
   1
   1
   0
   1
   1
   0
   1
      ⋮

blkerr = logical
   0

Obtain decoding status information.

decoderInfo = info(decDL)
decoderInfo = struct with fields:
                 HARQID: 0
    TransportBlockError: 0
         CodeBlockError: {[0]}
      SoftBufferFlushed: 1

Verify that the transmitted and received message bits are identical.

isequal(decbits,trBlk)
ans = logical
   1

Algorithms

expand all

References

[1] 3GPP TS 38.212. “NR; Multiplexing and channel coding.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[2] Gallager, Robert G. Low-Density Parity-Check Codes, Cambridge, MA, MIT Press, 1963.

[3] Hocevar, D.E. "A reduced complexity decoder architecture via layered decoding of LDPC codes." In IEEE Workshop on Signal Processing Systems, 2004. SIPS 2004. dois: 10.1109/SIPS.2004.1363033

[4] Chen, Jinghu, R.M. Tanner, C. Jones, and Yan Li. "Improved min-sum decoding algorithms for irregular LDPC codes." In Proceedings. International Symposium on Information Theory, 2005. ISIT 2005. doi: 10.1109/ISIT.2005.1523374

Extended Capabilities

expand all

Version History

Introduced in R2019a

expand all