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.

12.12 MATLAB Exercises 719

After a matched filter has been applied at the receiver (root-raised cosine), the QAM signal will

be sampled, equalized, and decoded. The subroutine program 1 inear _ eq . m designs a T-spaced finite

length MMSE equalizer oforder M = 8 as described in Sec. 12.3 [Eq. (12.43b )] . The equalizer is designed

by applying the first 200 QAM symbols as training data. The equalizer filters the matched filter output

before making a 16-QAM decision according to the decision region of Fig. 10.24b in Chapter 10.

% MATLAB PROGRAM <linear_eq .m>

% This is the receiver part of the QAM equalization example

%

Ntrain=200;

% Number of training symbols for Equalization

Neq=8;

% Order of linear equalizer (=length-1)

u = O;

% equali zation delay u must be <= Neq

SERneq= [] ;

SEReq= [];

for i=l:13,

Eb2N (i)=i*2-l;

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

Var_n=Es/ (2*Eb2N_num) ;

signois=sqrt (Var_n/ 2) ;

zl=out_mf +signois*noisesamp ;

%(Eb/N in dB)

% Eb/N in numeral

%1/SNR is the noise variance

% standard deviation

% Add noise

Z=toeplitz (zl (Neq+l:Ntrain) ,zl (Neq+l :-1:1) ) ; % signal matrx for

% computing R

dvec= [ s_data (Neq+l-u : Ntrain-u)]; % build training data vector

f=pinv(Z'*Z)*Z' *dvec ;

% equalizer tap vector

dsig=filter (f,l,z l) ;

% apply FIR equalizer

% Decision based on the Re / Im parts of the samples

deq=sign (real (dsig (l:L) ) ) +sign (real (dsig (l:L) )-2)+...

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

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

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

% Now compare against the original data to compute SER

% (1) for the case wi thout equalizer

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

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

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

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

SERneq= [ SERneq; sum (abs ( s_data-=dneq) )/(L )];

% (2) for the case with equalizer

SEReq= [SEReq; sum ( s_data-=deq) /L] ;

end

Once the linear equalization results are available, the main program Ex12_1 . m calls another

subroutine program, plotQAM_resul ts . m, to provide illustrative figures. In Fig. 12.21, the noisefree

eye diagram of the in-phase component at the output of the receiver matched filter before sampling

shows a strong ISI effect. The QAM signal eye is closed and, without equalization, a simple QAM

decision leads to very high probabilities of symbol error (also known as symbol error rate).

% MATLAB PROGRAM <plotQAM_results .m>

% Thi s program plots symbol error rate comparison before and after

% equalization

%

%

figure (2)

constellation points

eye-diagrams before equalization

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

Saved successfully!

Ooh no, something went wrong!