⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aalmssignsign02.m

📁 Source Code for Adaptive Filtering Primer
💻 M
字号:

function[w,y,e,J,w1]=aalmssignsign(x,dn,mu,M)
%function[w,y,e,J,w1]=aalmssignsign(x,dn,mu,M)
%all quantities are real-valued;
%x=input data to the filter;dn=desired signal;
%M=order of the filter;
%mu=step size parameter;x and dn must be of the same length
N=length(x);
y=zeros(1,N);
w=zeros(1,M);%initialized filter coefficient vector
for n=M:N
   x1=x(n:-1:n-M+1);%for each n the vector x1 is produced
   %of length M with elements from x in reverse order;
   y(n)=w*x1';
   e(n)=dn(n)-y(n);
   w=w+2*mu*sign(e(n))*sign(x1); 
   w1(n-M+1,:)=w(1,:);
end;
J=e.^2;
%the columns of w1 depict the history of the filter
%coefficients;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -