matlabsimulationcommunicationmodulation

Simulate LDPC and QAM in MATLAB


I want to study LDPC and I want to simulate a program. This program will use LDPC on a randomly generated 1x32000 size binary array, then it will modulate with 16-QAM, add noise for SNR=20dB, do demodulation for 16-QAM and finally decode it using LDPC. When I run the program and check it for BER, I get error around %90 which is definitely not correct. Can you help me?

clear all
clc
M = 16;
SNR = 20;

ldpcEncoder = comm.LDPCEncoder(dvbs2ldpc(1/2));
ldpcDecoder = comm.LDPCDecoder(dvbs2ldpc(1/2));

data = randi([0 1],32400,1);
newData = ldpcEncoder(data);

a = qammod(newData,M,'InputType','bit');

b = awgn(a,SNR,'measured');

c = qamdemod(b,M,'OutputType','bit');

result = ldpcDecoder(c);
error = biterr(data,result)/length(data)

Solution

  • The LDPC decoder object expects an input with "soft" bits (log-likelihood ratio), whereas you are feeding it with "hard", unipolar bits. So, replace the line

    c = qamdemod(b,M,'OutputType','bit');
    

    by

    c = qamdemod(b,M,'OutputType','llr');