LMS与RLS算法性能比较

  • F7_716038
    了解作者
  • 2.1KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 2
    下载次数
  • 2022-06-07 07:50
    上传日期
对工程常用的两种算法作出性能分析比较,为合适的选取提供参考依据,对工程实现具有参考意义,代码具有可移植性
rls cmp lms.rar
  • RLS与LMS算法分析及比较
  • RLSnew.m
    1.7KB
  • LMSnew.m
    1.5KB
  • rls_lms.m
    732B
内容介绍
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %RLS自适应滤波器性能分析 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear clc close all %%%%%%%%%%%%%%参数设置%%%%%%%%%%%%%%%%%%%%%%% w=2.9; forget_factor=0.995; variance_v=0.001; repeat_times=200; iteration_times=500; filt_len=13; delay=fix(filt_len/2)-1; %%%%%%%%%%%%%%%%%%%%变量及数组初始化%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Chan_factor=(1+cos(2*pi*([1:1:3]-2)/w))/2; Square_err=zeros(repeat_times,iteration_times); %%%%%%%%%%%%%外循环,重复做repeat_times次实验,平均值%%%%%%%%%%%%%%%% for loop1=1:repeat_times %%%%%%%%%%%%%%内循环变量及数组初始化%%%%%%%%%%%%%%%%%%%%%%%% Source=zeros(iteration_times,1); W=zeros(filt_len,1); P=eye(filt_len); Pi=zeros(filt_len,1); K=zeros(filt_len,1); %%%%%%%%%%%%%内循环,做iteration_times次迭代%%%%%%%%%%%%%%%%%%%%%%%%%%%% for i=1:iteration_times %%%%%%%%%%%%%%信源,产生等概率分布的正负1%%%%%%%%%%%%%%%%%%%%%%%%%%%% if rand<0.5 Source(i)=-1; else Source(i)=1; end end %%%%%%%%%%%%%%信道,滤波和加噪声%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Revdata=filter(Chan_factor,1,Source)+randn(iteration_times,1)*sqrt(variance_v); %%%%%%%%%%%%%%均衡器,基于LMS算法%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for loop2=1:iteration_times-filt_len+1 U=Revdata(loop2:loop2+filt_len-1); d=Source(loop2+delay); Pi=P*U; K=Pi/(forget_factor+U'*Pi); e=d-W'*U; W=W+K*e; P=P/forget_factor-K*U'*P/forget_factor; Square_err(loop1,loop2)=e.^2; end end %%%%%%%%%%%%%%作图,显示结果%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Square_err_mean=sum(Square_err(:,:))/repeat_times; semilogy(Square_err_mean); figure(2); stem(W);
评论