# Why do inverted impulse responses sound awful when applied to an audio system?

In this answer, the responder claims that acquiring a measured impulse response and straightforwardly inverting it (e.g. by directly in the spectrum, after zero-padding, or by determining the inverse filter through least-squares) would sound awful and therefore, would be a poor equalizer for an audio system. Wouldn't inversion be the preferred approach to echo-cancellation, but then why shouldn't it work for magnitude equalization as well?

My first guess would have been noise, making the inverse ill-defined. But on the other hand, noise would not seem so problematic in the least-squares approach to inversion.

So why is it that "naive inversion sounds bad"?

• I concur with your first guess. Under conditions of very long delay spreads (deep freq notches) linear equalizers such as least squares are ill suited. (Least squares can only provide a solution in the frequencies where energy exists) Feb 26, 2023 at 2:15

For simplicity we assume that the room and the source are fixed.

A room's impulse response depends on a LOT of different factors which include the exact position, directivity and orientation of the microphone. So there isn't a single impulse response but there are infinitely many.

At the same time, the room transfer function has a very large number of degrees of freedom. Let's say we have a residential room with a reverb time off 0.3s sampled at 48 kHz. For a decent signal to noise ratio in the measurement (> 40dB) you need an impulse response length of about 10,000 samples which corresponds to a frequency resolution of about 5 Hz.

A typical room transfer function consists of 1000s of narrow peaks and notches that are quite pronounced but whose exact location and gain depends A LOT on the exact position and directional characteristics of the microphone.

Even for microphone locations that are fairly close together, the individual transfer functions don't correlate well at all. The fine structure of impulse response and transfer function looks completely different if you move the mic by a few centimeters.

Hence inverting the transfer function is only useful if you ONLY want to use the signal recorded with the measurement microphone itself. At any other location this will just make it a lot worse. Simple example: if your measurement has a 15 dB deep notch at 2045 Hz inverting the transfer function would require you to add 15 dB of gain. However at a location 10 cm away you may already have a 10 dB peak at 2045Hz so adding the 15 dB of gain would result in excess gain of 25 dB, which indeed sounds terrible.

If "listening" implies "using your own ears in the room", than inverting a single microphone transfer function doesn't work. You have two ears, their directivity is quite a bit different than that of the measurement microphone AND you can't get both ears at the same location.

That's why most room EQ process(like REW) will

1. Focus on information and a level of detail that is perceptually relevant but typically a lot less than the exact fine structure of impulse response and transfer function.
2. Try to compensate for features that can be assumed to be reasonably consistent across the target area in the room.
• Insightful, and related to my RF/wireless experience where such deep frequency domain notch conditions lead to significant noise enhancement when you try to invert—- the inverted response at those notches will amplify the signal as well as the noise (significantly) in those areas where for optimizing signal to noise this is not the best solution. Under this condition we resort to using non-linear decision feedback equalizers (useful when we have actual known symbols to transmit, I don’t see how that can apply to audio but the noise enhancement part is similar) Feb 26, 2023 at 2:13
• So do I understand you right, that it is only reverb that makes naive inversion of the transfer function sound terrible? So naive inversion of the speakers' transfer function alone is feasible (their own directionality left aside for a fixed configuration) and doesn't sound so bad (speakers are usually designed so as not to show notches, where noise may disable invertibility)? I am also wondering if your argument isn't partly invalidated by the fact that frequencies of 1 kHz or below have wavelength >30cm, and thus, their standing waves due to reverb/echo exceed the dimensions of the head... Feb 26, 2023 at 11:01
• Btw. doesn't any laptop computer nowadays have echo cancellation for its builtin microphones? Why does this work (if it does at all...)? The computer is nothing but a pair of ears (or possibly a multi-microphone array) in a room... Ah wait, there the processing is on the receiver's side, instead of the transmitter. Feb 26, 2023 at 11:04
• The laptop works because you are ONLY using the signal that's picked up with the microphones laptop. It's not designed to equalize the room, it's removing sound from a loudspeaker that's very close by and in a very well known location. Feb 27, 2023 at 10:04
• Re: Reverb vs speaker: the room itself produces early reflections, room modes and later reverberation. All of these have specific inversion problems. A decent loudspeaker does not have a lot of notches but the overlay of early reflections and modes create strong ones. Feb 27, 2023 at 10:07

One thing that I remember from a Brüel & Kjær application note from the 1980s or 90s is that for a room impulse response, you wanna separate the frequency response (and therefore the impulse response) into three or four qualitatively distinct components. These four components or sections are Linear-Time Invariant systems in cascade:

1. memoryless pure gain section (including polarity)
2. pure delay section
3. minimum-phase section (with 0 dB gain at some defined frequency)
4. (recursive) all-pass filter section

The pure delay might be measured as the derivative of unwrapped phase at high frequencies. If there was no pure delay ($$e^{-j\omega D}$$) then this unwrapped phase would level out at high frequencies. There are, of course, other ways to measure pure delay, including cross-correlation and NLMS adaptive filtering.

The minimum-phase section is done purely from applying the Hilbert Transform to the measured magnitude response (in dB). The phase, in radians, is the negative of the Hilbert Transform of the log magnitude, in nepers (which is about 8.6859 dB in one neper).

The all-pass component is whatever remains after accounting for and removing 1, 2, and 3.

Now, in answer to your question, only sections 1 and 3 can be inverted. Sections 2 and 4 cannot be inverted. But their gain is 0 dB.

• I think the pure delay need not be inverted anyway because everyone using an audio system accepts that sound has to travel some time between speakers and ears, and doesn't expect the equalizer to revert this. The all-pass also might contain echoes, so it is clear to me that inversion is at least difficult. But isn't echo cancellation all about inverting at least some fraction of the echoes at the location/direction of the receiver? So I would suspect the all-pass can probably be decomposed further into an invertible and a non-invertible part. Does this make sense? Feb 26, 2023 at 10:45