jaakkopasanen/Impulcifer

Reducing Impulse Response Pre-ringing

jaakkopasanen opened this issue · 4 comments

Impulse responses estimated with logarithmic sine sweeps and inverse filtering have some amount of pre-ringing caused by fade-in and fade-out of the sine sweep. Fades cannot be simply removed because that will introduce greater problems.

High frequency pre-ringing can be removed by setting the end frequency to half of sampling frequency (or higher?) and cutting out the tail at the last zero-crossing.

Low frequency pre-ringing cannot be done similarly because the fade-in cannot be removed. Instead a compacting filter can be constructed for removing the low frequency pre-ringing. See this paper by Angelo Farina for comments and references: http://pcfarina.eng.unipr.it/Public/Papers/238-NordicSound2007.pdf

A solution alternative to removing the fade-out is to continue the sweep up to the Nyquist frequency (22050 Hz, in our example, as the sampling rate was 44.1 kHz), and cutting it manually at the latest zero crossing before its abrupt termination. This way, no pulsive sound is generated at the end, and the full-bandwidth of the sweep removes almost completely the high-frequency pre-ringing.

Packing filter requires a reference measurement which can be a loopback measurement from the sound card to "idealize" the sound card or a anechoic measurement of loudspeaker, microphone and soundcard. In practice very few people have access to anechoic chamber so the anechoic measurement is not possible.

Fade-in and fade-out windows will stay but are according to "Optimizing the exponential sine sweep (ESS) signal for in situ measurements on noise barriers" (Massimo Garai and Paolo Guidorzi, 2015). https://www.researchgate.net/publication/280131468_Optimizing_the_exponential_sine_sweep_ESS_signal_for_in_situ_measurements_on_noise_barriers

Sound card loopback packing filter is the only thing that needs to be implemented.

It might be better to create the inverse filter (packing filter) from headphone measurement rather than from audio interface loopback connection. This way the microphones' transfer functions would be inverted as well. This would basically serve as an alternative to already implemented headphone compensation. However the current headphone compensation has heuristic scheme for avoiding narrow spikes in the equalization filter and this would have to be taken into account in the inverse filter as well.