eem496 communication systems laboratory - report6 - probability of error for mary psk, qam and...
DESCRIPTION
Instructor : Ass. Prof. Nuray AT TA : Res. Assistant. Zafer Hüseyin ERGANANADOLU UNIVERSITY DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERINGEEM 496Communication Systems LaboratoryExperiment 6PROBABILITY OF ERROR FOR MARY PSK, QAM AND SCATTER PLOTSDate: 28.05.201016169230356OSMAN GÜLERCAN1) PurposeThe purpose of this experiment is to study with the realization of M -ary PSK and QAM using the Matlab and compare the M-ary PSK or QAM curves vs. Lecture book of Proakis 2002 asTRANSCRIPT
Instructor : Ass. Prof. Nuray AT
TA : Res. Assistant. Zafer Hüseyin ERGAN
ANADOLU UNIVERSITYDEPARTMENT OF ELECTRICAL AND ELECTRONICS
ENGINEERING
EEM 496
Communication Systems
Laboratory
Experiment 6
PROBABILITY OF ERROR FOR MARY PSK, QAM AND
SCATTER PLOTS
Date: 28.05.2010
16169230356 OSMAN GÜLERCAN
1) Purpose
The purpose of this experiment is to study with the realization of M-ary PSK
and QAM using the Matlab and compare the M-ary PSK or QAM curves vs.
Lecture book of Proakis 2002 as Fig. 7.57 and 7.62.
2) Lab Work
In Matlab Code, we changed the number of symbols n at least 10e5, and M-
ary number M to 2, 4, 8, 16, 32 of PSK. Then, we compared the output
results with Fig. 7.57 of Proakis 2002.
Also, M-ary number M to 2, 4, 8, 16, 32 of QAM, and compared results with
Fig. 7.62 of Proakis 2002.
In addition, we observed the scatter plots by removing comments on line 14,
37 and 38.
3) Results
M=2, n=1000, PSKX=2, Y=0.03; X=4, Y=0.012
M=2, n=100000, PSKX=4, Y=0.01259; X=8, Y=0.00019
M=4, n=100000, PSKX=4, Y=0.02481; X=8, Y=0.00041
M=8, n=100000, PSK
X=5, Y=0.09705; X=8, Y=0.01857
M=16, n=100000, PSKX=7, Y=0.2147; X=10, Y=0.08192
M=32, n=100000, PSK
X=6, Y=0.5385; X=9, Y=0.3821
Fig. 7.57 of Proakis Results for PSK:
M=4: X=4, Y=2.5x10e-2; M=16: X=10, Y=1x10e-1; M=32: X=9, Y=4x10e-1
M=4, n=1000000, QAM
X=5, Y=0.01191; X=8, Y=0.00036
M=16, n=100000, QAMX=5, Y=0.1619; X=8, Y=0.03526
M=64, n=100000, QAM
X=5, Y=0.5073; X=8, Y=0.2857
Fig. 7.62 of Proakis Results for QAM:M=4: X=5, Y=10e-2; M=16: X=8, Y=4x10e-2
M=2, n=100000, PSK Scatter Constellation
M=2, n=100000, PSK Scatter Noise
M=4, n=100000, PSK Scatter Constellation
M=4, n=100000, PSK Scatter Noise
M=8, n=100000, PSK Scatter Constellation
M=8, n=100000, PSK Scatter Noise
M=16, n=100000, PSK Scatter Constellation
M=16, n=100000, PSK Scatter Noise
M=32, n=100000, PSK Scatter Constellation
M=32, n=100000, PSK Scatter Noise
M=64, n=100000, PSK Scatter Constellation
M=64, n=100000, PSK Scatter Noise
M=4, n=100000, QAM Scatter Constellation
M=4, n=100000, QAM Scatter Noise
M=16, n=100000, QAM Scatter Constellation
M=16, n=100000, QAM Scatter Noise
M=64, n=100000, QAM Scatter Constellation
M=64, n=100000, QAM Scatter Noise
4) Matlab Code
% This is a generalized programme producing Pe for Mary PSK and QAM
clear;clc;close all;%clf reset
M = 64;n = 10000;Fd = 1; Fs = 1;[inp,qua] = qaskenco(M);Es = 1;
%%%% Normalization for QAM, no need for PSK since length of vectors are the same
%%%%
%%%% Rectangular QAM is used, not optimum constelletion
inpn = sqrt(M*Es./sum(inp.^2 + qua.^2)).*inp;
quan = sqrt(M*Es./sum(inp.^2 + qua.^2)).*qua;
x_set = randint(n,1,M); % Original signal
%st = modmap(x_set,Fd,Fs,'psk',M); % Mapped signal, using Mary-ary PSK. Select this or
the next line
%%%% The following inpn and quan values are from Foschini IEEE Trans on Com 1974
%inpn = [0.007 0.126 0.644 1.279 0.906 -1.032 -0.504 -0.611 0.758 -0.911 -0.388 0.245 -
0.272 0.376 -1.136 0.512]';
%quan = [0.767 0.106 0.545 0.305 -0.771 -0.103 0.332 1.020 -0.119 -0.772 -0.329 -0.552 -
1.001 -1.215 0.571 1.211]';
x_cons = [inpn quan];
%scatterplot(x_cons);set(gcf,'Color','w');pause
st = modmap(x_set,Fd,Fs,'qask/arb',inpn,quan); % Mapped signal, using Mary-ary
rectangular QAM
%%%%% Setting noise power, Average symbol signal power is unity, bit SNR is used
E_stn = 1;E_st = E_stn/log2(M);SNR_db = -2:12;dblen = length(SNR_db);
set_ntp = 10*log10(E_st) - SNR_db - 3.0103;SNRarr = 10.^(0.1*SNR_db);
P_exp = [];tic;SNR_sec = 15;
for iSNR = 1:dblen
nt = wgn(length(st),2,set_ntp(iSNR));
rt = st + nt; % Mapped signal with noise added
if iSNR == SNR_sec; rt_select = rt;end
r_det = demodmap(rt,Fd,Fs,'psk',M); % Demap noisy signal. Note : If this line is valid, then
comment the next line
%r_det = demodmap(rt,Fd,Fs,'qask/arb',inpn,quan); % Demap noisy signal
P_exp1 = symerr(x_set,r_det) / n; %Pe after demapping noisy signal
P_exp = [P_exp P_exp1];end
figure(2);semilogy(SNR_db,P_exp,'-k ','LineWidth',2);set(gcf,'Color','w')
set(gca,'FontSize',16);toc;
xlabel('Bit SNR = \it\xi_b\rm\bf / \itN\rm\bf_0 in dB','FontSize',14,'FontWeight','bold');
ylabel('\itSER \rm\bf for M ary signals via Monte Carlo
method','FontSize',14,'FontWeight','bold');
Mstr = [' \itM = \rm\bf' num2str(M)];nstr = [' \itn = \rm\bf' num2str(n)];
leg1 = {Mstr;' ';nstr};
diffx = max(SNR_db)-min(SNR_db);diffy = max(P_exp)-min(P_exp);
text(diffx*0.4,diffy*.01,leg1,'FontSize',12,'FontWeight','bold','Edgecolor','black');
%figure(3)
%scatterplot(rt_select,1,0,'b.');set(gcf,'Color','w');
5) Conclusion
In this experiment, we studied the realization of M-ary PSK and QAM using
the Matlab. Firstly, we investigated PSK modulation for M=2, 4, 8, 16, 32.
Nevertheless, we compared the results with Fig. 7.57 of Proakis 2002.
Secondly, we tested QAM at M = 4, 16, 64 and compared the results again
with Fig. 7.62 of Proakis 2002. Thirdly, we observed the scatter plots by
implementing Matlab codes. To sum up, we observed the M-ary PSK and
QAM test results using Matlab.