jaakkopasanen / AutoEq

Automatic headphone equalization from frequency responses
MIT License
12.89k stars 2.47k forks source link

Support SuperEQ (fixes #670) #679

Closed nihil-admirari closed 10 months ago

nihil-admirari commented 11 months ago

SuperEQ was originally a Winamp DSP; now it's mostly known as a default equaliser of foobar2000 and DeaDBeeF. SuperEQ sources have been copied to various projects, the most readable adaptation, in my opinion is FFmpeg's.

Band limits were taken from af_superequalizer.c#L56. The first and the last bands are actually shelf filters: af_superequalizer.c#L129.

I'm not sure what should be used as fc for shelf filters, and asking on StackExchange didn't quite help. GUI shows the frequency of these bands as 55 Hz and 20 kHz, but these were simply obtained by dividing the next/multiplying the previous central frequency by $\sqrt 2$. To me, fc seems more like a cut-off frequency, which is what I've committed, and because of it, the first and the last band frequencies in AutoEq GUI don't match bands displayed in players' GUI.

Desktop foobar2000 has both a convolver and a standard 31-band EQ plugins (though none were recompiled for x64), and both foobar2000 and DeaDBeeF can utilise system-wide equaliser apps. However, foobar2000 on iOS can have neither plugins nor system-wide equalisers, and SuperEQ bundled by default is all there is (at least for free).

JuhaTP commented 11 months ago

Doing it this way may lead to wrong result. Why, because of you need gains to follow target equalization curve but get gains which when combined produces the close match with the target equalization curve (dot is the target gain).

gainsneeded

You need gains marked in plot but you get gain of the peak of each filter (this is demoed with peaking filters):

supereqakgk240st

Remember that peaks are rounded to closest integer.

As SuperEg filtering has totally different way to effect the frequencies compared to IIR based filtering (IIR filter effects in whole frequency range when SuperEq filters effects in each bands bandwidth range) so, you'll need to go some other path ... . As a resulting SuperEq response you could expect something like this (black dotted line):

AKG K240 Studio

(More, see my pull request)

nihil-admirari commented 10 months ago

Closing in favour of https://github.com/jaakkopasanen/AutoEq/pull/689.