Butterworth filtering with bandpass and 3. order

조회 수: 20 (최근 30일)
GerRu
GerRu 2016년 3월 16일
댓글: Ced 2016년 3월 16일
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