Main Content


Low-density parity-check (LDPC) codes from DVB-S.2 standard



H = dvbs2ldpc(r) returns the parity-check matrix H of the LDPC code with code rate r from the Digital Video Broadcasting standard DVB-S.2. The block length of the code is 64,800.

H = dvbs2ldpc(r,outputFormat) specifies the format for the output parity-check matrix.


collapse all

Create an LDPC parity check matrix for a code rate of 3/5 from the DVB-S.2 standard.

p = dvbs2ldpc(3/5);

Create an LDPC encoder configuration object from the parity-check matrix p. The parity-check matrix has dimensions of (N-K)-by-N. In the configuration object, the BlockLength property is N, and the NumInformationBits property is K. Show the properties of the object. Encode a message with one column of information bits.

cfg = ldpcEncoderConfig(p)
cfg = 
  ldpcEncoderConfig with properties:

     ParityCheckMatrix: [25920x64800 logical]

   Read-only properties:
           BlockLength: 64800
    NumInformationBits: 38880
    NumParityCheckBits: 25920
              CodeRate: 0.6000

infobits = randi([0 1],cfg.NumInformationBits,1);
enc = ldpcEncode(infobits,cfg);

Input Arguments

collapse all

Code rate, specified as 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 8/9, or 9/10.

Data Types: double

Output format for parity-check matrix H, specified as 'sparse' or 'indices'.

If you set this value to 'sparse', H is a sparse logical matrix. If you set this value to 'indices', H is a two-column matrix that defines the row and column indices of the 1s in H.

Data Types: char | string

Output Arguments

collapse all

Parity-check matrix, returned as a matrix.

The default parity-check matrix of size 32,400-by-64,800 corresponds to an irregular LDPC code with the structure shown in this table.

RowNumber of 1s per Row
2 to 324007

ColumnNumber of 1s per Column
1 to 129608

Columns from 32,401 to 64,800 form a lower triangular matrix. Only the elements on the main diagonal of the matrix and the subdiagonal immediately below the main diagonal are 1s. This LDPC code is used in conjunction with a BCH code in the DVB-S.2 standard to achieve a packet error rate below 10–7 at about 0.7 dB to 1 dB from the Shannon limit.


[1] ETSI Standard EN 302 307 V1.4.1: Digital Video Broadcasting (DVB); Second generation framing structure, channel coding and modulation systems for Broadcasting, Interactive Services, News Gathering and other broadband satellite applications (DVB-S2), European Telecommunications Standards Institute, Valbonne, France, 2005-03.

Extended Capabilities

Version History

Introduced in R2007a