ldpc using matlab function

Hi,
here my matlab code for 16-QAM over AWGN channel using LDPC matlab function. I get a BER which is worse than the one without code. Does somebody have any idea about what is wrong with my code?
% Set the simulation parameters.
clear; close all
rng default
M = 16; % Modulation order
k = log2(M); % Bits per symbol
EbNoVec = (0:10)'; % Eb/No values (dB)
numSymPerFrame = 1000; % Number of QAM symbols per frame
rate=1/2;
% Set LDPC coding and decoding
hEnc = comm.LDPCEncoder;
hDec = comm.LDPCDecoder;
for n = 1:length(EbNoVec)
n
% Convert Eb/No to SNR
snrdB = EbNoVec(n) + 10*log10(k*rate);
% Generate binary data and convert to symbols
dataIn = (randi([0 1],32400,1));
% Convolutionally encode the data
dataEnc = step(hEnc, dataIn);
% QAM modulate
txSig = qammod(dataEnc,M,'InputType','bit');
% Pass through AWGN channel
rxSig = awgn(txSig,snrdB,'measured');
% Demodulate the noisy signal using hard decision (bit) and
% approximate LLR approaches
rxDataSoft = qamdemod(rxSig,M,'OutputType','approxllr', ...
'NoiseVariance',10.^(snrdB/10));
% LDPC decoding
receivedBits = step(hDec, rxDataSoft);
% Ber computation
[umErrsInFrameSoft, BER(n)] = biterr(receivedBits,dataIn);
end
semilogy(EbNoVec,BER,...
EbNoVec,berawgn(EbNoVec,'qam',M),'-*')
legend('LDPC','Uncoded')
grid
xlabel('Eb/No (dB)')
ylabel('Bit Error Rate')

3 个评论

All theoretical boards are for rate = 1. You used rate =1/2.
check SNRdB calculation
@Thomas Larhzaoui did you solve this problem?

请先登录,再进行评论。

回答(1 个)

Raed Abd-Alhameed
Raed Abd-Alhameed 2021-5-23

0 个投票

Remove the noise variance in the qamdemod function. The errors will be zero for most of teh EbNo values... I meant water falling approach occurs. Please try it and let me know, otherwise if you have another solution please let me know.

类别

帮助中心File Exchange 中查找有关 Error Detection and Correction 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by