Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Plotting BER versus SNR for QAM.

92 views
Skip to first unread message

Pornsak

unread,
Oct 29, 2002, 6:35:41 AM10/29/02
to
Dear all,

I would like to plot the BER vs SNR for QAM. I use communication tools
box from matlab to do the simulation. The result is not the same as in
the theory. Could someone explain what is wrong in the below code?

clear;
N = 10000;
M = 64;
k = log2(M);
Fd = 1;
Fs = 2;
snr = 1:20;
signal = randint(N,1,M);
modsignal = dmodce(signal,Fd,Fs,'qask',M);

% Simulation
for i=1:length(snr),
noisy(:,i) = awgn(modsignal,i);
end;
resignal = ddemodce(noisy,Fd,Fs,'qask',M);
[nbit nerr] = biterr(signal,resignal);

% 64-ary QAM from Theory
for i=1:length(snr);
Pro_err_64(i) = (2/k)*(1-(1/sqrt(M)))*erfc(sqrt((3/(2*(M-1)))*k*(10^(i/10))));
end;

% Graph BER vs SNR
semilogy(snr,nerr);
hold on;
semilogy(snr,Pro_err_64);

Thank you very much,
Pornsak

Mike McLernon

unread,
Oct 30, 2002, 1:19:28 PM10/30/02
to
Hello Pornsak,


Thanks for your question -- hopefully the following explanation will help to
provide the correct answers. I'll summarize my response in terms of a list,
as follows:


1) Be aware that the expression you used for the theoretical results is
an approximation. It is a rather close approximation, but it is not exact.
(For the purposes of this simulation exercise, however, it serves as a good
baseline.)
2) You should use the awgn function in 'measured' mode. The default
mode of the function is to assume that the noiseless input signal has a
power of 0 dBW. In the case of 64QAM generated by the dmodce function, the
power is more like 16.2 dBW. This arises because the I and Q channels of
the 64QAM signal can have values of +/-1, +/-3, +/-5, and +/-7 volts.
3) You plotted theoretical BER vs. Eb/No, likely from an expression in
Proakis's textbook. However, you need to provide the awgn function with
SNR, not Eb/No. The conversion is as follows:


a) Eb/No = (S*Tb) / (N*Bn), where
S = signal power, in W
Tb = bit time, in sec
N = noise power, in W
Bn = noise bandwidth, in Hz


b) Tb = 1/Rb = Fd * k, where
Rb = bit rate, in bits per sec
Fd = symbol rate of your MATLAB code, in symbols per sec
k = number of bits per symbol in your MATLAB code, = log2(M)


c) Bn = Fs, where
Fs = sampling rate of the simulation, in samples per sec


d) After some algebra, we have
SNR = Eb/No * (Fd * k)/Fs.


All these quantities are in absolute terms, not in terms of dB.
4) Try making these changes in your code and see what the results are .
. .


Hope this helps --
Mike


"Pornsak" <por...@yahoo.com> wrote in message
news:387fed95.0210...@posting.google.com...

0 new messages