[B,A] = BUTTER(N,Wn) designs an Nth order lowpass digital
Butterworth filter and returns the filter coefficients in length
N+1 vectors B (numerator) and A (denominator).
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].
当设计低通和高通时,Wn是一个值,表示截止频率;当设计带通和带阻时,Wn是一个二个元素的数组,表示通带或阻带的上下截止频率。频率的归一化是对fs/2进行归一。
例如,fs=10000,则fs/2=5000,500归一化为0.1,1000归一化为0.2。
fs=100;%采