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 commentaires

Rostislav Shaniiazov
Rostislav Shaniiazov le 16 Nov 2018
All theoretical boards are for rate = 1. You used rate =1/2.
Rishi Balasubramanian
Rishi Balasubramanian le 21 Jan 2021
check SNRdB calculation
ikram DAANOUNE
ikram DAANOUNE le 1 Fév 2021
@Thomas Larhzaoui did you solve this problem?

Connectez-vous pour commenter.

Réponses (1)

Raed Abd-Alhameed
Raed Abd-Alhameed le 23 Mai 2021

0 votes

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.

Catégories

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by