fg_09_08.m

来自「英文书《Digital Signal Processing with Examp」· M 代码 · 共 28 行

M
28
字号
% fg_09_08    RLS and ideal MSE learning curve plots.
m=1; u=.05; alpha=0.2; K1=101; k1=[0:K1-1]';

% Ideal mse convergence.
phi=cos(2*pi*[0:12]/12);
Phiff=[phi(1) phi(2); phi(2) phi(1)];
phifd=[phi(m+1); phi(m+2)];
bopt=Phiff\phifd;
mse_min=phi(1)-phifd'*bopt;
c0=[1; -2.75]-bopt;
mse=mse_min*ones(K1,1)+(1-2*u).^(2*k1)*(c0'*Phiff*c0);

% RLS mse convergence.
b0=[1; -2.75];
K2=101; k2=[0:K2-1]';
d=sqrt(2)*sin(2*pi*k2/12);
f=[0; d(1:K2-1)];
e=d-rls_filter(b0,u,alpha,d,f);

% Plot the curves.
sp_fig(1);
set(gca,'fontsize',16);
line(k1,mse,'color','k','linestyle','--');
line(k2,e.^2,'color','k','marker','o');
axis([0 50 0 9]);
title('50 iterations; u=0.05, \alpha=0.2.');
xlabel('k'); ylabel('e_k^2'); grid on;

⌨️ 快捷键说明

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