Code covered by the BSD License
-
CDMA_GUI(varargin)
CDMA_GUI M-file for CDMA_GUI.fig
-
...
-
CDMA_Encode(TotalChips, ...
-
MakeSampled(Seq,Samples,Sampl...
-
MakeUnsampled(SampledSeq,Samp...
-
PNSeq (noofBits,ChipGenMethod...
Generates a PN sequence Using Linear Feedback Shift Register Method
-
RotateSeq(InSeq)
-
buttLPF(f,cutoff,n)
-
coaxTF(f,Zr,Len,b,a,Ur,Er,Sig...
-
coax_simulator(Samples,rate,t...
-
raisedCos (f,Tb,r)
Raised Cosine Filter
-
CDMA_Simulator.m
-
View all files
from
Coaxial Cable Based CDMA System Simulation
by Iftekhar Tanveer
This is a simulation of CDMA Encoding & Decoding Process using a coax channel.
|
| PNSeq (noofBits,ChipGenMethod)
|
function [sequence] = PNSeq (noofBits,ChipGenMethod)
% Generates a PN sequence Using Linear Feedback Shift Register Method
% (ChipGenMethod = 0), Walsh Code(ChipGenMethod=1) or
% Gold Code (ChipGenMethod=2)
n=log(noofBits+1)/log(2);
if (n~=round(n)),
error('noofBits must be of format 2^n - 1')
end
sequence=zeros(noofBits,1);
initialseed=round(rand(n,1));
for rpt=1:noofBits
lstbit = initialseed(n);
Sndlst = initialseed(n-1);
remaining =initialseed(1:n-1,1);
initialseed = [xor(Sndlst,lstbit),remaining']';
sequence(rpt) =lstbit;
end
for rpt=1:noofBits
if (sequence(rpt)==0)
sequence(rpt)=-1;
end
end
|
|
Contact us at files@mathworks.com