Documentation Center

  • Trial Software
  • Product Updates

comm.LDPCEncoder System object

Package: comm

Encode binary low-density parity-check code

Description

The LDPCEncoder object encodes a binary low-density parity-check code.

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

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

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

Construction

h = comm.LDPCEncoder creates a binary low-density parity-check (LDPC) encoder System object™, h. This object performs LDPC encoding based on the specified parity-check matrix.

h = comm.LDPCEncoder('PropertyName','ValueName') creates an LDPC encoder object, h, with each specified property set to the specified value.

h = comm.LDPCEncoder(PARITY) creates an LDPC encoder object, h, with the ParityCheckMatrix property set to PARITY.

output_args = function(input_args,Name,Value) with additional options specified by one or more Name,Value pair arguments. Name can also be a property name and Value is the corresponding value. Name must appear inside single quotes (''). You can specify several name-value pair arguments in any order as Name1,Value1,…,NameN,ValueN.

Properties

ParityCheckMatrix

Parity-check matrix

Specify the parity-check matrix as a binary valued sparse matrix P with dimension (N-by-K) by N, where N > K > 0. 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.

Methods

cloneCreate LDPC Encoder object with same property values
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
stepEncode input using LDPC coding scheme

Examples

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);
    end
    fprintf('Error rate       = %1.2f\nNumber of errors = %d\n', ...
      errorStats(1), errorStats(2))

Algorithms

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

See Also

|

Was this topic helpful?