# Compute minimum phase version of a FIR

I am working with HRIR filters, in particular I am trying to interpolate them. One commod method in the literature to perform interpolation of HRIR is to use the minimum-phase decomposition and interpolate separately the minimum-phase part of the filter and then the all pass part.

What I am trying to do is to convert my arbitrary HRIR FIR into a minimum phase one. In particular, I am working in Python and I have been using this function.

However while performing the conversion from the original FIR into the minimum-phase one I get the following error:

RuntimeWarning: h does not appear to by symmetric, conversion may fail

With the following code:

min_phase_HRIR_0 = minimum_phase(hrtf[0], 'hilbert')


Where hrtf[0] is a 256 long FIR extracted from a HRIR database (in particular the HUTUBS database).

If I plot the magnitude of my original FIR and the minimum-phase one I get the following plot:

Which is obviously wrong since I am expecting the min phase and the original FIR to have the same magnitude spectrum.

I guess there is something wrong with the Scipy function. Is there anything for Python that converts a FIR into a minimum-phase version?

• The documentation clearly states Convert a linear-phase FIR filter to minimum phase. HRIR are not linear phase and that's exactly what h does not appear to by symmetric means. – Hilmar Feb 6 at 12:40
• Oh, I didn't notice that, my bad. Is there something in Python to compute the min phase version of a FIR? (non restricted to linear phase) – Mattia Surricchio Feb 6 at 13:02
• @JuhaP: that would require you to identify poles and zeros first and that's quite difficult with a measured HRIR. – Hilmar Feb 6 at 15:19
• Why wouldn’t a phase linear implementation preserve the magnitude response? – Dan Szabo Feb 6 at 19:15
• Also, I’d be way more concerned about the minimum phase converted magnitude response deviating than I would be a linear phase conversion. – Dan Szabo Feb 6 at 19:44