Apply DL-SCH decoder processing chain
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 .
To apply the DL-SCH decoder processing chain:
nrDLSCHDecoder object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?.
creates a DL-SCH
decoder System object.
decDL = nrDLSCHDecoder
Example: For example,
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
decDL = nrDLSCHDecoder(
nrDLSCHDecoder('MultipleHARQProcesses',true)creates the object and enables multiple hybrid automatic repeat-request (HARQ) processes.
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.
MultipleHARQProcesses— Enable multiple HARQ processes
Enable multiple HARQ processes, specified as
true. When set to
false, the object uses a
single process. When set to
true, the object uses multiple HARQ
processes, at most 16. To enable soft combining of retransmissions before LDPC decoding,
the object maintains a soft buffer for each HARQ process.
TargetCodeRate— Target code rate
0.5137(default) | numeric scalar | 1-by-2 numeric vector
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.
TransportBlockLength— Length of decoded transport block
5120(default) | positive scalar integer | 1-by-2 integer vector
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.
LimitedBufferSize— Limited buffer size
25344(default) | positive integer
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.
MaximumLDPCIterationCount— Maximum LDPC decoding iterations
12(default) | positive integer
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.
LDPCDecodingAlgorithm— LDPC decoding algorithm
'Belief propagation'(default) |
'Layered belief propagation'|
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
'Offset min-sum' — Use this option to specify the
layered belief propagation algorithm with offset min-sum
For more information on these algorithms, see LDPC Decoding Algorithms.
ScalingFactor— Scaling factor for normalized min-sum decoding
0.75(default) | real scalar in the range (0, 1]
Scaling factor for normalized min-sum decoding, specified as a real scalar in the range (0, 1].
To enable this property, set the
LDPCDecodingAlgorithm property to
Offset— Offset for offset min-sum decoding
0.5(default) | nonnegative finite real scalar
Offset for offset min-sum decoding, specified as a nonnegative finite real scalar.
To enable this property, set the
LDPCDecodingAlgorithm property to
specifies the HARQ process number
trblk = decDL(___,
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
the property is set to
false, the object uses HARQ process number
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.
softbits— Approximate LLR soft bits
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.
mod— Modulation scheme
'256QAM'| string array | cell array of character vectors
Modulation scheme, specified as
'256QAM', 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 Scheme||Number of Bits Per Symbol|
nLayers— Number of transmission layers
Number of transmission layers, specified as an integer from 1 to 8. For
nLayers > 4, the object expects two encoded transports blocks
rv— Redundancy version
Redundancy version, specified as an integer from 0 to 3 or a 1-by-2 integer
vector. If you specify
rv as a scalar, the object applies scalar
expansion when processing two encoded transport blocks. To specify a different
redundancy version for each encoded transport block, specify
as a vector.
harqID— HARQ process number
HARQ process number, specified as an integer from 0 to 15.
trblk— Decoded DL-SCH transport blocks
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
blkerr— Result of DL-SCH transport block decoding
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
blkerr indicates an error during transport block
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
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.
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 = 5120x1 int8 column vector 1 1 0 1 1 0 0 1 1 1 ⋮
blkerr = logical 0
Verify that the transmitted and received message bits are identical.
ans = logical 1
nrDLSCHDecoder object supports these four LDPC decoding
The implementation of the belief propagation algorithm is based on the decoding algorithm presented in . For transmitted LDPC-encoded codeword, c, where , the input to the LDPC decoder is the log-likelihood ratio (LLR) value .
In each iteration, the key components of the algorithm are updated based on these equations:
, initialized as before the first iteration, and
At the end of each iteration, is an updated estimate of the LLR value for the transmitted bit . The value is the soft-decision output for . If , the hard-decision output for is 1. Otherwise, the output is 0.
Index sets and are based on the parity-check matrix (PCM). Index sets and correspond to all nonzero elements in column i and row j of the PCM, respectively.
This figure highlights the computation of these index sets in a given PCM for i = 5 and j = 3.
To avoid infinite numbers in the algorithm equations, atanh(1) and atanh(-1) are set to 19.07 and –19.07, respectively. Due to finite precision, MATLAB® returns 1 for tanh(19.07) and –1 for tanh(–19.07).
The decoding terminates when all parity checks are satisfied () or after
MaximumLDPCIterationCount number of iterations.
The implementation of the layered belief propagation algorithm is based on the decoding algorithm presented in , Section II.A. The decoding loop iterates over subsets of rows (layers) of the PCM. For each row, m, in a layer and each bit index, j, the implementation updates the key components of the algorithm based on these equations:
(4) , and
For each layer, the decoding equation (5) works on the combined input obtained from the current LLR inputs and the previous layer updates .
Because only a subset of the nodes is updated in a layer, the layered belief propagation algorithm is faster compared to the belief propagation algorithm. To achieve the same error rate as attained with belief propagation decoding, use half the number of decoding iterations when using the layered belief propagation algorithm.
The implementation of the normalized min-sum decoding algorithm follows the layered belief propagation algorithm with equation (2) replaced by
where α is in the range (0, 1] and is the scaling factor specified by
ScalingFactor. This equation is an adaptation of equation (4)
presented in .
The implementation of the offset min-sum decoding algorithm follows the layered belief propagation algorithm with equation (2) replaced by
where β ≥ 0 and is the offset specified by
Offset. This equation is an adaptation of equation (5) presented in
 3GPP TS 38.212. “NR; Multiplexing and channel coding.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
 Gallager, Robert G. Low-Density Parity-Check Codes, Cambridge, MA, MIT Press, 1963.
 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
 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
Usage notes and limitations:
See System Objects in MATLAB Code Generation (MATLAB Coder).