曲线变得平滑,误差大。
④观察在不同的抽头数N下的滤波结果,并进行分析。 M= 5
M= 10
M= 30
抽头数越大,曲线月平滑,误差越大。
内容二:
t=0:999;
xs=10*sin(6.28*t/500); figure; subplot(2,1,1); plot(t,xs); grid;
ylabel('amplitude');
title('input of periodic signal'); randn('state',sum(1000*clock)); xn=randn(1,1000); subplot(2,1,2); plot(t,xn);grid; ylabel('amplitude'); xlabel('t');
title('random noise signal'); xn = xs+xn; xn = xn.' ; dn = xs.' ; M = 5 ;
rho_max = max(eig(xn*xn.')); mu = rand()*(1/rho_max) ; [yn,W,en] = LMS(xn,dn,M,mu); figure; subplot(2,1,1); plot(t,xn);grid; ylabel('amplitude'); xlabel('t');
title('input of filter'); subplot(2,1,2); plot(t,yn);grid; ylabel('amplitude'); xlabel('t');
title('output of adaptive filter'); figure
plot(t,yn,'b',t,dn,'g',t,dn-yn,'r');grid;
legend('output of adaptive filter','expected output','deviation'); ylabel('amplitude'); xlabel('t');
title('adaptive filter');
①
②权系数和内容一种类似
③mu = rand()*(15/rho_max)