mpv-scripts icon indicating copy to clipboard operation
mpv-scripts copied to clipboard

Question: firequalizer gain equation ?

Open JorgeR81 opened this issue 4 years ago • 3 comments

Thanks for these great scripts.

I was just wondering how did you came up with such peculiar firequalizer gain equation values:

cubic_interpolate(2.8853900817779269*log(f/157.48+1)

In the documentation, the default is simply:

cubic_interpolate(f)

( https://ffmpeg.org/ffmpeg-filters.html#firequalizer )

JorgeR81 avatar Feb 26 '21 00:02 JorgeR81

It makes gain entry linear. The 15 bands placement is non-logarithmic (to allow 0 Hz) but at high frequency it becomes half-octaves band. Assuming t = 2.8853900817779269*log(f/157.48+1) Then f = 157.48 * (exp(t / 2.8853900817779269) - 1) = 157.48 * (sqrt(2^t) - 1) And substitute t from 0 to 14, you get the center frequency.

mfcc64 avatar Feb 28 '21 07:02 mfcc64

OK, thanks.  So if I want to use a simpler version, with less bands ( e.g.,  65 / 400 / 1250 / 2850 / 5600 / 12500 Hz ) it would be better to use the standard gain equation: cubic_interpolate(f) ? Do you think there's a better equation for this band configuration? 

JorgeR81 avatar Feb 28 '21 13:02 JorgeR81

Using cubic_interpolate(f) is enough. Note that the default is gain_interpolate(f) which is less smooth than cubic_interpolate(f).

mfcc64 avatar Mar 02 '21 00:03 mfcc64