06.06.2022 Views

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

716 DIGITAL COMMUNICATIONS UNDER LINEARLY DISTORTIVE CHANNELS

% Correct carrier and synchronization is assumed .

% Root-raised cosine pulse of rolloff factor = 0.5 is used

% Matched filter is applied at the receiver front end .

% The program estimates the symbol error rate (SER) at different Eb/N

clear;clf;

L=l000000;

% Total data symbols in experiment is 1 million

% To display the pulse shape , we oversample the signal

% by factor of f_ovsamp=S

f_ovsamp=8 ;

% Oversampling factor vs data rate

delay_rc=4 ;

% Generating root-raised cosine pulseshape (rolloff factor = 0.5)

prcos=rcosflt([ 1 ] , 1, f_ovsamp , 'sqrt ' , 0.5, delay_rc ); % RRC pulse

prcos=prcos (l:end-f_ovsamp+ l) ;

% remove O's

prcos=prcos/norm (prcos );

% normalize

pcmatch=prcos (end : -1:1) ;

% MF

% Generating random signal data for polar signaling

s_data=4*round ( rand (L, 1) )+2*round (rand (L, l) )-3+...

+j *(4 *round (rand (L, 1) )+2 *round (rand (L ,l))- 3) ;

% upsample to match the 'oversampling rate ' (normalize by 1/T) .

% It 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 polar signaling of different pulse-shaping

xrcos=conv ( s_up,prcos) ;

[c_num ,c_den] = cheby2 (12,20, (1+ 0.5) /8) ;

% The next commented line finds frequency response

%[H, fnlz ]=freqz (c_num ,c_den, 512,8) ;

% The lowpass filter is the Tx filter before signal is sent to channel

xchout=filter ( c_num ,c_den,xrcos) ;

% We can now plot the power spectral densities of the two signals

% xrcos and xchout

% This shows the filtering effect of the Tx filter before

% transmission in terms of the signal power spectral densities

% It shows how little lowpass Tx filter may have distorted the signal

plotPSD_comparison

% Apply a 2-ray multipath channel

mpath= [l 0 0 -0 .65] ;

% multipath delta(t)- 0.65 delta (t-3T/8)

% time-domain multipath channel

h=conv (conv (prcos , pcmatch ) ,mpath) ;

hscale=norm (h) ;

xchout=conv (mpath,xchout ); % apply 2-ray multipath

xrxout=conv (xchout, pcmatch) ; % send the signal through matched filter

% separately from the noise

delaychb=delayrc+3 ;

out_mf=xrxout ( delaychb+l:f_ovsamp :delaychb+L* f_ovsamp) ;

clear xrxout;

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

Saved successfully!

Ooh no, something went wrong!