Could LDPC function change length of message? and how?

331 Views Asked by At

This is MATLAB code about LDPC (Low Density Parity Check). Could I change the length of data? and how?

ldpcEncoder = comm.LDPCEncoder;
data = logical(randi([0 1],32400,1));
% Transmit and receive LDPC coded signal data
    encData = ldpcEncoder(data);

I try to change the length of data, but MATLAB always warns that "Input must be a column vector of length K, the message length." Is this length of data is fixed?

2

There are 2 best solutions below

2
PedroRodriguez On

The input of the LDPC codes should be always of length K, otherwise, the parity matrix would change and the code would be different. When you create an LDPCEncoder object in MATLAB, you are defining the K and N lengths, so the input data can't change.

0
PedroRodriguez On

Yes, you can. You can create your comm.LDPCEncoder with certain parity check matrix in the following way:

comm.LDPCEncoder(ParityCheckMatrix) 

For example, if you want to generate a DVB-S2 encoder for a code rate of 1/2, the code will be:

p = dvbs2ldpc(1/2);
enc = comm.LDPCEncoder(p);