Butterworth filtering with bandpass and 3. order

16 次查看(过去 30 天)
Hi everybody, I've got a Problem with the butter function. I wanna create a bandpass butherworth filter (third order). The documentary says: "[b,a] = butter(n,Wn,ftype) designs a lowpass, highpass, bandpass, or bandstop Butterworth filter, depending on the value of ftype and the number of elements of Wn. The resulting bandpass and bandstop designs are of order 2n."
Therefore, my I wrote my Code like:
fc_1=1000; % bottom cut off frequency
fc_2=2000; % upper cut off frequency
fs= 20000; % sample rate
Wc_1= 2*pi*fc_1/fs;
WC_2= 2*pi*fc_2/fs;
[b, a]= butter(1.5, [Wc_1 Wc_2], 'bandpass')
Sadly, Matlab says now that it expect a integer value for n (in my case 1.5). Did I understand the documentary wrong?
Thanks a lot for your help, Gerald :-)

回答(2 个)

Ced
Ced 2016-3-16
You understood the documentation correctly.
Intuitively, bandpass and bandstop filters are symmetric around their cutoff frequency, hence Matlab's butter function only supports an even number of poles. Low and high pass filters do not have this restriction.
  2 个评论
GerRu
GerRu 2016-3-16
Okay... So I guess it is the same, if I conduct first a high pass (third order) and afterwards a lowpass filter?!
Ced
Ced 2016-3-16
Yes, although the actual output of course depends on what the design of your two components looks like.

请先登录,再进行评论。


Star Strider
Star Strider 2016-3-16
Use the buttord function to calculate the optimal order and passband for your filter. My filter design procedure is in: How to design a lowpass filter for ocean wave data in Matlab?
  2 个评论
GerRu
GerRu 2016-3-16
Thanks for the quick answer. The problem is, that the order and the bandpass is already specified.... So it has to be the third order... :/
Star Strider
Star Strider 2016-3-16
My pleasure.
Use 3 for the order.
Also, you have to normalise your frequencies by the Nyquist frequency, which is half the sampling frequency, not the sampling frequency itself. The Nyquist frequency is the highest resolvable frequency in a sampled signal.

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by