My LDPC BER curve is bad
8 views (last 30 days)
Show older comments
Hello,
For my Masters Thesis, I am trying to simulate Quasi Cyclic Low-density Parity-Check Codes (QC - LDPC) codes on Matlab. Here are the details regarding it.
Parity Matrix - Quasi Cyclic LDPC (93 x 155)
Encoder - Approximate Lower Triangular Encoding (rearrange matrix to ALT form)
Decoders - Sum-Product and Min Sum Decoders.
Message Size - 62 bits
Modulation - BPSK
Channel - AWGN
I believe that I have properly coded. And I have been unable to track where the mistake is happening. But for some unidentifiable reason, by error rates are not what they're expected to be. I have attached the BER curve for reference. Any sort of help would be really appreciated. I have been plucking out all my hair for the past 20+ days failing to create a proper simulation. Thanks in advance.
clear
clc
[bb, Ha] = qcldpc(3, 5, 2, 5, 31); %Creates PCM.
H = alt(Ha); %Rearrange PCM to ALT form for Encoding
[N1, N2] = size(H);
k = N2-N1;
pcs =1;
while (pcs ~= 0)
y = round(rand(1, N2-N1));
encode = enc(H,y);
msg = [y encode];
cs = mod(msg * H', 2); %to detect a proper codeword
pcs = sum(cs);
end
[~, bits] = size(msg);
dB = 1:5; % range of SNR values in dB
R = k/N2; % code rate
iter = 10; %Iterations
N0 = (10.^(-dB/10)); %Variance values
for i = 1 : length(dB)
ber1(i) = 0; ber2(i) = 0;
for j = 1:bits
mod = bpsk(msg); %bpsk modulation
bp = mod';
tx = bp + sqrt(N0(i)/2) * randn(size(bp)); %Transmitted with AWGN
dp(i,:) = dbpsk(tx); %Demodulated
Li = -dp(i,:);
vhat1(i,:) = SPA(tx, Ha, N0(i), iter); %Decoding Using Sum Product Algorithm
vhat2(i,:) = MSA(Li, Ha, iter); %Decoding Using Min Sum Algorithm
[n1, r1] = biterr(vhat1(i,:), msg);
[n2, r2] = biterr(vhat2(i,:), msg);
ber1(i) = ber1(i) + r1;
ber2(i) = ber2(i) + r2;
end
BER1(i) = ber1(i) / (bits * length(dB)); %BER Calculation
BER2(i) = ber2(i) / (bits * length(dB));
end
figure('Name','BER vs SNR','NumberTitle','off');
semilogy(dB, BER1, 'o-');
hold;
semilogy(dB, BER2, 'o--');
legend('SPA','MSA')
grid on;
hold off;
1 Comment
Rahul Raj
on 16 Aug 2023
Can you tell what method you are using for creating a quasi-cyclc LDPC code matrix or parity check matrix?
Answers (0)
See Also
Categories
Find more on PHY Components in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!