Main Content

ldpcEncoderConfig

Create LDPC encoder configuration

Since R2021b

Description

The ldpcEncoderConfig object is a configuration object for the ldpcEncode function. The object specifies the low-density parity-check (LDPC) matrix and read-only properties to provide information about the configured matrix.

Creation

Description

encodercfg = ldpcEncoderConfig creates an LDPC encoder configuration object that specifies a rate 5/6 LDPC code from the WLAN 802.11™ standard [1].

encodercfg = ldpcEncoderConfig(H) configures the output object setting the ParityCheckMatrix property to H.

example

encodercfg = ldpcEncoderConfig(decodercfg) sets properties based on the input ldpcDecoderConfig configuration object, decodercfg.

Validation of the object settings is performed when the ldpcEncode function is called with the object as an input.

Properties

expand all

Parity-check matrix, specified as a sparse logical (NK)-by-N matrix, where N > K > 0. The last NK rows of the parity-check matrix must be invertible in a Galois field of order 2. N is the LDPC codeword block length. K is the number of information bits in the LDPC codeword. The default is the parity-check matrix of rate 5/6 LDPC code with a block length of 648 as specified in the WLAN 802.11 standard [1]. Specifically, the default is the sparse logical 108-by-648 matrix H output by the ldpcQuasiCyclicMatrix function in this code.

P = [
 17 13  8 21  9  3 18 12 10  0  4 15 19  2  5 10 26 19 13 13  1  0 -1 -1
  3 12 11 14 11 25  5 18  0  9  2 26 26 10 24  7 14 20  4  2 -1  0  0 -1
 22 16  4  3 10 21 12  5 21 14 19  5 -1  8  5 18 11  5  5 15  0 -1  0  0
  7  7 14 14  4 16 16 24 24 10  1  7 15  6 10 26  8 18 21 14  1 -1 -1  0
 ];
blockSize = 27;
H = ldpcQuasiCyclicMatrix(blockSize,P);

Data Types: logical

This property is read-only.

Block length of the LDPC codeword (N), specified as a positive scalar. N equals the number of columns in the parity-check matrix.

Data Types: double

This property is read-only.

Number of information bits in the LDPC codeword (K), specified as a positive scalar. K equals the number of columns of the parity-check matrix minus the number of rows of the parity-check matrix.

Data Types: double

This property is read-only.

Number of parity-check bits in the LDPC codeword (NK), specified as a positive scalar. NK equals the number of rows in the parity-check matrix.

Data Types: double

This property is read-only.

Code rate of the LDPC code, specified as a positive scalar that is equal to NumInformationBits/BlockLength.

Data Types: double

LDPC encoder configuration object, returned as a structure.

Data Types: struct

Examples

collapse all

Initialize parameters for the prototype matrix and block size to configure a rate 3/4 LDPC code specified in IEEE® 802.11. Create the parity-check matrix by using the ldpcQuasiCyclicMatrix function.

P = [16 17 22 24  9  3 14 -1  4  2  7 -1 26 -1  2 -1 21 -1  1  0 -1 -1 -1 -1
     25 12 12  3  3 26  6 21 -1 15 22 -1 15 -1  4 -1 -1 16 -1  0  0 -1 -1 -1
     25 18 26 16 22 23  9 -1  0 -1  4 -1  4 -1  8 23 11 -1 -1 -1  0  0 -1 -1
      9  7  0  1 17 -1 -1  7  3 -1  3 23 -1 16 -1 -1 21 -1  0 -1 -1  0  0 -1
     24  5 26  7  1 -1 -1 15 24 15 -1  8 -1 13 -1 13 -1 11 -1 -1 -1 -1  0  0
      2  2 19 14 24  1 15 19 -1 21 -1  2 -1 24 -1  3 -1  2  1 -1 -1 -1 -1  0
    ];
blockSize = 27;
pcmatrix = ldpcQuasiCyclicMatrix(blockSize,P);

Create an LDPC encoder configuration object, displaying its properties. Generate random information bits by using the NumInformationBits property of the configuration object to specify the number of information bits in an LPDC codeword. Encode the information bits by the LDPC code specified by the LDPC encoder configuration object.

cfgLDPCEnc = ldpcEncoderConfig(pcmatrix)
cfgLDPCEnc = 
  ldpcEncoderConfig with properties:

     ParityCheckMatrix: [162x648 logical]

   Read-only properties:
           BlockLength: 648
    NumInformationBits: 486
    NumParityCheckBits: 162
              CodeRate: 0.7500

infoBits = rand(cfgLDPCEnc.NumInformationBits,1) < 0.5;
codeword = ldpcEncode(infoBits, cfgLDPCEnc);

References

[1] IEEE® Std 802.11-2020 (Revision of IEEE Std 802.11-2016). "Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications." IEEE Standard for Information technology — Telecommunications and information exchange between systems. Local and metropolitan area networks — Specific requirements.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2021b