comm.LDPCDecoder System object

Package: comm

Decode binary low-density parity-check code


The LDPCDecoder object decodes a binary low-density parity-check code.

To decode a binary low-density parity-check code:

  1. Define and set up your binary low-density parity-check decoder object. See Construction.

  2. Call step to decode a binary low-density parity-check code according to the properties of comm.LDPCDecoder. The behavior of step is specific to each object in the toolbox.


h = comm.LDPCDecoder creates a binary low-density parity-check (LDPC) decoder System object™, h. This object performs LDPC decoding based on the specified parity-check matrix, where the object does not assume any patterns in the parity-check matrix.

h = comm.LDPCDecoder('PropertyName','ValueName') creates an LDPC encoder object, h, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as ('PropertyName1','PropertyValue1',...,'PropertyNameN','PropertyValueN').

h = comm.LDPCDecoder(P) creates an LDPC decoder object, h, where the input P specifies the parity check matrix.



Parity-check matrix

Specify the parity-check matrix as a binary valued sparse matrix P with dimension (NK)-by-N, where N > K > 0. The last N−K columns in the parity check matrix must be an invertible matrix in GF(2). Alternatively, you can specify a two-column, non-sparse integer index matrix I that defines the row and column indices of the 1s in the parity-check matrix, such that P = sparse(I(:,1), I(:,2), 1).

This property accepts numeric data types. When you set this property to a sparse matrix, it also accepts a logical data type. The upper bound for the value of N is 231-1.

The default is the sparse parity-check matrix of the half-rate LDPC code from the DVB-S.2 standard, which is the result of dvbs2ldpc(1/2).

To generate code, set this property to a non-sparse index matrix. For instance, you can obtain the index matrix for the DVB-S.2 standard from dvbs2ldpc(R, 'indices') with the second input argument explicitly specified to indices, where R represents the code rate.


Select output value format

Specify the output value format as one of 'Information part' | 'Whole codeword'. The default is 'Information part'. When you set this property to 'Information part', the output contains only the message bits and is a K element column vector, assuming an (NK)-by-K parity check matrix. When you set this property to 'Whole codeword', the output contains the codeword bits and is an N element column vector.


Decision method

Specify the decision method used for decoding as one of 'Hard decision' | 'Soft decision'. The default is 'Hard decision'. When you set this property to 'Hard decision', the output is decoded bits of double or logical data type. When you set this property to 'Soft decision', the output is log-likelihood ratios of double data type.


Condition for iteration termination

Specify the condition to stop the decoding iterations as one of 'Maximum iteration count' | 'Parity check satisfied'. The default is 'Maximum iteration count'. When you set this property to 'Maximum iteration count', the object will iterate for the number of iterations you specify in the MaximumIterationCount property. When you set this property to 'Parity check satisfied', the object will determine if the parity checks are satisfied after each iteration and stops if all parity checks are satisfied.


Maximum number of decoding iterations

Specify the maximum number of iterations the object uses as an integer valued numeric scalar. The default is 50. This applies when you set the IterationTerminationCondition property to 'Maximum iteration count'.


Output number of iterations performed

Set this property to true to output the actual number of iterations the object performed. The default is false.


Output final parity checks

Set this property to true to output the final parity checks the object calculated. The default is false.


cloneCreate LDPC Decoder object with same property values
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
stepDecode input using LDPC decoding scheme


Transmit an LDPC-encoded, QPSK-modulated bit stream through an AWGN channel, then demodulate, decode, and count errors.

    hEnc = comm.LDPCEncoder;
    hMod = comm.PSKModulator(4, 'BitInput',true);
    hChan = comm.AWGNChannel(...
            'NoiseMethod','Signal to noise ratio (SNR)','SNR',1);
    hDemod = comm.PSKDemodulator(4, 'BitOutput',true,...
            'DecisionMethod','Approximate log-likelihood ratio', ...
            'Variance', 1/10^(hChan.SNR/10));
    hDec = comm.LDPCDecoder;
    hError = comm.ErrorRate;
    for counter = 1:10
      data           = logical(randi([0 1], 32400, 1));
      encodedData    = step(hEnc, data);
      modSignal      = step(hMod, encodedData);
      receivedSignal = step(hChan, modSignal);
      demodSignal    = step(hDemod, receivedSignal);
      receivedBits   = step(hDec, demodSignal);
      errorStats     = step(hError, data, receivedBits);
    fprintf('Error rate       = %1.2f\nNumber of errors = %d\n', ...
      errorStats(1), errorStats(2))


This object implements the algorithm, inputs, and outputs described on the LDPC Decoder block reference page. The object properties correspond to the block parameters.

Introduced in R2012a

Was this topic helpful?