Aya2002
Advanced Member level 4
I saw, nobody wants to contribute to this group, so that i decided to start it myself,
the following is a matlab code for DS - CDMA. I am waiting for any comments of this group members.
%% Reduced PAPR in CDMA using new Technique.
%% DS-CDMA Simulation by Montadar Abas
clear all;
close all;
clc;
%% Deciding the Number of users and the Number of bits for each user (same
%% for all users)
x= input ('Number of users =');
y=input('Number of Bits for each user = ');
r=log(x)/log(2)
%% Generating the Walsh Code
xx=hadamard(x);
wmmsnn=xx
,
;
u=[];
m=[];
for t = 1 : x
u=[u; (randint(1,y,2)*2-1)];
m=[m ; (kron(u(t,
,wmmsnn(t,
))];
end
%% combining all the messages together and normalize it.
mms=sum(m)/x;
y2 =rectpulse(mms,r);
%% Pass through AWGN channel
snrloop=-5:1:35;
numsnr=length(snrloop);
bervec=[];
for n=1:numsnr
mmsn2=awgn(y2,snrloop
,'measured');
%% Integrate and dump (downsampling)
mmsn=intdump(mmsn2,r);
%mmsn=dp_nrz_L(mmsn7);
%% Decode the recieved noisy signal to reproduce the original messages.
g=ones(1,y);
outmsg=[];
for rb=1:x
g1=kron(g,wmmsnn(rb,
);
r1= g1.*mmsn;
rr1=reshape(r1,x,length(r1)/x);
k1=sum(rr1);
u11=k1>0;
outmsg=[outmsg;u11];
end
the following is a matlab code for DS - CDMA. I am waiting for any comments of this group members.
%% Reduced PAPR in CDMA using new Technique.
%% DS-CDMA Simulation by Montadar Abas
clear all;
close all;
clc;
%% Deciding the Number of users and the Number of bits for each user (same
%% for all users)
x= input ('Number of users =');
y=input('Number of Bits for each user = ');
r=log(x)/log(2)
%% Generating the Walsh Code
xx=hadamard(x);
wmmsnn=xx
u=[];
m=[];
for t = 1 : x
u=[u; (randint(1,y,2)*2-1)];
m=[m ; (kron(u(t,
end
%% combining all the messages together and normalize it.
mms=sum(m)/x;
y2 =rectpulse(mms,r);
%% Pass through AWGN channel
snrloop=-5:1:35;
numsnr=length(snrloop);
bervec=[];
for n=1:numsnr
mmsn2=awgn(y2,snrloop
%% Integrate and dump (downsampling)
mmsn=intdump(mmsn2,r);
%mmsn=dp_nrz_L(mmsn7);
%% Decode the recieved noisy signal to reproduce the original messages.
g=ones(1,y);
outmsg=[];
for rb=1:x
g1=kron(g,wmmsnn(rb,
r1= g1.*mmsn;
rr1=reshape(r1,x,length(r1)/x);
k1=sum(rr1);
u11=k1>0;
outmsg=[outmsg;u11];
end