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.

11.9 MATLAB Exercises 657

The first MATLAB program, gold3 lcode . m, assigns four Gold sequences of length 31 to the

four QPSK modulated user signals:

% MATLAB PROGRAM <gold3 1code .m>

% to generate a table of 4 Gold sequence

% with length 31 each .

GPN= [l 1 1 -1

-1 1 -1 1

-1 -1 1 1

1 1 -1 -1

-1 -1 -1 -1

1 1 1 1

1 1 -1 -1

-1 -1 -1 1

-1 1 -1 -1

1 -1 -1 1

-1 -1 1 1

1 1 -1 1

1 -1 1 -1

-1 1 1 1

1 -1 1 1

-1 1 1 -1

-1 -1 1 -1

-1 1 1 -1

1 1 1 -1

1 -1 1 1

1 -1 1 -1

1 1 -1 -1

1 1 1 1

1 1 1 -1

-1 -1 -1 -1

1 1 -1 1

1 -1 -1 -1

-1 1 -1 1

1 1 -1 -1

1 1 1 1

1 1 1 1] ;

The main MATLAB program, Exl 1_3 . m, completes the spreading of the four user signals. The

four spread CDMA signals are summed together at the receiver before detection. Each of the four users

will apply the conventional despreader (matched filter) at the receiver before making the symbol-bysymbol

decision. We provide the resulting BER of all four users in Fig. 11.25 under additive white

Gaussian noise. We also give the single-user BER in AWGN channel as a reference. All four users have

the same BER. The small degradation of the multiuser BER from the single-user BER is caused by the

nonorthogonal spreading codes.

% MATLAB PROGRAM <Exll 3.m>

% This program provides simulation for multiuser DS-CDMA signaling using

% coherent QPSK for 4 users .

%

%clear;clf

Ldata=l0000;

Lc=31;

%User number 4;

% data length in simu lation; Must be divisible by 8

% spreading factor vs data rate

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

Saved successfully!

Ooh no, something went wrong!