LDPC Decoder
Decode binary low-density parity-check (LDPC) code
Libraries:
Communications Toolbox /
Error Detection and Correction /
Block
Description
The LDPC Decoder block uses the belief propagation algorithm to decode a binary LDPC code, which is input to the block as the soft-decision output (log-likelihood ratio of received bits) from demodulation. The block decodes generic binary LDPC codes where no patterns in the parity-check matrix are assumed. For more information, see Belief Propagation Decoding.
The input and output are discrete-time signals. The ratio of the output sample time to the input sample time is:
N/K when only the information-part of the codeword is decoded
1 when the entire codeword is decoded
N is the length of the received signal and must be in the range (0, 231). K is the length of the uncoded message and must be less than N.
This icon shows all ports, including optional ports, for the LDPC Decoder block.
Examples
LDPC Encode and Decode QPSK-Modulated Signal in Simulink
Transmit an LDPC-encoded, QPSK-modulated bit stream through an AWGN channel. Demodulate and decode the received signal. Compute the error statistics.
The snr
variable is initialized using the InitFcn
callback in Model Properties>Callbacks. The SNR dB
parameter in the AWGN Channel block and the Variance
parameter in the QPSK Demodulator Baseband block initialize settings using the snr
variable.
The simulation is configured to process one input frame of data. The Error Rate Calculation block compares the transmitted binary data stream with the information data bits output by the LDPC Decoder block.
For SNR = 1 dB, the error rate is 0.
Extended Examples
DVB-S.2 Link, Including LDPC Coding in Simulink
The state-of-the-art channel coding scheme used in the second generation Digital Video Broadcasting standard (DVB-S.2), which is deployed by DIRECTV in the United States. The coding scheme is based on concatenation of LDPC (Low-Density Parity-Check) and BCH codes. LDPC codes, invented by Gallager in his seminal doctoral thesis in 1960, can achieve extremely low error rates near channel capacity by using a low-complexity iterative decoding algorithm. The outer BCH codes are used to correct sporadic errors made by the LDPC decoder.
Ports
Input
In — Log-likelihood ratios
column vector
Log-likelihood ratios, specified as an N-by-1
column vector containing the soft-decision output from demodulation.
N is the number of bits in the LDPC codeword
before modulation. Each element is the log-likelihood ratio for a
received bit and the value is more likely to be 0
if
the log-likelihood ratio is positive. The first K
elements correspond to the information-part of the input message.
Data Types: double
Output
Out — Decoded data
column vector
Decoded data, returned as a column vector. The Decision type parameter specifies whether the block outputs hard decisions or soft decisions (log-likelihood ratios).
If the Output format parameter is set to
Information part
, the output includes only the information-part of the received codeword.If the Output format parameter is set to
Whole codeword
, the output includes the whole log-likelihood ratio vector.
Data Types: double
| Boolean
Iter — Number of executed decoding iterations
positive integer
Number of executed decoding iterations, returned as a positive integer.
Dependencies
To enable this port, select the Output number of iterations executed parameter.
Data Types: double
ParChk — Final parity checks
column vector
Final parity checks after decoding the input LDPC code, returned as an (N-K)-by-1 column vector. N is the number of bits in the LDPC codeword before modulation. K is the length of the uncoded message.
Dependencies
To enable this port, select the Output final parity checks parameter.
Parameters
To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.
Parity-check matrix (sparse binary (N-K)-by-N matrix) — Parity-check matrix
ldpcDecoderConfig().ParityCheckMatrix
(default) | sparse binary matrix | nonsparse index matrix
Parity-check matrix, specified as a sparse (N –
K)-by-N binary-valued matrix.
N is the length of the received signal and must be in
the range (0, 231). K is the
length of the uncoded message and must be less than N.
The last (N – K) columns in the
parity-check matrix must be an invertible matrix in the Galois field of
order 2, gf
(2).
You can also specify the parity-check matrix as a two-column nonsparse
index matrix, I
, that defines the row and column indices
of the 1
s in the parity-check matrix such that
sparse(I(:,1),I(:,2),1)
.
This parameter accepts numeric data types. When you set this parameter to
a sparse binary matrix, this parameter also accepts the
Boolean
data type.
Example: ldpcDecoderConfig().ParityCheckMatrix
configures the binary
matrix as a 108-by-648 sparse logical matrix.
Output format — Output value format
Information part
(default) | Whole codeword
Output value format, specified as one of these values:
Information part
— The block outputs a K-by-1 column vector containing only the information-part of the received log-likelihood ratio vector. K is the length of the uncoded message.Whole codeword
— The block outputs an N-by-1 column vector containing the whole log-likelihood ratio vector. N is the length of the received signal.N and K must align with the dimension of the (N–K)-by-K parity-check matrix.
Decision type — Decision method
Hard decision
(default) | Soft decision
Decision method used for decoding, specified as one of these values:
Hard decision
— The block outputs decoded data of data typedouble
orboolean
. Specify this data type using the Output data type parameter.Soft decision
— The block outputs log-likelihood ratios of data typedouble
.
Output data type — Output value data type
double
(default) | boolean
Output value data type, specified as double
or
boolean
.
Dependencies
To enable this parameter, set the Decision type
parameter to Hard decision
.
Number of iterations — Maximum number of decoding iterations
50
(default) | positive integer
Maximum number of decoding iterations, specified as a positive integer.
Stop iterating when all parity-checks are satisfied — Condition for iteration termination
off
(default) | on
Select this parameter to terminate decoding after all parity checks are satisfied. If not all parity checks are satisfied, decoding terminates after the number of iterations specified by the Number of iterations parameter.
Output number of iterations executed — Output number of iterations executed
off
(default) | on
Select this parameter to enable the Iter output port.
Output final parity-checks — Output number of iterations executed
off
(default) | on
Select this parameter to enable the ParChk output port.
Block Characteristics
Data Types |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Algorithms
This block performs LDPC decoding using the belief propagation algorithm, also known as a message-passing algorithm.
Belief Propagation Decoding
The implementation of the belief propagation algorithm is based on the decoding algorithm presented by Gallager [2].
For transmitted LDPC-encoded codeword c = c0, c1, …, cn-1, 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, L(Qi) contains the updated estimate of the LLR value for transmitted bit ci. The value L(Qi) is the soft-decision output for ci. If L(Qi) ≤ 0, the hard-decision output for ci is 1. Otherwise, the hard-decision output for ci is 0.
If decoding is configured to stop when all of the parity checks are satisfied, the algorithm verifies the parity-check equation (H c' = 0) at the end of each iteration. When all of the parity checks are satisfied, or if the maximum number of iterations is reached, decoding stops.
Index sets and are based on the parity-check matrix (PCM). Index sets Ci and Vj correspond to all nonzero elements in column i and row j of the PCM, respectively.
This figure shows 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).
References
[1] Gallager, Robert G. Low-Density Parity-Check Codes. Cambridge, MA: MIT Press, 1963.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2007aR2024b: Change default parity-check matrix
With this update, the default parity-check matrix for the
LDPC Decoder block is now
ldpcDecoderConfig().ParityCheckMatrix
instead of
dvbs2ldpc(1/2)
.
See Also
Blocks
Objects
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)