matlab四阶butterworth滤波实例
标签:
滤波butterworth |
分类: matlab |
clear;clc;
fs=2000; %采样频率
T=1/fs;
L=500;
t=(0:L-1)*T;
y1=sin(2*pi*200*t);
y2=0.5*sin(2*pi*400*t);
y3=0.1*sin(2*pi*600*t);
y=y1+y2+y3;
%低通滤波器
fc=300;
wn=2*fc/fs;
[b,a]=butter(4,wn,'low');%构造butterworth低通滤波器,保留频率低于300Hz的振动
y_low=filter(b,a,y);
figure();plot(y_low,'r');hold on;plot(y1,'k')
xlabel('Time');ylabel('Amplitude')
fs=2000; %采样频率
T=1/fs;
L=500;
t=(0:L-1)*T;
y1=sin(2*pi*200*t);
y2=0.5*sin(2*pi*400*t);
y3=0.1*sin(2*pi*600*t);
y=y1+y2+y3;
%低通滤波器
fc=300;
wn=2*fc/fs;
[b,a]=butter(4,wn,'low');%构造butterworth低通滤波器,保留频率低于300Hz的振动
y_low=filter(b,a,y);
figure();plot(y_low,'r');hold on;plot(y1,'k')
xlabel('Time');ylabel('Amplitude')
前一篇:hilbert谱介绍
后一篇:EMD的趋势项检验实例

加载中…