zl程序教程

您现在的位置是:首页 >  云平台

当前栏目

基于APSA 和 LMS 的系统识别的比较(matlab代码实现)

识别MATLAB系统代码 实现 基于 比较
2023-09-14 09:05:23 时间

 👨‍🎓个人主页:研学社的博客 

💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

📋📋📋本文目录如下:🎁🎁🎁

目录

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码实现


💥1 概述

对带噪信号采用级联型LMS自适应滤波系统。

本文调用三个函数 ,它计算函数在不同 N 上执行所花费的时间。它绘制了两个函数在不同 N 上经过的时间。这里的 L 固定为 5。并且系统功能是预定义的。图显示Eff_apsa算法是否比apsa算法有效。随着N的增加,计算时间的差异也随之增加

📚2 运行结果

 部分代码:

for i=1:N
    
    x=inp((i-1)*L+1:(i-1)*L+L); % select L no of inputs as ith Set
    X(:,i)=x;
    
    for k=1:i
        D(:,k)= h'.*X(:,k);               %Actual Output
        Y(:,k)= D(:,k) + randn(L,1)*0.1;  %Output with noise

        w=W(k,:);                         %weights for this Iteration
        mu=0.5;                           %Learning Factor
        epsilon=0.001;                   %Small Factor to avoid Singularity
    
        E(:,k) = D(:,k) - w'.*X(:,k);     % Calculate error
        
        % find the weight Update
        xs(:,k)=X(:,k).*sign(E(:,k));
        wt_up(k,:)=mu*(xs(:,k)/sqrt(xs(:,k)'*xs(:,k)+epsilon))';   
        
        W(k+1,:)=w+wt_up(k,:);   % Set the new Weights
    end
    if (mean(E(:,i))<=0.0001 && iter==0) || (i==N && iter==0)
        iter=i;
    end
    y=Y(:,i);
end

yd = W(N+1,:)'.*x;  % Caluculate Output from Identified System for an input
error=mean(E(:,i));

if plot_flag==1
    subplot(121),plot([1:L],y),xlabel('Samples'), 
    ylabel('System Output'),title('Actual System'),
    subplot(122),plot([1:L],yd),xlabel('Samples'), 
    ylabel('System Output'),title ('Identified System');

    figure();plot([1:N],mean(E,1)'),xlabel('No of Iterations'), 
    ylabel('Mean error'),title('Learning Curve');
end


end

🎉3 参考文献

部分理论来源于网络,如有侵权请联系删除。

[1]李雨琨,郭飞.LMS自适应滤波对ECG双频干扰的估计与消除[J].安全与电磁兼容,2023(01):66-71.

[2]陈梦月,孔海望,吴迪.基于三维智能路面检测系统识别沉陷病害的方法研究[J].广东土木与建筑,2022,29(05):15-18.DOI:10.19731/j.gdtmyjz.2022.05.004.

[3]Santhana Raj (2023). APSA and LMS comparison for System Identification

🌈4 Matlab代码实现