📄 untitled.asv
字号:
chanl_adp_model_define
step=0.003;
s_n=signal+noise;
expect=signal;
[h_all,y,erro]=chanl_adp_lms(s_n,expect(order_h+1:n_total),1,step);
figure(1)
plot(1:n_total-order_h,signal(order_h+1:n_total),'r')
legend('desired signal ');
figure(2)
plot(1:n_total,s_n(1:n_total),'g');
legend('the noise + the signal ');
%figure(3)
%plot(1:n_total-order_h,y,'b')
%legend('step=0.003 时的自适应滤波输出: ');
figure(6)
for i=1:4
exp=3.^(i-1);
[h_all,y,erro]=chanl_adp_lms(s_n,expect(order_h+1:n_total),exp,step);
cost=erro.^2;
for j=1:length(erro)
cost0(i,j)=mean(cost(1:j));
end
subplot(2,2,i),plot(1:n_total-order_h,y,'b');
end
figure(4)
plot(1:length(erro),cost0(1,:),'r',1:length(erro),cost0(2,:),'b',1:length(erro),cost0(3,:),'g',1:length(erro),cost0(4,:),'k');
legend('\itmse offset=1','\itmse offset=3','\itmse offset=9','\itmse offset=27');
hold on
clear cost
clear i
clear j
%-----------------------------------------------------------------
figure(3)
for i=1:4
step=0.001*i;
exp=1;
[h_all,y,erro]=chanl_adp_lms(s_n,expect(order_h+1:n_total),exp,step);
cost=erro.^2;
for j=1:length(erro)
cost0(i,j)=mean(cost(1:j));
end
subplot(2,2,i),plot(1:n_total-order_h,y,'b');
end
figure(5)
plot(1:length(erro),cost0(1,:),'r',1:length(erro),cost0(2,:),'b',1:length(erro),cost0(3,:),'g',1:length(erro),cost0(4,:),'k');
legend('\itstep=0.001','\itstep=0.002','\itstep=0.003','\itstep=0.004');
hold on
clear cost
clear i
clear j
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -