aaftlms.m

来自「Adaptive Filtering Primer with MATLAB」· M 代码 · 共 24 行

M
24
字号

function[A]=aaftlms(x,d,M,I,mu)
%function[A]=aaftlms(x,d,M,I,mu);
wk=zeros(1,M);
for i=0:I       %I=number of iterations (or blocks);
   if I*M>length(x)-1
      ('error:I*M>length(x)-1')
   end;
                 %M=number of filter coefficients;
      x1=x(M*(i+1):-1:i*M+1);
      d1=d(M*(i+1):-1:i*M+1);
   xk=fft(x1);
   dk=fft(d1);
   yk=wk.*xk;
   ek=dk-yk;
   wk=wk+2*mu*ek.*conj(xk);
   A(i+1,:)=wk;
end;
%all the rows of A are the wk's at an increase order
%of iterations(blocks);
%to filter the data, wk must be inverted in the time
%domain, convolve with the data x and then plot the 
%real part of the output y, e.g. wn4=the forth iteration
%=ifft(A(4,:)),yn4=filter(wn4/M,1,x) for even M;

⌨️ 快捷键说明

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