Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to generate psuedo random codes in Matlab?

Status
Not open for further replies.

Sparkistine

Newbie level 2
Joined
May 9, 2003
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Karachi, Pakistan
Activity points
21
CDMA : how to??

Can some one guide me about how to generate psuedo random codes in matlab. Any documents in this regard would be welcome.
 

Re: CDMA : how to??

Sparkistine said:
Can some one guide me about how to generate psuedo random codes in matlab. Any documents in this regard would be welcome.
Hi,
The rand() function generates a random number uniformally distributed between [0,1] according to the state of the matlab seed, at any time you can set the seed generator to a fixed value by rand('state',j) where j is an integer value, by default the seed generator is set to rand('state',0).
you can write for instance the following script for generating the Psuedo randon code:
-----------
rand('state',0);
for i=1:n
x(1,i)=rand(1);
end
The above script gives the same random number squence vector x(1,n) of length n each time it is executed.
 

Re: CDMA : how to??

by pseudo random codes I mean pseudo noise codes, which are generated randomly for cdma communications

If anyone knows how to generate them please msg me
 

Re: CDMA : how to??

Look at IS-95 (CDMA standard) and search for the Polynomial Generator for the Noise Generator RNG. The moment you know the Polynomial, it is a simple LFSR implemenation with Matlab.....
 

codes

I think that the codes used in this system are not truly pseudorandom. They are Walsh codes. Since all of the transmissions of radio units are synchronized, the code for each signal is repeated for each bit. The codes under these conditions have exactly zero cross correlation.

Truly pseudorandom codes have a autocorrelation of minus one for offsets and N for allignment. I vaguely remember that crosscorrelations between different codes are worse than this.

See the book CDMA System Engineering Handbook by Lee and Miller published by Artech House in 1998. Chapter 5 deals with this part of the system.
 

two codes in my knowledge that are used these are pseuso noise codes for reverse link and walsh codes for the forward link. as far as the orthognality is concerned the codes have no or very low auto corelation and zero or very low cross corelation if the system is ideally synchronized. can any body add any think more? plus


can anybody upload this book
CDMA System Engineering Handbook by Lee and Miller published by Artech House in 1998
 

Re: CDMA : how to??

Hello all,

see attachment - this is very simple png generator for Simulink I've made years ago for some classes..
I'm not sure if it will help :roll:

best,

Eirp
 

Re: CDMA : how to??

start with hadamard matrices

H=[ 1 1; 1 -1];

your walsh code will be:

W(1)= [H H ; H -H];
W(2)= [W(1) W(1); W(1) -W(1)];
W(3)= [W(2) W(2); W(2) -W(2)];
W(4)= [W(3) W(3); W(3) -W(3)];
.........
WN= [W(N-1) W(N-1); W(N-1) -W(N-1) ]

you can chance collumns or rows as you wish to regenerate these.
 

Re: CDMA : how to??

But Hadamard code is not PN Code, isn't?
And in IS-95 system, PN short code is used to distinguish different base station in forward channel; and long code to distinguish different mobiles i think.
Walsh codes are used to identify various logic channels, like different voice users, synch channel, etc.
 

CDMA : how to??

You can easilyu generate walsh hadamard code by command hadamard(n) and it will generate n by n matrix, u can pick any row and use it as walsh code
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top