CDMA System Design: Evaluating Walsh & Gold Codes & MIMO Transceiver

Verified

Added on  2023/06/14

|24
|4584
|120
Project
AI Summary
This project provides a detailed solution for a CDMA system design, focusing on the implementation and performance analysis of Walsh codes, Gold codes, and a single-user MIMO transceiver. The project includes MATLAB code for simulating a 30-user CDMA system with spreading gains of 64 (Walsh code) and 31 (Gold code), as well as code for evaluating the performance of a single-user MIMO transceiver without forward error correction. Various aspects of CDMA design techniques are explored through questions and MATLAB simulations, covering topics such as signal generation, spreading, despreading, and BER (Bit Error Rate) analysis under different SNR (Signal-to-Noise Ratio) conditions. Performance comparisons of CDMA systems using different diversity techniques are also presented. The project concludes with an emphasis on the effects that strongly influence the performance of CDMA systems.
Document Page
TELECOMMUNICATION
Code Division Multiple Access
Name:
Professor:
Date:
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Abstract
In wireless channel system, a single antenna is used at the source, and another single
antenna is used at the destination. This leads to hitches with multipath effects [1]. When an
electromagnetic field meets a barrier such as mountains, valleys, structures, and service wires,
the signals are dispersed, and thus take different routes to reach the receiver. Scattering of the
signal leads to hitches such as cut-out, fading and intermittent reception. In digital channel
systems such as wireless Internet, it can lead to a reduced signal speed and a rise in the number
of errors [2]–[7]. Adoption of more than one antennas, with the broadcast of compound signals
at the source and the destination, eradicates the distress instigated by multipath wave broadcast.
Introduction
A various access structure based on spread-spectrum transmission technique is referred to
as code division multiple access CDMA. In this system, the information signal is to a wide
extent spread to a wide bandwidth by an exceptional code which aids in minimization of
intrusion hence increasing systems processing speed [8]. In design assignment we are required
to design a simple a simple 30 user CDMA system with spreading Walsh code gain of 64 and
31-gold code. In the second part we are required to design a single-user MIMO transceiver
without forward error correction code and evaluate its performance. Multiple input Multiple
output systems also known as MIMO is where multiple antennas at both ends of the link helps
exploit other advantages other than diversity and array gains [11]. MIMO facilitate the ability to
increase the transmission of throughput through spatial multiplexing capability of MIMO
channels. Question 2 through to 6 are designs to achieve high channel capability of CDMA and
their analysis. These designs help us understand more on various CDMA design techniques.
Question 1
Matlab code:
Document Page
%% Clearing and closing any open files.
clear all
close all
clc
%% Generation of data for each user
N=30;
gain_1=31;
gain_2=64;
data_set=[];
for p=1:N
s=rand(1,10);
r=[];
for t=1:10
if s(t)>0.5
r=[r 1];
else if s(t)<0.5
r=[r 0];
end
end
end
data_set(p,:)=r;
end
data_set=2*data_set-1;
%% CDMA using Walsh code
walsh=hadamard(gain_2);
signal_1=[];
for p=1:N
a=walsh(p,:);
q=[];
for r=1:10
s=data_set(1,r)*a;
q=[q s];
end
signal_1=[signal_1;q];
end
% combining the signal from each user
combined_1=[];
for t=1:29
combined_1=signal_1(t,:)+signal_1(t+1,:);
end
%% Generating Gold code
G=31; % Code length
K=10; % Number of Codes or code sequences
%.................Generation of first perferred PN
sequence................
sd1 =randsrc(1,5,[0 1]); % First user's seed.
PN1=[]; % Spreading code vector of user-1
Document Page
for j=1:G
PN1=[PN1 sd1(1)];
if sd1(1)==sd1(4)
temp1=0;
else temp1=1;
end
sd1(1)=sd1(2);
sd1(2)=sd1(3);
sd1(3)=sd1(4);
sd1(4)=sd1(5);
sd1(5)=temp1;
end
%.................Generation of Second perferred PN
sequence...............
sd2 =randsrc(1,5,[0 1]);
PN2=[];
for j=1:G
PN2=[PN2 sd2(1)];
if sd2(1)==sd2(2)
temp1=0;
else temp1=1;
end
if sd2(4)==temp1
temp2=0;
else temp2=1;
end
if sd2(5)==temp2
temp3=0;
else temp3=1;
end
sd2(1)=sd2(2);
sd2(2)=sd2(3);
sd2(3)=sd2(4);
sd2(4)=sd2(5);
sd2(5)=temp3;
end
%.........................Generation of Gold
Codes.........................
Co_Mat=[];
for codes=1:K
code=[];
PN2(31)=PN2(1);
for k=1:G-1
PN2(k)=PN2(k+1);
end
for j=1:G
code=[code xor(PN1(j),PN2(j))];
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
end
Co_Mat=[Co_Mat code'];
end
for row=1:G
for col=1:K
if Co_Mat(row,col)==0
Co_Mat(row,col)=-1;
end
end
end
% combining with the data signa
signal_2=[];
for x=1:N
b=Co_Mat(x,:);
y=[];
for v=1:10
l=data_set(1,v)*b;
y=[y l];
end
signal_2=[signal_2;y];
end
% combining the signal from each user
combined_2=[];
for z=1:29
combined_2=signal_2(z,:)+signal_2(z+1,:);
end
%% plotting
figure;
for u=1:3
subplot(4,1,u)
bar(signal_1(u,1:200))
if u==1
title('Signal for user 1 walsh code')
else if u==2
title('Signal for user 2 wash code')
else if u==3
title('Signal for user 3 walsh code')
end
end
end
end
figure;
for o=1:3
subplot(4,1,o)
bar(signal_2(o,1:31))
if o==1
Document Page
title('Signal for user 1 Gold code')
else if o==2
title('Signal for user 2 Gold code')
else if o==3
title('Signal for user 3 Gold code')
end
end
end
end
subplot(4,1,4)
bar(combined_1)
title('Combined signal')
Results:
Document Page
Signal for user 1 walsh code
0 50 100 150 200 250
-1
0
1
Signal for user 2 wash code
0 50 100 150 200 250
-1
0
1
Signal for user 3 walsh code
0 50 100 150 200 250
-1
0
1
Signal for user 1 Gold code
0 5 10 15 20 25 30 35
-1
0
1
Signal for user 2 Gold code
0 5 10 15 20 25 30 35
-1
0
1
Signal for user 3 Gold code
0 5 10 15 20 25 30 35
-1
0
1
Combined signal
0 100 200 300 400 500 600 700
-2
0
2
Question 2
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Matlab code:
clc;
clear all;
close all;
d=[];
o=1000;
Data=((randi(1,o))>.5)+0;
p=16;
walsh=hadamard(p);
% orthogoanl code matrix
Walsh_code= walsh(3,:)+1
u=1;
l=length(Walsh_code);
for s=1:o
for t=1:l
d(1,u)=xor(Data(1,s),Walsh_code(1,t));
u=u+1;
end
end
figure
v=10;
a = rectpulse(Data(1,:),10);
subplot(3,1,1);
stem(a);
title('\bf Original_Bit_Sequence');
title('\bf TRANSMITTED_MESSAGE');
b = rectpulse(Walsh_code(1,:),10);
subplot(3,1,2);
stem(b);
title('\bf Gold_Code');
%.........................
e = rectpulse(d(1,:),10);
subplot(3,1,3);
stem(e);
title('\bf Spreaded_Sequence')
%-------Demodulation to get original message signal---------
c=1;
u=1;
los= length(d);
while u < los
s=0;
for t=1:l
temp(1,t) = xor(d(1,u),Walsh_code(1,t));
u=u+1;
s=s+temp(1,t);
end
if(s==0)
Document Page
w(1,c) = 0;
else
w(1,c) = 1;
end
c=c+1;
end
despreaded_signal= w;
%-----Plotting-----
figure
x=[];
for u=1:8
if w(1,u)==0
z=zeros(1,10);
else
z=ones(1,10);
end
x=[x z]
end
subplot(3,1,1);
stem(e);
title(' sequence');
title(' Rx MESSAGE');
b = rectpulse(Walsh_code(1,:),10);
subplot(3,1,2);
stem(b);
title(' Gold Code');
subplot(3,1,3);
stem(x);
title('\bf Despreaded_Sequence')
Results:
Document Page
Question 3
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Matlab codes:
clc ;
clear all ;
close all;
L = randn(1,4*100000) ;
V=1;
M=[];
for o = 1:4
for Z = 1:100000
if ( L(V)>=0)
M(o,Z)=1 ;
else
D1(o,j)=?1 ;
end
V = V+1 ;
end
end
for o = 1:4
Z=1;
for W = 1:50000
D(o,W)=M(o,Z)+(M(o,Z+1))*i;
Z=Z+2;
end
end
C=[?1 ?1 ?1 ?1;
?1 1 ?1 1;
?1 ?1 1 1;
?1 1 1 ?1];
T = length(C);
I = size(D);
L = I(1);
I = I(2);
T = [];
G = zeros(I,M);
for n = 1:L
Z = zeros(I,M);
for o = 1:I
for m = 1:M
Z(o,m) = [D(n,o)*C(n,m)];
end
end
G = G + Z;
end
for o=1:I
G1(o,:)=ifft(G(o,:));
end
for snr=1:20
Document Page
for o=1:I
G2(o,:)=awgn(G1(o,:),snr,0);
end
for o=1:I
G3(o,:)=fft(G2(o,:));
end
B1 = [];
for n = 1:L
TOT = zeros(1,I);
R = zeros(I,M);
for o = 1:I
for m = 1:M
R(o,m) = G3(o,m) * C (n,m);
TOT(o) = TOT(o) + R (o,m);
end
end
B1 = [B1 ; TOT / M];
end
B1;
B2=zeros(M,I);
for v = 1:M
for Z = 1:I
p= real(B1(v,Z));
if (p>=0)
B2(v,Z)=1 ;
else
B2(v,j)=?1 ;
end
end
end
B3=zeros(M,I);
for o = 1:M
for Z = 1:I
p= imag(B1(o,Z));
if (p>=0)
B3(o,Z)=1 ;
else
B3(o,j)=?1 ;
end
end
end
B4=B2+(B3*i);
err = D?B4 ;
no_errs=0;
for o=1:M
for Z=1:I
if(err(o,Z)~=0)
chevron_up_icon
1 out of 24
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]