# Invertibility of Room Impulse Response: Reproducing Research Paper

I have been trying to reproduce this paper¹. Few things which are unclear to me. The paper talks about finding whether a given Room Impulse Response(RIR) is invertible or not based on Nyquist plot.

1. How can we plot the Nyquist plot from an RIR(using python/other opensource tools)?
2. I understand a Z transform as having both poles and zeroes, but how do we interpret an RIR in Z plane?
3. How do they do inverse filtering as mentioned in the paper(convolving with inverse impulse response)?
4. How to interpret Nyquist plot of RIR in terms of its invertibility?

¹ Stephen T. Neely and J. B. Allen: Invertibility of a room impulse response in: The Journal of the Acoustical Society of America 66, 165 (1979)

I wrote the following code for the same purpose and thought of sharing it. For simplicity I assumed impulse response to be simple averaging type(Low Pass Filter).

$h[n]= [0.5,0.5]$

import numpy as np
import matplotlib.pyplot as plt
from scipy import signal

hlp         =   np.array((0.5,0.5))
#hhp        =   np.array((0.5, -0.5))
f, T        =   signal.freqz(hlp)

fig1 = plt.figure()
plt.title('Frequency response')
plt.plot(f, 20 * np.log10(abs(T)), 'b')
plt.ylabel('Amplitude [dB]', color='b')
ax2 = ax1.twinx()
angles = np.unwrap(np.angle(T))
plt.plot(f, angles, 'g')
plt.grid()
plt.axis('tight')

fig2 = plt.figure()
plt.title('Nyquist Plot')
plt.plot(np.real(T), np.imag(T))
plt.ylabel('Im(H(w))')
plt.xlabel('Re(H(w))')
plt.show()


This code resulted the following graphs. I plotted this frequency response just for a sanity check(to make sure the numerator and denominator coefficient is taken correctly). Now I understand it the paper better :-))).

I'll partially answer the "low hanging fruit". Please don't accept this answer, but see it as something meant to supplement answers that deal with the "hard stuff", and accept these:

# How can we plot the Nyquist plot from an RIR(using python/other opensource tools)?

Using matplotlib's bog-normal plot function!

Calculate your frequency response for equidistant frequencies, and use the real and imaginary parts as X- and Y-coordinate vectors, respectively:

H, _ = freqz(…)
plot(numpy.real(H), numpy.imag(H)) # might need some transposing


# How do they do inverse filtering as mentioned in the paper(convolving with inverse impulse response)?

The paper introduces the inverse of a minimum phase filter in Laplace domain, simply as fractional polynomial where you've exchanged poles and zeros.

# How to interpret Nyquist plot of RIR in terms of its invertibility?

That's the point of the whole paper, you'll have to ask this more specifically. The paper says:

If the plot does not encircle the origin, then the shifted impulse response must be minimum phase.

And on the first page:

Minimum phase impulse responses are of particular interest because their inverses are guaranteed to be minimum phase and casual.