声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

声振论坛 展示 科学计算 matlab 查看内容

RLS算法的matlab程序

2015-10-28 00:20| 发布者: aspen| 查看: 817| 评论: 2|原作者: suffer|来自: 声振论坛

摘要: %RLS_S.m %RLS algorithm %static status %synchronous CDMA %channel: White Gaussis Noise function = RLS_S(b,N,K,step,yN_step,S,SNR) %multiuser detection yyN_step=(yN_step); delta=1e-2; P=1 ...
  1. %RLS_S.m
  2. %RLS algorithm
  3. %static status
  4. %synchronous CDMA
  5. %channel: White Gaussis Noise

  6. function [P1,P_i_n,y,correct,E_ex] = RLS_S(b,N,K,step,yN_step,S,SNR)

  7. %multiuser detection
  8. yyN_step=(yN_step);
  9. delta=1e-2;
  10. P=1/delta*eye(N);%P=1/R
  11. lamda=0.997;
  12. for i=1:step
  13. KK=P*yyN_step(:,i)/(lamda+yyN_step(:,i)'*P*yyN_step(:,i));
  14. P=1/lamda*(P-KK*yyN_step(:,i)'*P);
  15. h=P*S(1,:).';
  16. c=h/(S(1,:)*h);

  17. P1(i)=abs( (c.'*S(1,:).')^2 );
  18. P_i_n(i)=abs( ( c.'*(yyN_step(:,i)-b(1,i)*S(1,:).') )^2 );
  19. %SINR(i)=P1/P_i_n;
  20. y(i)=sign(real(c.'*yyN_step(:,i)));

  21. E=abs( (c.'*yyN_step(:,i))^2 );
  22. E_min=1;
  23. E_ex(i)=E-E_min;
  24. end
  25. correct=(y==b(1,:));

  26. %plot(SINR);
复制代码


  1. %RLS_S.m
  2. %RLS algorithm
  3. %static status
  4. %synchronous CDMA
  5. %channel: White Gaussis Noise

  6. function [P1,P_i_n,y,correct,E_ex,PP] = RLS_D(b,N,K,step,yN_step,S,SNR,P)

  7. %multiuser detection
  8. lamda=0.997;
  9. PP=P;

  10. for i=1:step
  11. KK=PP*yN_step(:,i)/(lamda+yN_step(:,i).'*PP*yN_step(:,i));
  12. PP=1/lamda*(PP-KK*yN_step(:,i).'*PP);
  13. h=PP*S(1,:).';
  14. c=h/(S(1,:)*h);

  15. P1(i)=(c.'*S(1,:).')^2;
  16. P_i_n(i)=( c.'*(yN_step(:,i)-b(1,i)*S(1,:).') )^2;
  17. %SINR(i)=P1/P_i_n;
  18. y(i)=sign(c.'*yN_step(:,i));

  19. E=(c.'*yN_step(:,i))^2;
  20. E_min=1;
  21. E_ex(i)=E-E_min;
  22. end

  23. correct=(y==b(1,:));

  24. %plot(SINR);
复制代码
发表评论

最新评论

引用 suffer 2006-6-7 09:16
  1. %RLS_S.m
  2. %RLS algorithm
  3. %static status
  4. %synchronous CDMA
  5. %channel: White Gaussis Noise

  6. function [P1,P_i_n,y,correct,E_ex,PP] = RLS_D(b,N,K,step,yN_step,S,SNR,P)

  7. %multiuser detection
  8. lamda=0.997;
  9. PP=P;

  10. for i=1:step
  11. KK=PP*yN_step(:,i)/(lamda+yN_step(:,i).'*PP*yN_step(:,i));
  12. PP=1/lamda*(PP-KK*yN_step(:,i).'*PP);
  13. h=PP*S(1,:).';
  14. c=h/(S(1,:)*h);

  15. P1(i)=(c.'*S(1,:).')^2;
  16. P_i_n(i)=( c.'*(yN_step(:,i)-b(1,i)*S(1,:).') )^2;
  17. %SINR(i)=P1/P_i_n;
  18. y(i)=sign(c.'*yN_step(:,i));

  19. E=(c.'*yN_step(:,i))^2;
  20. E_min=1;
  21. E_ex(i)=E-E_min;
  22. end

  23. correct=(y==b(1,:));

  24. %plot(SINR);
复制代码
引用 yyfei11 2008-5-15 10:19
学习下,谢谢分享,:lol :@)

查看全部评论(2)

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-11 12:56 , Processed in 0.044103 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部