I've been developing a music player for Android for many years, and I've recently started working on the implementation of a parametric equalizer.
I'm having trouble preventing a gain at one band from adversely affecting the gain at a neighbouring band, resulting in a peak gain higher than desired, which ultimately may result in clipping.
I've been following the Orfanidis paper on 'Digital Parametric Equalizer Design With Prescribed Nyquist-Frequency Gain' as well as an example Matlab implementation of some of the concepts outlined in the Orfanidis paper.
The equalizer effectively acts as a graphic eq - I've fixed the center frequencies and bandwidths to specific values:
(Values in Hz, Bandwidth in brackets)
- 63 (15)
- 125 (30)
- 250 (30)
- 400 (45)
- 630 (75)
- 1000 (115)
- 1600 (180)
- 2500 (290)
- 4000 (460)
- 6300 (730)
- 10000 (115)
- 16000 (1825)
The plan is to allow a maximum boost/cut of 12dB, with bandwidth gain set to 3dB below peak. Ideally, I could first apply a 12dB cut across the entire spectrum, so that a peak boost of 12dB is guaranteed not to cause any clipping.
The problem is, if a user applies a boost of 12dB at, say, center frequencies 63Hz and 125Hz, the peak gain at both frequencies ends up being more than 12dB, which may result in clipping. Here's what the FFT looks like for that case:
Notice the peak gain is actually greater than 12dB.
The effect is compounded if a boost is applied across all the frequencies mentioned above (this is the worst case scenario):
Notice the peak gain is more like 15dB.
Maybe I should expect this, and the answer is simply that bands shouldn't be spaced too closely if applying a lot of gain. But, my problem is I'm trying to provide this functionality to a casual music listener, but I don't want them to configure the equalizer in such a way that clipping occurs, as they'll likely claim that it's faulty.
So my questions are - does this look like a correct implementation of a parametric eq? Does it make sense that neighbouring bands can have a greater peak gain than the specified 'boost gain'? How can I prevent a user from causing clipping in this situation?
Any help is appreciated.