在[B,A]=butter(n,wn)中,n是滤波器的阶数,Wn是截止频率,Wc = 截止频率*2/采样频率
Wc=2*50/Fs; %截止频率 50Hz
[b,a]=butter(4,Wc,‘low’); %低通滤波器 主要去除高频信号,可消除白噪声等
Signal_Filter=filter(b,a,Mix_Signal_1);
[b,a]=butter(4,Wc,‘high’); %高通滤波器 主要去除低频信号,可消除基线漂移等
[b,a]=butter(4,Wc,‘stop’); %带阻滤波器
[b,a]=butter(4,Wc); %带通滤波器 Wc=[W1 W2] W1 仍有问题可 help butter : The cutoff frequency Wn must be 0.0 < Wn < 1.0, with 1.0 corresponding to
half the sample rate.
If Wn is a two-element vector, Wn = [W1 W2], butter returns an
order 2N bandpass filter with passband W1 < W < W2.
[B,A] = butter(N,Wn,'high') designs a highpass filter.
[B,A] = butter(N,Wn,'low') designs a lowpass filter.
[B,A] = butter(N,Wn,'stop') is a bandstop filter if Wn = [W1 W2].