Decode binary lowdensity paritycheck code specified by paritycheck matrix
Block sublibrary of Error Detection and Correction
This block implements the messagepassing algorithm for decoding lowdensity paritycheck (LDPC) codes, which are linear error control codes with sparse paritycheck matrices and long block lengths that can attain performance near the Shannon limit.
The LDPC Decoder block is designed to:
Decode generic binary LDPC codes where no patterns in the paritycheck matrix are assumed.
Execute a number of iterations you specify or run until all paritychecks are satisfied.
Output hard decisions or soft decisions (loglikelihood ratios) for decoded bits.
(n – k) and n are the number of rows and columns, respectively, in the paritycheck matrix.
This block accepts a realvalued, $$n\times 1$$ column vector input signal of type double. Each element is the loglikelihood ratio for a received bit (more likely to be 0 if the loglikelihood ratio is positive). The first k elements correspond to the information part of a codeword.
Both the input and the output are discretetime signals. The ratio of the output sample time to the input sample time is $$n/k$$ if only the information part is decoded, and 1 if the entire codeword is decoded.
The input to the LDPC decoder is the loglikelihood ratio (LLR), $$L({c}_{i})$$, which is defined by the following equation
$$L({c}_{i})=\mathrm{log}\left(\frac{\mathrm{Pr}({c}_{i}=0\text{channeloutputfor}{c}_{i})}{\mathrm{Pr}({c}_{i}=1\text{channeloutputfor}{c}_{i})}\right)$$
where $${c}_{i}$$ is the ith bit of the transmitted codeword, c. There are three key variables in the algorithm: $$L({r}_{ji})$$, $$L({q}_{ij})$$, and $$L({Q}_{i})$$. $$L({q}_{ij})$$ is initialized as $$L({q}_{ij})=L({c}_{i})$$. For each iteration, update $$L({r}_{ji})$$, $$L({q}_{ij})$$, and $$L({Q}_{i})$$ using the following equations
$$L({r}_{ji})=2\text{\hspace{0.17em}}\text{atanh}\text{\hspace{0.17em}}\left({\displaystyle \prod _{{i}^{\prime}\in {V}_{j}\backslash i}\mathrm{tanh}\left(\frac{1}{2}L({q}_{{i}^{\prime}j})\right)}\right)$$
$$L({q}_{ij})=L({c}_{i})+{\displaystyle \sum _{{j}^{\prime}\in {C}_{i}\backslash j}L({r}_{{j}^{\prime}i})}$$
$$L({Q}_{i})=L({c}_{i})+{\displaystyle \sum _{{j}^{\prime}\in {C}_{i}}L({r}_{{j}^{\prime}i})}$$
where the index sets, $${C}_{i}\backslash j$$ and $${V}_{j}\backslash i$$, are chosen as shown in the following example.
Suppose you have the following paritycheck matrix H:
$$H=\left(\begin{array}{cccccccccc}1& 1& 1& 1& 0& 0& 0& 0& 0& 0\\ 1& 0& 0& 0& 1& 1& 1& 0& 0& 0\\ 0& 1& 0& 0& 1& 0& 0& 1& 1& 0\\ 0& 0& 1& 0& 0& 1& 0& 1& 0& 1\\ 0& 0& 0& 1& 0& 0& 1& 0& 1& 1\end{array}\right)$$
For $$i=5$$ and $$j=3$$, the index sets would be
At the end of each iteration, $$L({Q}_{i})$$ provides an updated estimate of the a posteriori loglikelihood ratio for the transmitted bit $${c}_{i}$$.
The softdecision output for $${c}_{i}$$ is $$L({Q}_{i})$$. The harddecision output for $${c}_{i}$$ is 1 if $$L({Q}_{i})<0$$, and 0 otherwise.
If the property DoParityCheck
is set to 'no'
,
the algorithm iterates as many times as specified by the Number
of iterations parameter.
If the property DoParityCheck
is set to 'yes'
,
then at the end of each iteration the algorithm verifies the parity
check equation ($$H{c}^{\text{T}}=0$$) and stops if
it is satisfied.
In this algorithm, atanh(1) and atanh(1) are set to be 19.07 and 19.07 respectively to avoid infinite numbers from being used in the algorithm's equations. These numbers were chosen because MATLAB returns 1 for tanh(19.07) and 1 for tanh(19.07), due to finite precision.
This parameter accepts a sparse matrix with dimension n k by n (where n >k > 0) of real numbers. All nonzero elements must be equal to 1. The upper bound limit for the value of n is 2^{31}1
The output is a realvalued column vector signal. The options
are Information part
and Whole
codeword
.
When you this parameter to Information part
,
the output contains k elements.
When you set this parameter to whole codeword
,
the output contains n elements
The options are Hard decision
and Soft
decision
.
When you set this parameter to Hard decision
,
the output is decoded bits (of type double or boolean).
When you set this parameter to Soft decision
,
the output is loglikelihood ratios (of type double).
This parameter appears only when Decision type is
set to Hard decision
.
The options are boolean
and double
.
This can be any positive integer.
If checked, the block will determine whether the parity checks are satisfied after each iteration and stop if all are satisfied.
Creates an output port on the block when selected.
Creates an output port on the block when selected.
Port  Supported Data Types 

In 

Out 

Enter commdvbs2
at
the command line to see an example that uses this block.
[1] Gallager, Robert G., LowDensity ParityCheck Codes, Cambridge, MA, MIT Press, 1963.