I am trying to apply the Constant Modulus Algorithm which is a blind equalization algorithm in CDMA communication. I am following the code for CMA and a great explanation given in link MATLAB : Proper estimation of weights and how to calculate MSE for QPSK signal for Constant Modulus Algorithm
For different signal-to-noise ratio, I want to see the performance of CMA. But I cannot understand where to plug in the CMA part in CDMA. CMA should be at the receiver, but it is not clear to me exactly how to do so and if I need to apply the same FIR channel that is given in the CMA code. It will be very helpful is somebody can inform / show how to apply CMA. Thank you. The code for CDMA is
clc;
clear all;
code_length = input('Enter Code Length = ');
data_stream = input('Enter Data Bit Stream = ');
%Generating Walsh Code
code = [-1 -1; -1 +1];
[r1 c1] = size(code);
disp('Walsh code generated = ');
while r1<code_length
code = [code,code;code,-1*code];
[r1 c1] = size(code);
disp(code);
end
code_length = length(code); %length (number of bits) of code
Y = size(data_stream);
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
data_received = []; %vector of reconstructed bits at receiver
%show data bits and codes
disp('Data bit stream to be transmitted = '),disp(data_stream);
disp('Walsh codes used for transmission = '),disp(code);
%encode bits and transmit
G = zeros(I,code_length);
for n = 1:N
Z = zeros(I,code_length);
for i = 1:I
for m = 1:code_length
Z(i,m) = [data_stream(n,i)*code(n,m)];
end
end
G = G + Z;
end
%show channel traffic
for i = 1:I
T = [ T G(i,:) ];
end
disp('Resulting traffic on the channel = '),disp(T);
%decode and reconstruct
for n = 1:N
tot = zeros(1,I);
R = zeros(I,code_length);
for i = 1:I
for m = 1:code_length
R(i,m) = G(i,m) * code (n,m);
tot(i) = tot(i) + R (i,m);
end
end
data_received = [data_received ; tot / code_length];
end
disp('Reconstructed data at the receiver = '),disp(data_received);
Output:
Enter Code Length = 4
Enter Data Bit Stream = [ 1 -1 1 -1 1 1 -1 -1 ;
-1 -1 1 1 1 -1 -1 1 ;
1 1 -1 -1 -1 1 1 -1 ;
1 1 1 1 -1 -1 -1 -1 ];
Walsh code generated =
-1 -1 -1 -1
-1 1 -1 1
-1 -1 1 1
-1 1 1 -1
Data bit stream to be transmitted =
1 -1 1 -1 1 1 -1 -1
-1 -1 1 1 1 -1 -1 1
1 1 -1 -1 -1 1 1 -1
1 1 1 1 -1 -1 -1 -1
Walsh codes used for transmission =
-1 -1 -1 -1
-1 1 -1 1
-1 -1 1 1
-1 1 1 -1