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 :-)
0 个评论
回答(2 个)
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 个评论
Ced
2016-3-16
Yes, although the actual output of course depends on what the design of your two components looks like.
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 个评论
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!