This is code for parallel interference cancelltion in ds cdma using matrix algebraic approach. Please check the code and let me know if iam doin any mistake . Also I need to apply slow and fast rayleigh fading in this model.
The rcd signal is R = SAB + N where R,S,A,B are matrices The matlab code is given below : close all clear all; clc; warning off all
K = 27; %No. of users Navg = 1e3; %No. of repititions snr = 5:1:25; %SNR RANGE
Sv = (10.^(-snr/10)); %Noise variance in different SNR A = eye(K); %input power %Get signature sequences load GS31; S = GS31(1:K,; S= S'; Lc = length(S(:,1)); Sn= S./sqrt(Lc); %Normalize energy of signature waveforms R = Sn'*Sn; % Calculate correlation matrix
h = waitbar(0,'WAIT...'); for t = 1:Navg waitbar(t/Navg); for j = 1:length(snr) noise =(Sv(j))^.5*randn(Lc,1); b=2*(randint(K,1)-0.5); BT=Sn*A*b; r=awgn(BT,snr(j)); % r=BT+noise; y = Sn'*r;