Wireless & Mobile Network Architecture
Practical 1
Date: 16/01/2012 Aim: To implement PN sequence code for CDMA system. Theory: A Pseudo-random (PN) sequence is a sequence of binary numbers, e.g. 1, which appears to be random; but is in fact perfectly deterministic. The sequence appears to be random in the sense that the binary values and groups or runs of the same binary value occur in the sequence in the same proportion they would if the sequence were being generated based on a fair "coin tossing" experiment. In the experiment, each head could result in one binary value and a tail the other value. The PN sequence appears to have been generated from such an experiment. A software or hardware device designed to produce a PN sequence is called a PN generator IS-95 uses two PN generators to spread the signal power uniformly over the physical bandwidth of about 1.25 MHz. The PN spreading on the reverse link also provides near orthogonality of and; hence, minimal interference between, signals from each mobile. This allows universal reuse of the band of frequencies available, which is a major advantage of CDMA and facilitates soft and softer handoffs. Code: %% PN seq generator clc;clear all; poly=[0 1 1]; %% [2 1 0] for 3 bit LFSR n=length(poly); initial=[1 0 0] %% take 3 bit initial pn(1,:)=initial; for i=1:2^n temp=0; % temp=xor(temp,initial(1)); temp=xor(temp,initial(2)); temp=xor(temp,initial(3)); initial(2:n)=initial(1:n-1); initial(1)=temp; pn(i+1,:)=initial; out(i)=initial(3); end
Wireless & Mobile Network Architecture
Result: initial = 1 >> pn pn = 1 0 1 1 1 0 0 1 0 >> out out = 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 1 0 0 1 0 1 1 1 0 0 0 0
Conclusion: For Maximum length shift register polynomial, PN sequence with maximum length is generated. As the polynomial changes the length of PN sequence is change.