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

Martin Eisenberg martin.eisenberg at udo.edu
Wed Apr 22 17:24:46 EDT 2009

From: "Thomas Rehaag" <developer at netcologne.de>

> thanks a lot.

Linving in the same timezone should count for something, no? ;)

> > The code looks right from here, but combining the
> > numerator has led you to use one too many states

To clarify, that's not a logic error (although given your
newfound success -- congrats! -- there may have been one after
all), just wasteful of cache space in view of the fact that
you'll have several peak filter objects, all in the same working

> so the allpass should be:
> float CAp::Process(float fIn)
> {
>   m_fPrevIn1 = m_fIn;
>   m_fIn = fIn;
>   float fOut = m_fCosOmM * m_fIn - m_fPrevIn1
>     + m_fCosOmM * m_fPrevOut1;
>   m_fPrevOut2 = m_fPrevOut1;
>   m_fPrevOut1 = fOut;
>   return fOut;
> }
> ?

Yes with regard to factoring out the 1/z, but you haven't reduced
the *overall* number of states. Actually, the structure in
Holters' slides that you found uses still one state less than I
had realized! In your implementation of that topology, you
duplicated the expression with the multiply -- although compilers
should detect that and compute it only once, I suggest you get
rid of the clutter. So it would look like this:

float Process(float fIn)
  float fA = m_fA;
  float fB = m_fCosOmM * (fIn - fA);
  m_fA = fIn + fB;
  return fA + fB;


More information about the music-dsp mailing list