How to implement an Equalizer

Adrián Pérez picture Adrián Pérez · Jan 11, 2013 · Viewed 23.3k times · Source

I know there are a lot of questions about equalizers in so, but I didn't get what I was looking. What I want to do is an equalizer for modifying audio samples in such a way like:

equalizer.eqAudio(audiosamples, band, gain)

I'm not sure if that is the exact interface that I want because I know little about DSP in terms of implementing them (I used filters, limiters, compressors but not made them).

So Googling about this I read that I must do a FFT to the samples so I get the data per frequency ranges instead of amplitude, process it the way I want and then make the inverse of the FFT so I get the result in audio samples again. I looked for an implementation of this FFT and found JTransform for Java. This library has an implementation of a FFT related algorithm called Discrete Cosine Transform (DCT).

My questions are :

  • Well, Am I in the right way?
  • Since FFT gives me data about frequency, I should pass to the FFT algorithm a chunk of samples. How big this chunk must be?
  • Is there a good book about DSP programming that explains equalizers ?

Thanks!

Answer

Shannon Matthews picture Shannon Matthews · Jan 11, 2013

FFT wouldn't be my first choice for audio equalisation. I would default to building an EQ with IIR or FIR filters. FFT might be useful for special circumstances.

A commonly recommended reference is the Cookbook Formulae for Audio EQ Biquad Filter Coefficients.

A java tutorial for programming biquad filters. http://arachnoid.com/BiQuadDesigner/index.html

Is there a good book about DSP programming that explains equalizers ?

Understanding Digital Signal Processing is a good introduction to DSP. There are chapters on FIR and IIR filters.

Intoduction To Digital Filters with Audio Applications by Julius O. Smith III.

Graphic Equalizer Design Using Higher-Order Recursive Filters by Martin Holters and Udo Zolzer is a short paper detailing one EQ filter design approach.