维纳滤波器_程序.doc
"自适应维纳"脑电消噪
clear
clc
n=0:1:100; %采样点数
N=5; %FIR 滤波器的阶数
n1=sin(n*pi/3); % 60HZ的噪声源
n2=0.5*sin(n*pi/3+rand*pi);%经噪声路径滤波器后的噪声
x1=rand(1,length(n));%-0.2—+0.2随机信号的产生 x=2*(x1-0.5)/5;
y=x+n2; %混杂的信号
g=length(y);
H=zeros(N,g);
T1=zeros(1,N);
u=1/(norm(n1*n1')); %调整系数
e=zeros(1,g); %存放滤波后信号初始的向量
for k=1:g %处理信号
for i=1:N-1
T1(i)=T1(i+1);
end
T1(N)=n1(k);
y1(k)=T1*H(:,k); e(k)=y(k)-y1(k); H(:,k+1)=H(:,k)+2*u*e(k)*T1';
end
N1=100;
figure(1)
subplot(2,1,1)
plot(y)
axis([ 1 N1 -0.7 0.7]) axis auto'x'
%title('滤波后信号与原始信号.前面.的对比')
title('干扰后的信号')
%hold on
%plot(t1(2,:),'r')
%axis([ 1 N1 -0.7 0.7]) %axis auto'x'
subplot(2,1,2)
plot(e)
%plot(t1(3,:),'b') %title('滤波后的信号')
axis([ 1 N1-1 -0.7 0.7]) axis auto'x'
hold on
subplot(2,1,2)
plot(x,'r')
title('滤波后的信号与原始信号对比') axis([1 N1-1 -0.7 0.7]) axis auto'x'
%figure(2)
%hold on
%plot(t1(4,:),'r') %title('滤波后信号与原始信号.后面.的对比') figure(2)
%plot(nk1)
%subplot(2,1,2)
plot(H(1,:)')
title('一个权系数收敛情况')
我编了一个用自适应维纳FIR滤波器消除脑电波中的干扰 你们看看,这是我毕社的一个程序
clear
clc
n=0:1:100; %采样点数
N=5; %FIR 滤波器的阶数
n1=sin(n*pi/3); % 60HZ的噪声源
n2=0.5*sin(n*pi/3+rand*pi);%经噪声路径滤波器后的噪声
x1=rand(1,length(n));%-0.2—+0.2随机信号的产生
x=2*(x1-0.5)/5;
y=x+n2; %混杂的信号
g=length(y);
H=zeros(N,g);
T1=zeros(1,N);
u=1/(norm(n1*n1')); %调整系数
e=zeros(1,g); %存放滤波后信号初始的向量
for k=1:g %处理信号
for i=1:N-1
T1(i)=T1(i+1);
end
T1(N)=n1(k);
y1(k)=T1*H(:,k); e(k)=y(k)-y1(k); H(:,k+1)=H(:,k)+2*u*e(k)*T1';
end
N1=100;
figure(1)
subplot(2,1,1)
plot(y)
axis([ 1 N1 -0.7 0.7])
axis auto'x'
title('干扰后的信号')
subplot(2,1,2)
plot(e)
axis([ 1 N1-1 -0.7 0.7])
axis auto'x'
hold on
subplot(2,1,2)
plot(x,'r')
title('滤波后的信号与原始信号对比') axis([1 N1-1 -0.7 0.7])
axis auto'x'
figure(2)
plot(H(1,')
title('一个权系数收敛情况')
本文档为【维纳滤波器_程序.doc】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。