vladg/sound

https://www.tokyodawn.net/tokyo-dawn-labs-discontinued-products/

IIR based EQ and distortions

“IIR” stands for Infinite Impulse Response. This is one of possible ways to implement digital EQ. This way is very CPU lightweight. But it’s impossible to make linear-phase EQ using IIR. So the most digital min-phase equalizers are IIR.

Let’s get cookbook peaking filter formula and make simple EQ. We’ve got such a nice curve:

iir1

Next, move frequency up to 10 kHz (we’re on 44.1 sample rate) and see that:

iir2

You can see now, the perfect symmetric shape of “bell” is distorted and not symmetric now. How does it sound? Such non-symmetric curve has harsh, sharp, “digital” (in bad meaning of word) sound. But bell shape of true analog EQ doesn’t distort here. I think, symmetric curves sound more natural to our brain and thus leads to better sound perception.

What is the reason of shape distortion? Digital filter can be calculated from analog model by bi-linear transform, which really distorts the relation between frequencies. You can imagine a sheet of paper showing frequency response and glued at 0 Hz to your monitor from the back. But at Nyquist frequency it’s bending and goes from you to infinite depth. You see the projection of the curve to your monitor and thus it is distorted (this is the most simple way to explain). The less frequency is, the less those shape distortions are.

Okay, you can try to compensate these distortions and to design digital filter that tries to avoid them. For example, check this paper: [Digital Parametric Equalizer Design With Prescribed Nyquist-Frequency Gain]

iir3

As the result, you can get your frequency response curve very close to “analog” one but the phase response will not match. Actually, digital filter phase response has more distortions than analog one (for high frequencies of course). Maybe it answers the question why Bob Katz says, linear-phase EQ has more “analog” sound. Because analog EQ has more linear phase response than digital (min-phase) one, I suppose.

Now let’s talk about oversampling. By artificially increasing sample rate, you move the filter peaks down to low frequencies where they have less distortion of their shape. Unfortunately, oversampling process in most cases damages the sound. If performed very well, the sound becomes softer, but other implementations make it to sound distant, loose definition and depth. Good quality oversampling wastes a lot of CPU and adds great amount of latency.

On the next picture, there’s frequency response of UAD Pultec EQ implementation. You can see side effect of downsampling band-pass filter at high frequencies. (I like their Pultec by the way)

iir5

Now check the next picture. You see 4x oversampled peaking filter (red) versus not oversampled filter (blue). As you can see, red response is symmetric and doesn’t have high-frequency roll-off usually seen on oversampled curves.

iir4

Oversampling implementation in this example has 19-taps FIR for 4x upsampling and 5-taps FIR for downsampling, 3 samples of latency and not so much multiplication added for such short FIRs. This oversampling implementation has absolutely linear frequency and phase response after downsampling. So I think, finally it is possible to make oversampled EQ with low CPU usage and with lack of oversampling-related coloration.

Appendix

FIR used for 4x upsampling (19 taps):

0.021484375000000000
0.026041666666666668
-0.017578125000000000
-0.062499999999999972
-0.18457031250000000
-0.18229166666666666
0.14355468750000000
0.56250000000000000
1.0371093750000000
1.3125000000000000
1.0371093750000000
0.56250000000000000
0.14355468750000000
-0.18229166666666666
-0.18457031250000000
-0.062499999999999993
-0.017578125000000000
0.026041666666666668
0.021484375000000000

FIR used for 4x downsampling (5 taps):

0.077777777777777779
0.35555555555555557
0.13333333333333333
0.35555555555555557
0.077777777777777779

Use them well 🙂

4 responses to “IIR based EQ and distortions

  1. ezequiel morfi - buenos aires, argentina 2013/06/01 at 23:59

    Amazing. I’m not sure many if any EQ VST actually behaves like that, and that’s the reason linear-phase, as good and ‘analog’ as it sound, still remain something you use on a buss or for mastering, and not on every channel in a mix.

    Nevertheless, analog mixing consoles do have and EQ on every channel, and we use them when tracking and mixing. But hey, they’re analog, no HF bells distorted because no nyquist.

    So don’t wait till DC’13 and go ahead vladimir!
    I would love to help design this in any way, by the way.
    Love from Buenos Aires
    e

  2. Clint Martin 2013/06/06 at 05:28

    If you ever need a beta tester that uses Sonar X2 Producer in a 64 enviroment let me know. I love what your doing man!

  3. Clint Martin 2013/06/08 at 00:35

    https://soundcloud.com/clintmartin/shine-1
    This is a guitar Instrumental I just re-mixed and used LimiterNo.6 on. The LN6 compressor was turned off, but the other four modules were used. It’s simply one of the best Limiters out there!

  4. dddux 2013/11/07 at 08:35

    I’m guessing your next challenge is a good analog emu VST EQ? Yes! d= 🙂 =b Something like a typical console EQ with hi/lo pass, hi/lo shelves, and 2 parametric mids. ♥! There really is no need for more bands at any time. I think a practical design could turn the shelving bands into parametric ones for those who need more parametric bands, though. I hope you will release a GUI-less version of this EQ, too. Except for the Limiter6 when on the master buss, I find myself using all your GUI-less plugins by the buckets. ♥ 🙂

Leave a comment