# [music-dsp] Zoelzer & Holters 4th order EQ filters

Thomas Rehaag developer at netcologne.de
Tue May 5 09:47:15 EDT 2009

```and even better:

c = cos(OmM) = cos(OmU + OmL) / cos(OmU - OmL)

Thomas Rehaag schrieb:
>
> found it myselfe, thanks to my good old math book:
>
> cos(2*x) = (1 - tan(x)^2) / (1 - tan(x)^2)
>
> so
>
> c = cos(OmM) = (1 - tan(OmU/2)*tan(OmL/2))/(1 + tan(OmU/2)*tan(OmL/2))
>
> nice!
>
> Best Regards,
>
> Thomas
>
> Thomas Rehaag schrieb:
> >
> > Hi Martin,
> >
> > I just came back to the filters after some relaxing jobs and found an
> > error.
> > You wrote:
> >
> > > Finally, Omega_M is actually defined by eq. 19. With the trig
> > > identity cos(atan(x)) = 1/sqrt(1+x^2), that makes the allpass
> > > coefficient
> > > c = 1/sqrt(1 + tan(OmU/2)*tan(OmL/2)).
> >
> > and as far as I can see, this would be true if Eq. 19 was
> >
> > (tan(OmM))^2 = tan(OmU/2) * tan(OmL/2)
> >
> > but it is
> >
> > (tan(OmM/2))^2 = tan(OmU/2) * tan(OmL/2)
> >
> > and so
> >
> > c = cos(OmM) = cos( 2 * atan(sqrt(tan(OmU/2) * tan(OmL/2))))
> >
> > I've tried this equation with the example filters in table 1 and it
> > seems to work fine.
> > Now my question: do you know a trig identity to simplify cos(2 *
> > atan(x))?
> >
> > Best Regards,
> >
> > Thomas
> >
> > Martin Eisenberg schrieb:
> > >
> > > From: "Thomas Rehaag" <developer at netcologne.de>
> > >
> > > > A(z) = (z^-1 * cosOM - z^-2) / (1 - z^-1 * cosOM)
> > > > And that lead to the following code
> > >
> > > The code looks right from here, but combining the numerator has
> > > led you to use one too many states (and m_fPrevOut2 is also
> > > unneeded), besides making CAp a non-reusable class with a lying
> > > name. There are various ways to formulate the code using three
> > > states, but I think the clearest is simply to insert ordinary
> > > 1st-order AP's before the delays the shelf filter already
> > > contains.
> > >
> > > > m_fCosOmM = cos(2 * PI
> > > >    * sqrt(fFreqMax - fFreqMax) / fSampleRate);
> > >
> > > No. First of all, that's always 1.0 because fFreqMin is
> > > misspelled. Second, the subtraction is wrong because a) this
> > > isn't about bandwidth, b) the geometric mean uses a multiply.
> > > Finally, Omega_M is actually defined by eq. 19. With the trig
> > > identity cos(atan(x)) = 1/sqrt(1+x^2), that makes the allpass
> > > coefficient
> > > c = 1/sqrt(1 + tan(OmU/2)*tan(OmL/2)).  You can easily check
> > > using a plot tool that c2 = cos(sqrt(OmU*OmL)) is only a
> > > reasonable approximation of c for both edge frequencies below
> > > pi/6 or thereabouts.
> > >
> > > > ps.: I don't have any clue why replacing the delays with
> > > > allpasses should work at all.
> > >
> > > Imagine wrapping a sheet of carbon paper around a cylinder to
> > > cover the cylinder exactly n times. Now draw a wavy line looping
> > > around the cylinder's waist. Unfold the carbon paper, and what
> > > you'll see is n copies of the original line.
> > >
> > > That is basically what replacing delays with an allpass does. The
> > > cylinder's circumference The wavy loop stands for the spectrum of
> > > some filter H(z'), living on the z'-plane unit circle which is
> > > the cylinder's circumference. The width of the carbon sheet
> > > symbolizes one 2pi-length around the z-plane unit circle, and the
> > > allpass map z' = A(z) acts to relate each point in the z'-plane
> > > with multiple z values according to its order.
> > >
> > > What the analogy misses is that the angle coordinate is possibly
> > > not just replicated but also stretched and rotated -- that's how
> > > you get from lowpass to bandpass. Read more in Moorer's famous
> > > paper "The Manifold Joys of Conformal Mapping" at
> > > http://www.jamminpower.com:8080/jp/PDF/The%20Manifold%20Joys.jsp
> > > (note that when Moorer writes "z transform" he means the bilinear
> > > transform).
> > >
> > > Martin
> > >
> > > --
> > > dupswapdrop -- the music-dsp mailing list and website:
> > > subscription info, FAQ, source code archive, list archive, book reviews, dsp links
> > > http://music.columbia.edu/cmc/music-dsp
> > > http://music.columbia.edu/mailman/listinfo/music-dsp
> > --
> > dupswapdrop -- the music-dsp mailing list and website:
> > subscription info, FAQ, source code archive, list archive, book reviews, dsp links
> > http://music.columbia.edu/cmc/music-dsp
> > http://music.columbia.edu/mailman/listinfo/music-dsp
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp
```