How to create 1/3-Octave-Band Filters in MatLAB/Octave
<p>I have to design 1/3-Octave-Band filters in MatLAB (or alternatively in Octave). I've read <a href="http://www.mathworks.com/help/dsp/examples/octave-band-and-fractional-octave-band-filters.html" rel="nofollow noreferrer">this</a> doc article and I've tried using the <code>fdesign.octave</code>-<code>design</code> 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.</p>

<p>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 <code>butter</code> or <code>cheby1</code> functions or using the <code>fdatool</code>. While filters created/displayed in <code>fdatool</code> look good, when I use them to filter <code>chirp</code> signal using the <code>filer</code> function, I can see something like in the image below: <a href="https://i.stack.imgur.com/ZMsIr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZMsIr.png" alt="filtered chirp"></a></p>

<p>Top plot is <code>chirp</code> filtered with my custom filter, bottom plot shows the same <code>chirp</code> filtered with the filter of the same order, type and mid-band frequency, but created using <code>fdesign.octave</code>-<code>design</code> 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).</p>

<p>Hers is the code, that I am using to build my filter:</p>

<pre><code>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 );
</code></pre>

<p>Can anyone help me with designing proper 1/3-Octave-Band filters for that frequency range (0.5÷100)Hz?</p>

<hr>

<p>EDIT:
I've found another way to do what I want using the standardized <code>fdesign.octave</code> method. Read my answer below.</p>