Main Content

ldpcPCM

Generate parity-check matrix for LDPC coding

Since R2025a

Description

H = ldpcPCM(N,K) returns a parity-check matrix (PCM), H, for a codeword of block length N with K bits of information per codeword.

example

Examples

collapse all

Encode information bits using a 648 block length and 1/2 rate LDPC code from IEEE™ 802.15.4ab standard.

blockLength = 648;
codeRate = 1/2;

Find the number of information bits per codeword.

k = floor(blockLength*codeRate);

Create a corresponding parity-check matrix.

H = ldpcPCM(blockLength,k);
output1 = H(10,:)
output1 = 1×648 sparse logical array (7 nonzeros)
   (1,10)     1
   (1,118)    1
   (1,145)    1
   (1,226)    1
   (1,307)    1
   (1,335)    1
   (1,361)    1

Encode the information bits.

cfg = ldpcEncoderConfig(H);
infoBits = randi([0 1], cfg.NumInformationBits,1,'int8');
codeWord = ldpcEncode(infoBits,cfg);
output2 = codeWord(1:5)
output2 = 5×1 int8 column vector

   1
   1
   0
   1
   1

Input Arguments

collapse all

Block length for generating the PCM, specified as a positive scalar. For PCMs based on the IEEE® 802.15.4b standard, the values are 648, 1296, or 1944.

Data Types: double | single

Length of information bits per codeword for generating the corresponding PCM, specified as a positive scalar. For PCMs based on the IEEE 802.15.4b standard, the K value must be set according to the corresponding N value.

Supported (N,K) pairs

NK
1944972
1296648
648324

Data Types: double | single

Output Arguments

collapse all

Parity check matrix corresponding to the information bits length K and block length N, returned as a sparse logical matrix. The size of H is (NK)xN.

References

[1] "Coherent PHY layer proposal for 15.4ab TFD," IEEE 802.15 WSN™ Task Group 4ab (TG4ab), 802.15.4 UWB Next Generation.

Extended Capabilities

expand all

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

Version History

Introduced in R2025a