Date:.
Page No. Expt. No.
Experiment-12
Am b petem Code Divislon Multiple Acces
(ComA) wsing MA7LAB.
Sotwa eed MATLAB
Code Divisim Multiple Ace ess (coMA) is a
methood muli ble
useo to eable
LCAmmwnication
petum
slmultanesusy Itis based om the spaaspectrm
tehalegy which ipreads a mie'uaee cignal ace
4reauency range Each ie aigued
a wide tinguishes taeis iqnal
wmigue cCode that o than it at
Lm otaes,eWen theugh a l wsee sepaatiog
Ae sasme time, his cnde- based multiple wieu
allaaa oMA Qyatems to handle m slotiQL
iitheut icquiing cepaate as it s dLen in
Divsion
ote aecea method ike fregny
paniple hehind CoMA is the e
The tuncla meuta
4 athagonal Codea wich ae castuly deaigned
olitinct
Aathe atcally m eaeh othee.
Teacher's Signature:
Date:.
Page No. Expt. No.
that cigNals tom cliHerent wies can be sepaa
ted ettively eNen if they ovealap in bo th
wiuk daa siguali multibied by a wnigl
shaeading cade, which eapends t signal oveL
la wide bamdidlth At the aecatves tae igual
fs decpaead by Mallipying it again with tho sama
Code , allbwing the aeceive to alcaeA tue ouginal
data 'wthile aecHng intertereunce from othee signal
paeaing st)sigual. metelt)
ctt)- tramámit ed signal
l) meAage signal.
spreading cade
Reeeived siqnal
nlt
whee nl=haise signal.
Reault!
Sutceshally petaumd Code biviciom hulfple
Aeces ccoMas wwing MATLAb
Teacher's Signature:
% Parame ters
numUsers = 4; % Number of users
numBits = 8; % Number of bits per user
spreadingFactor = 8; % Spreading factor (SF)
in dB
SNR = 15; % Signal-to-Noise Ratio
data for each user
% Generate random binary
data = randi ( [0 1], numUsers, numBits)
spreading codes for each user
% Generate unigue % Bipolar (+1, -1)
Codes = 2 * (numUsers, spreadingFactor) > 0.5) - 1;
(rand
8 Spread data spreadingFactor) ;
numBíts
spreadSignal = zeros (numUsers,
1:numÜsers
for user = (data (user, :) * 2 - 1,
spreadSignal (user, :) = reshape (repmat
1, U);
spreadingFactor, 1) .* codes (user, :)',
end
signals (multiplexing)
% Combine all user 1) ;
transmittedSignal = sum (spreadSignal,
% Add noise 'measured') ;
(transmittedSignal, SNR,
noisySignal = awgn
Despread and decode
(numUsers, numBits) ;
receivedData = zeros
1:numUsers numBits) .*
for user = (noisySignal,, spreadingFactor,
despreadSignal = reshape
codes (user, :)'; Decision
spreadSignal, l) > 0; %
receivedBits = sum (de receivedBits;
receivedData (user, :) =
end
& Display results
');
disp ('Original Data:
disp (data) ;
disp ( 'Received
Data: ');
disp (receivedData);
3 Plot
figurei
subplot (3, 1, 1) ; 'LineWidth', 1.5) ;
plot (transmittedSignal,
CDMA Signal');
title ('Transmitted
xlabel ('Time') ;
ylabel('Arnpl itude') ;
subplot (3, 1, 2);
'LineWidth', 1.5);
plot (noisySignal,
title ('Noisy Peceived Signal') ;
xlabel ('Time');
ylabel('Arnplitude');
subplot (3, 1, 3) ;
'filled');
stem(data (1, :), 'b',
hold on; 'r','LineStyle', --") ;
stem (receivedData (1, :), Original and Received Data') ;
title ('Coparison of U3er 1
xlabel ('Bit Index');
ylabel('Value');
legend('Original ', 'Received');
>> CDMA
Original Data:
1 1 1 1
1
1 1
1
1 1 1 1 1
1 1 1
1
Received Data:
1 1
1 1 1 1
1 1
1 1
1 1 1 1
0
1 1 1
1 1
Transmitted CDMA Signal
70
60
50
40
20 30
10
Time
Noisy Receved Signal
70
60
A0
10 20
Time
Comparison of Ueer 1 Original and Recelved Data
1¬
08
0.6
02
Bt Index