I haven't recorded a precise impulse response, but I have carefully written the attenuation/boost of a recording chain for every third of octave:

20 Hz,   25 Hz, 32 Hz, 40 Hz, 50 Hz, 64 Hz, 80 Hz, ..., 640 Hz, 806 Hz, 1016 Hz, 1280 Hz, ...
-1 dB, -1.3 dB, -2 dB, ..., +2 dB, +2.5 dB, +1.5 dB, ...

How to inverse this frequency response? I can do it with an equalizer in any audio editor, but how would you do it with code? (e.g. Python)

How to make use of this list [-1, -1.3, -2, ..., 2, 2.5, 1.5, ...] ?

  • $\begingroup$ Well, you use or implement&use an equalizer in Python. But you probably already know that – so, what's your question, can you ask it more precisely? $\endgroup$ – Marcus Müller Jan 21 '17 at 15:34
  • $\begingroup$ Well I don't know how to do this with dB specifications for each frequency, any idea about implementation, with minimal phase modification? $\endgroup$ – Basj Jan 21 '17 at 17:34
  • $\begingroup$ well, as you said, you can adjust an equalizer to inverse these effects, given you have an equalizer that does this fine frequency resolution. So I really don't know exactly what you want me to explain: How to design an equalizing filter for especially these numbers, or how to design the functional equivalent of your graphical EQ, or how to convert dB into linear? $\endgroup$ – Marcus Müller Jan 21 '17 at 17:47
  • $\begingroup$ dB/linear is ok, the question for me is how to design such an equalizing filter (with 3 specs per octave) and how to implement it using a dsp library (python numpy for example or pseudo code) $\endgroup$ – Basj Jan 21 '17 at 18:10

What you're most probably looking for is a FIR filter designed using a window filter design method.

Essentially, you could argue "Hey, I know how I would like my filter's amplitude vs. frequency diagram to look like" (and use the inverse of your measured gains as exactly that), and then argue "OK, I want to multiply my signal's spectrum with this equalizing spectrum, so let's instead convolve the signal with this spectrum's inverse Fourier transform". And that actually works – but you get into a lot of problems because of effects of the fact that your filter "template" essentially has limited length, and you get spectral leakage. So you add windowing to the method, and tadah, get a usable method of designing a filter.

The article of this name on DSPRelated might be of interest.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.