Products & Services Solutions Academia Support User Community Company

Learn more about Communications Toolbox   

fec.ldpcenc - Construct LDPC encoder object

Syntax

l = fec.ldpcenc(H)
l = fec.ldpcenc
codeword = encode(l, msg)

Description

The fec.ldpcenc function creates a low-density parity-check (LDPC) encoder object that you can use with the encode method to encode a signal.

l = fec.ldpcenc(H) constructs an LDPC encoder object l for a binary systematic LDPC code with a parity-check matrix H.

H must be a sparse zero-one matrix. n and n-k are the number of columns and the number of rows, respectively, in H. The last n-k columns in H must be an invertible matrix in GF(2).

l = fec.ldpcenc constructs an LDPC encoder object l with a default parity-check matrix (32400-by-64800). For more information, see dvbs2ldpc.

Properties

The following table describes the properties of an LDPC encoder object. Only ParityCheckMatrix is writable. All other properties are derived from it.

PropertyDescription
ParityCheckMatrixParity-check matrix of the LDPC code. Stored as a sparse logical 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 231-1
BlockLengthTotal number of bits in a codeword, n.
NumInfoBitsNumber of information bits in a codeword, k.
NumParityBitsNumber of parity bits in a codeword, n-k.
EncodingAlgorithmMethod for solving the parity-check equation to compute the parity bits using the information bits. Set to 'Forward Substitution' if the last n-k columns in H are a lower triangular matrix, 'Backward Substitution' if the last n-k columns in H are an upper triangular matrix, and 'Matrix Inverse' in all other situations.

LDPC Encoding Method

This object has a method encode that is used to encode signals.

codeword = encode(l, msg) encodes msg using the LDPC code specified by the LDPC encoder object l. msg must be a binary 1-by-NumInfoBits vector.

codeword is a binary 1-by-BlockLength vector. The first NumInfoBits bits are the information bits (msg) and the last NumParityBits bits are the parity bits. The modulo-2 matrix product of ParityCheckMatrix and codeword' is a zero vector.

Usage Example

This example demonstrates the use of this object.

% Construct a default LDPC encoder object
l = fec.ldpcenc;

% Generate a random binary message
msg = randint(1,l.NumInfoBits,2);

% Encode the message
codeword = encode(l, msg);

% Verify the parity checks (which should be a zero vector)
paritychecks = mod(l.ParityCheckMatrix * codeword', 2);

Example with a Parity-Check Matrix

This example demonstrates the construction of an LDPC encoder object with a parity-check matrix.

i = [1  3  2  4  1  2  3  3  4];   % row indices of 1s
j = [1  1  2  2  3  4  4  5  6];   % column indices of 1s
H = sparse(i,j,ones(length(i),1)); % parity-check matrix H
l = fec.ldpcenc(H);

References

[1] Gallager, Robert G., Low-Density Parity-Check Codes, Cambridge, MA, MIT Press, 1963.

See Also

dvbs2ldpc, fec.ldpcdec, modem

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS