# Help me understanding the super equalizer source code

Hello, I'm trying to understand Shibatch's super equalizer Winamp plugin source, but I'm not good at DSP and mathematics.

It seems that super equalizer plugin uses overlap-add method to evaluate FIR filter. The code that calculates the FIR filter coefficients in super equalizer is like this: (Just the simplified pseudocode... not the exact code.)

for (int i = 0; i != FILTER_LENGTH; ++i)
{
int t = i - FILTER_LENGTH / 2;

result[i] =
band_gain * LPF(t, band_freq) +
band_gain * (LPF(t, band_freq) - LPF(a, band_freq)) +
band_gain * (LPF(t, band_freq) - LPF(a, band_freq)) +
band_gain * (LPF(t, band_freq) - LPF(a, band_freq)) +
band_gain * (IMPULSE(t) - LPF(t, band_freq));

result[i] *= WINDOW(t);
}


LPF is lowpass filter function. LPF(t, CutoffFrequency)

IMPULSE(t) is 1 when t is 0. Otherwise IMPULSE(t) is 0.

WINDOW(t) is Kaiser window function.

band_freq array contains equalizer frequency bands.

band_gain array contains the weight of each frequency bands.

I assumed there are just four frequency bands.

band_gain = weight of 0Hz ~ band_freqHz
band_gain = weight of band_freqHz ~ band_freqHz
band_gain = weight of band_freqHz ~ band_freqHz
band_gain = weight of band_freqHz ~ band_freqHz
band_gain = weight of band_freqHz ~ SAMPLING_RATE / 2


I want to know this part:

result[i] =
band_gain * LPF(t, band_freq) +
band_gain * (LPF(t, band_freq) - LPF(a, band_freq)) +
band_gain * (LPF(t, band_freq) - LPF(a, band_freq)) +
band_gain * (LPF(t, band_freq) - LPF(a, band_freq)) +
band_gain * (IMPULSE(t) - LPF(t, band_freq));


What formula does the code using? Or... what should I study to understand the code?

Any answer is welcome. Keyword suggestion is welcome.

Thanks.

result[i] =
band_gain * LPF(t, band_freq) +
band_gain * (LPF(t, band_freq) - LPF(a, band_freq)) +
band_gain * (LPF(t, band_freq) - LPF(a, band_freq)) +
band_gain * (LPF(t, band_freq) - LPF(a, band_freq)) +
band_gain * (IMPULSE(t) - LPF(t, band_freq));


is actually very simple to explain with pictures. First we assume f0 < f1 < f2 < f3.... lets look at one section

band_gain * LPF(t, band_freq) means create a low pass filter with cutoff frequency band_freq it then says to multiply the amplitude of the filter by band_gain something like this now lets move onto the more complicated lines

band_gain * (LPF(t, band_freq) - LPF(a, band_freq)) means make a LPF with Cutoff band_freq then subtract from it a LPF with cutoff band_freq if you look at the image below thats the pink section. Then you multiply the result by `band_gain1' you can find the other bands in a similar fashion . Now lets add them together, something like this, just 'superposition' which makes our final filter look roughly like this I hope those pictures make sense

• If this works depends highly on the kind of low pass filter used. It needs to be zero phase (so linear phase with delay compensation) and the pass band ripples have to be very small to create a proper rejection in the complemental filter. I somehow doubt that this simple design approach got the low pass filter really right. Maybe the EQ is not so "super" after all. – Jazzmaniac Mar 20 '15 at 8:29
• I'm sorry for late comment. Thanks for great answer! – torl pees Mar 22 '15 at 11:50