I have to design 1/3-Octave-Band filters in MatLAB (or alternatively in Octave). I've read this doc article and I've tried using the fdesign.octave
-design
duo, but this method allows creation of band filters for mid-band frequencies starting at around 25Hz. I need to create filters for frequency range from 0.5Hz to 100Hz.
I know how to calculate midband frequencies (fm) for those filters and corresponding upper and lower frequency bounds, so I've tried creating them myself using butter
or cheby1
functions or using the fdatool
. While filters created/displayed in fdatool
look good, when I use them to filter chirp
signal using the filer
function, I can see something like in the image below:
Top plot is chirp
filtered with my custom filter, bottom plot shows the same chirp
filtered with the filter of the same order, type and mid-band frequency, but created using fdesign.octave
-design
duo. I don't know how to get rid of that signal gain at the beginning and this one is actually one of the lowest signal gain, which shows for 100hZ mid-band frequency. The lower the mid-band frequency is, the worse my filter is (actually, below 2 or 3 Hz my filters filter out everything).
Hers is the code, that I am using to build my filter:
Wn = [Fl(i) Fh(i)] / (Fs/2);
[ z, p, k ] = butter( N, Wn, 'bandpass' );
% [z,p,k] = cheby1( N, Rp, Wn, 'bandpass' );
[ sos, g ]=zp2sos( z, p, k );
f = dfilt.df2sos( sos, g );
Can anyone help me with designing proper 1/3-Octave-Band filters for that frequency range (0.5÷100)Hz?
EDIT:
I've found another way to do what I want using the standardized fdesign.octave
method. Read my answer below.