Vous êtes sur la page 1sur 2

EXPERIMENT 6:

PROBABILITY OF ERROR FOR MARY PSK, QAM AND SCATTER PLOTS

1) OBJECTIVE

To gain a practical understanding of the concepts and functions of Matlab.


To experiment with the realization of M-ary PSK and QAM using the Matlab.
To compare the M-ary PSK or QAM Pe curves against those theoretical ones given in
Lecture book of Proakis 2002 as Fig. 7.57 and 7.62.

2) PRELAB

Two passband data transmission systems are to be compared. One system uses
16-PSK, and the other uses 16-QAM. Both systems are required to produce an average
probability of symbol error to 10-3. Compare and explain the signal-to-noise ratio
requirements of these two systems.

3) LAB WORK

1. Copy the experiment file (programme) into the directory of your name.
2. The programme takes Mary PSK or QAM random signal where M is preselectable.
Using modmap and demodmap built-in functions of MATLAB, detection is made via
Monte-Carlo method.
3. By commenting and selecting various lines in the programme, it is possible to run it
for either PSK or QAM at different M.
4. This way, it is possible to compare the Pe curves against those theoretical ones given
in Proakis 2002 as Fig. 7.57 and 7.62. These sheets are attached.
5. By selecting a suitable number of symbols (n) on line 3, at each individual M = 2, 4, 8,
16, 32 of PSK, run the programme and see if the outputs match Fig. 7.57 of Proakis
2002. For better viewing adjust SNR_db range on line 17 appropriately.
6. Repeat 5 for QAM at M = 4, 16, 64, compare your results with Fig. 7.62 of Proakis
2002.
7. Explain quantitatively the differences you find in 5 and 6 between the outputs of the
programme and those of the curves found in Proakis 2002.
8. Compare at M = 4 PSK and QAM.
9. By removing comments on line 14, 37 and 38, observe the scatter plots both before
and transmissions and make your comments in your experiment report.
10. Prepare your final report by including all necessary illustrations and text.

1
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');

Vous aimerez peut-être aussi