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.

658 SPREAD SPECTRUM COMMUNICATIONS

Figure 11.25

Performance of

DS-CDMA

conventional

single-user

detection without

the near-far

effect.

Four-user CDMA BER for QPSK with Gold code of length 31

1 0 ° ----------------------

-- Single user (analysis)

--e-- User 1 BER

10-l

-e- User 2 BER

--3ir- User 3 BER

--+- User 4 BER

10-4

1 0-S ----------------

0 2 4 6 8 1 0 12

Eb/N, dB

% Generate QPSK modulation symbols

data_sym=2*round (rand ( Ldata,4) ) -l+j*(2 *round (rand ( Ldata,4) )-1) ;

% Select 4 spreading codes (Gold Codes of Length 11)

gold31code ;

pcode=GPN ;

% Spreading codes are now in matrix pcode of 31x4

PowerMat=diag (sqrt ([l 1 1 1] ));

pcodew=pcode* PowerMat ;

% Now spread

x_in=kron ( data_sym( :,l) ,pcodew ( :,l) )+kron ( data_sym( :,2) ,pcodew( :,2 )) + . ..

kron ( data_sym( :,3) ,pcodew( :,3)) +kron ( data_sym ( :,4) ,pcodew ( :,4 ));

% Signal power of the channel input is 2*Lc

% Generate noise (AWGN )

noiseq=randn (Ldata*Lc ,l)+j*randn (Ldata*Lc ,l) ; % Power is 2

BERl= [];

BER2 = [];

BER]=[];

BER4= [];

BER_az= [];

for i=l :12,

Eb2N (i)= (i-1);

%(Eb/N in dB )

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

% Eb/N in numeral

Var_n=Lc/ (2*Eb2N_num) ;

%1/SNR is the noise variance

signois=sqrt (Var_n) ;

% standard deviation

awgnois=signois*noiseq ;

% AWGN

% Add noise to signals at the channel output

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

Saved successfully!

Ooh no, something went wrong!