How to design a 3rd order butterworth bandpass filter characteristic which will then be used for the dfilt.df1tsos function?
Show older comments
I have to create a 3rd order butterworth bandpass characteristic [10 12] (Hz). Thereafter, I need to use the biquad second-order section filter function (dfilt.df1tsos) and filter the data with the filter function.
I do have the following code for a 2-order filter:
Fs = 5000; Fn = Fs/2; Lf = 10 Hf = 12
[z,p,k] = butter(1,[Lf Hf]/(Fn), 'bandpass');
[s,g] = zp2sos(z,p,k);
Hd = dfilt.df1tsos(s,g)
fvtool (Hd)
y = filter(Hd, data');
I am not sure how to handle the combination of bandpass butterworth characteristic and the biquad filter since I have little experience with filtering.
Would be great if anyone provides help.
Answers (1)
Binaya
on 10 Oct 2024
Hi Patrick
Your approach is correct. To design a 3rd order Butterworth bandpass filter, you just need to modify the "butter" function of the MATLAB in your code to the following:
% Design a 3rd order Butterworth bandpass filter
[z, p, k] = butter(3, [Lf Hf] / Fn, 'bandpass');
Also note that the 3rd order Butterworth filter will also include the first-order and second-order characteristics in its SOS(second-order section).
You can refer to the following documentation links for more details:
- "butter": https://www.mathworks.com/help/signal/ref/butter.html
- "zp2sos" : https://www.mathworks.com/help/signal/ref/zp2sos.html
- "design", you can refer to 'design' to apply a design method to a filter specification object: https://www.mathworks.com/help/dsp/ref/design.html
Hope this helps.
Categories
Find more on Butterworth in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!