我要加入 登录
声振论坛 返回首页

robin908的个人空间 http://home.vibunion.com/?53147 [收藏] [复制] [分享] [RSS]

日志

Filter noise

已有 422 次阅读2006-12-9 21:42

天气: 晴朗
心情: 高兴

function filter
%filter noise
%original author: SD
%modified by Robin@Saturday, December 09, 2006, HK

N=4096;
M=N;
fout=fopen('1_f.txt','w');
x=xlsread('1.xls');
x2=x;
t=1:1:N;
for i=1:N
   x(i)=x2(i);
end
%plot(t,x);
wn=100/1250;
%wn=[100/1250 140/1250]
[b,a]=butter(5,wn);
y=filtfilt(b,a,x);
for i=1:1:N
   t(i)=i/2500;
end
for i=1:1:M
   f(i)=i*2500/N;
end

fx=fft(x2,M);
fy=fft(y,M);
subplot(2,1,1);
plot(t,x);
tt=0:0.01:0.8;
for i=1:1:N
    yy(i)=y(1+(i-1));
       fprintf(fout,'%12.9f \n',yy(i));
end
subplot(2,1,2);
hold on;
plot(t,y,'r');
fclose(fout);
%axis([0,0.3,-10,80])

全部作者的其他最新日志

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 我要加入

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-6-2 00:28 , Processed in 0.027436 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部