📄 notchfilternew.m
字号:
%陷波器,将原始输入信号(cos+宽带噪声)中的cos由参考输入信号对消
%参考输入
derta=0.5;
t =0:0.01:99;
s2 = 0.1*cos(derta+1.8*cos(pi*0.5*t));
subplot(231)
q=length(t);
plot(t,s1);
axis([0,t(q),-0.3,0.3]);
title('噪声源信号1曲线图');
%s2 = 0.1*sin(pi*0.5*t);
%subplot(232)
%plot(t,s2);
%axis([0,t(q),-0.3,0.3]);
%title('90移位曲线图');
%hold on;
%(cos+宽带噪声)
d1 = normrnd(0,0.0521,[q 1]);
subplot(233)
plot(t,d1);
axis([0,t(q),-0.6,0.6]);
d=zeros(1,2001);
d=s2'+d1;
subplot(234)
plot(t,d);
axis([0,t(q),-0.6,0.6]);
title('信号源曲线图');
w1=0;
w2=0;
y=zeros(1,length(d));
e=zeros(1,length(d));
for n=1:length(d)
y(n)=w1*s1(n)+w2*s2(n);
e(n)=d(n)-y(n);
w1=w1+2*0.02185*e(n)*s1(n);
w2=w2+2*0.02185*e(n)*s2(n);
end
subplot(235)
n=1:q;
plot(n,y,'r');
axis([1,q,-0.3,0.3]);
title('notch估计输出');
%输出只剩宽带噪声
subplot(236)
n=1:q;
plot(n,e);
axis([1,q,-0.6,0.6]);
title('噪声对消器输出');
hold off;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -