Cdma Program For N Bits Per Each User: Here 4 Bits Are Taken For Each User and Totally 4 Users
Cdma Program For N Bits Per Each User: Here 4 Bits Are Taken For Each User and Totally 4 Users
Here 4 bits are taken for each user and totally 4 users.
clc
close all
clear all
% unique code for each sender (determined using the Walsh Set)
C = [ 1 1 1 1;
1 -1 1 -1;
1 1 -1 -1;
1 -1 -1 1];
% parameters
M = length(C); % length (number of bits) of code
Y = size(D);
N = Y(1); % number of unique senders / bit streams
I = Y(2); % number of bits per stream
T = []; % sum of all transmitted and encoded data on channel
RECON = []; % vector of reconstructed bits at receiver
end
end
G = G + Z;
end
%D=reshape(D,1,16);
figure(1)
subplot(2,2,1);
stairs(D(1,:));
title('data 1');
xlim([1 5]);
ylim([-2 2]);
grid on
subplot(2,2,2);
stairs(D(2,:));
title('data 2');
xlim([1 5]);
ylim([-2 2]);
grid on
subplot(2,2,3);
stairs(D(3,:));
title('data 3');
xlim([1 5]);
ylim([-2 2]);
grid on
subplot(2,2,4);
stairs(D(4,:));
title('data 4');
xlim([1 5]);
ylim([-2 2]);
grid on
figure(2)
stairs(T(1,:));
grid on
xlim([1 16]);
ylim([-5 5]);
title('encoded data');
figure(3)
subplot(2,2,1);
stairs(RECON(1,:));
title('RECONSTRUCTED DATA 1');
xlim([1 5]);
ylim([-2 2]);
grid on
subplot(2,2,2);
stairs(RECON(2,:));
title('RECONSTRUCTED DATA 2');
xlim([1 5]);
ylim([-2 2]);
grid on
subplot(2,2,3);
stairs(RECON(3,:));
title('RECONSTRUCTED DATA 3');
xlim([1 5]);
ylim([-2 2]);
grid on
subplot(2,2,4);
stairs(RECON(4,:));
title('RECONSTRUCTED DATA 4');
xlim([1 5]);
ylim([-2 2]);
grid on