estimate BER for LDPC 1/2 code

조회 수: 8 (최근 30일)
pertesis aris
pertesis aris 2020년 3월 7일
댓글: pertesis aris 2020년 3월 29일
I try to find the ber for LDPC code but I the result it seems wrong. pls help!!
EbNoVec = (-1:0.5:11 )'; % Eb/No values (dB)
berEst = zeros(size(EbNoVec));
bpskModulator = comm.BPSKModulator;
bpskDEModulator = comm.BPSKDemodulator;
p = dvbs2ldpc(1/2);
ldpcEncoder = comm.LDPCEncoder(p);
ldpcDecoder = comm.LDPCDecoder(p);
msg = logical(randi([0 1],size(p,2)-size(p,1),1));
for n = 1:length(EbNoVec)
% Reset the error and bit counters
numErrs = 0;
numBits = 0;
while numErrs < 1000 && numBits < 1e6
% Transmit and receive LDPC coded signal data
encData = ldpcEncoder(msg);
%channel
dataMod_psk = bpskModulator(encData);
% Pass through AWGN channel
channel = comm.AWGNChannel('EbNo',EbNoVec(n),'BitsPerSymbol',1);
dataMod_psk2=channel(dataMod_psk);
dataDeMod_psk3=bpskDEModulator(dataMod_psk2);
rxBits = ldpcDecoder(dataDeMod_psk3);
MSG=rxBits;
chk = isequal(msg,MSG);
% Calculate the number of bit errors
nErrors = biterr(msg,MSG);
% Increment the error and bit counters
numErrs = numErrs + nErrors;
numBits = numBits + length(msg);
end
% Estimate the BER
berEst(n) = numErrs/numBits;
end
berTheory = berawgn(EbNoVec,'psk',2,'nondiff');
semilogy(EbNoVec,berEst,'-.')
grid
legend('Estimated BER ldpc')
xlabel('Eb/No (dB)')
ylabel('Bit Error Rate')

채택된 답변

Sriram Tadavarty
Sriram Tadavarty 2020년 3월 19일
편집: Sriram Tadavarty 2020년 3월 19일
Hi Pertesis,
The issue you observe is due to the usage of comm.BPSKDemodulator with hard decision (which is the default) in conjunction with the LDPC decoder. Note that LDPC decoder expects the input to be the LLR's, but due to the hard decision from the BPSK demodulation, the output is bits from it. This is provided to LDPC decoder and it just wasn't able to decode any of it properly. I suggest you to make the following update to the BPSK demodulator and place the EbNoVec range from -11:0.1:2 to see the free falling curve.
bpskDEModulator = comm.BPSKDemodulator('DecisionMethod',"Log-likelihood ratio");
More details of the usage of LDPC decoder and BPSK demod can be accessed with the links.
Hope this helps.
Regards,
Sriram
  댓글 수: 1
pertesis aris
pertesis aris 2020년 3월 29일
ok thnx for the help. I would like to ask who can I use comm.LDPCEncoder for 16384 bits length?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 PHY Components에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by