06.06.2022 Views

B. P. Lathi, Zhi Ding - Modern Digital and Analog Communication Systems-Oxford University Press (2009)

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

598 PERFORMANCE ANALYSIS OF DIGITAL COMMUNICATION SYSTEMS

% which is f_ovsamp /T (T=l is the symbol duration )

s_up=upsample ( s_data, f_ovsamp) ;

% Identify the decision delays due to pulse shaping

% and matched filters

delayrc=2*delay_rc * f_ovsamp ;

% Generate QAM- 16 signaling with pulse-shaping

xrcos=conv ( s_up,prcos) ;

% Find the signal length

Lrcos=length (xrcos) ;

SER= [] ;

noiseq=randn (Lrcos ,l)+j *randn (Lrcos,1) ;

Es=lO;

% symbol energy

% Generating the channel noise (AWGN )

for i=l:9,

Eb2N(i)=i*2;

Eb2N_num=l0 (Eb2N(i) /10) ;

Var_n=Es/ (2*Eb2N_num) ;

signois=sqrt (Var_n/2) ;

awgnois=signois*noiseq;

% AWGN

% Add noise to signals at the channel output

yrcos=xrcos+awgnois;

% Apply matched filters first

zl=conv (yrcos, pcmatch) ;clear awgnois, yrcos;

% Sampling the received signal and acquire samples

zl=zl (delayrc+l : f_ovsamp :end) ;

%(Eb/N in dB )

% Eb/N in numeral

%1/SNR is the noise variance

% standard deviation

% Decision based on the sign of the samples

decl=sign (real (zl (l:L) ) )+sign ( real (zl (l:L) )-2)+ ...

sign (real (zl(l :L) )+2)+ ...

j*( sign ( imag (zl (l:L) ) )+sign (imag (zl (l:L) )-2)+ . ..

sign ( imag (zl (l:L) )+2) );

% Now compare against the original data to compute BER for

% the three pulses

%BER= [BER; sum(abs ( s_data-decl ))/(2*L) ]

SER= [SER; sum ( s_data~=decl) /L] ;

Q(i)=3*0. 5*erfc ( sqrt ((2*Eb2N_num/5)/2) );

%Compute the Analytical BER

end

figure (l)

subplot (lll)

figber=semilogy (Eb2N, Q, 'k-' ,Eb2N,SER , 'b- *');

axis ( (2 18 . 99e-5 l] );

legend ('Analytical ', 'Root-raised cosine');

xlabel ('E_b/N (dB) ') ;ylabel ('Symbol error probability');

set ( figber, 'Linewidth ' , 2) ;

% Constellation plot

figure (2)

subplot (lll)

plot (real (zl (l:min (L, 4000) )) ,imag (zl (l:min (L,4000) )) , '.');

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!