- %RLS_S.m
- %RLS algorithm
- %static status
- %synchronous CDMA
- %channel: White Gaussis Noise
- function [P1,P_i_n,y,correct,E_ex,PP] = RLS_D(b,N,K,step,yN_step,S,SNR,P)
- %multiuser detection
- lamda=0.997;
- PP=P;
- for i=1:step
- KK=PP*yN_step(:,i)/(lamda+yN_step(:,i).'*PP*yN_step(:,i));
- PP=1/lamda*(PP-KK*yN_step(:,i).'*PP);
- h=PP*S(1,:).';
- c=h/(S(1,:)*h);
- P1(i)=(c.'*S(1,:).')^2;
- P_i_n(i)=( c.'*(yN_step(:,i)-b(1,i)*S(1,:).') )^2;
- %SINR(i)=P1/P_i_n;
- y(i)=sign(c.'*yN_step(:,i));
- E=(c.'*yN_step(:,i))^2;
- E_min=1;
- E_ex(i)=E-E_min;
- end
- correct=(y==b(1,:));
- %plot(SINR);
复制代码 |