Butterworth filtering with bandpass and 3. order
20 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (2)
Ced
il 16 Mar 2016
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 Commenti
Ced
il 16 Mar 2016
Yes, although the actual output of course depends on what the design of your two components looks like.
Star Strider
il 16 Mar 2016
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 Commenti
Star Strider
il 16 Mar 2016
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.
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!