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

Rostislav Shaniiazov
Rostislav Shaniiazov 2018년 11월 16일
All theoretical boards are for rate = 1. You used rate =1/2.
Rishi Balasubramanian
Rishi Balasubramanian 2021년 1월 21일
check SNRdB calculation
ikram DAANOUNE
ikram DAANOUNE 2021년 2월 1일
@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에 대해 자세히 알아보기

태그

질문:

2016년 9월 21일

답변:

2021년 5월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by