声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3496|回复: 2

[共享资源] [转帖]RLS算法程序

[复制链接]
发表于 2006-6-7 09:16 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
  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);
复制代码
回复
分享到:

使用道具 举报

 楼主| 发表于 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);
复制代码
发表于 2008-5-15 10:19 | 显示全部楼层
学习下,谢谢分享,:lol :@)
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-9-23 09:24 , Processed in 0.062859 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表