2
$\begingroup$

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.

You can find more here: https://www.researchgate.net/publication/277879431_On_the_Minimum-Phase_Nature_of_Head-Related_Transfer_Functions

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: 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?

$\endgroup$
12
  • 1
    $\begingroup$ 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. $\endgroup$ – Hilmar Feb 6 at 12:40
  • $\begingroup$ 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) $\endgroup$ – Mattia Surricchio Feb 6 at 13:02
  • 1
    $\begingroup$ @JuhaP: that would require you to identify poles and zeros first and that's quite difficult with a measured HRIR. $\endgroup$ – Hilmar Feb 6 at 15:19
  • 1
    $\begingroup$ Why wouldn’t a phase linear implementation preserve the magnitude response? $\endgroup$ – Dan Szabo Feb 6 at 19:15
  • 1
    $\begingroup$ Also, I’d be way more concerned about the minimum phase converted magnitude response deviating than I would be a linear phase conversion. $\endgroup$ – Dan Szabo Feb 6 at 19:44
0
$\begingroup$

In the end I used the Hilbert transform to compute the minimum-phase phase of my FIR.

I have used the following formula: Formula

Where H is the spectrum of the desired filter.

Which has been used in:

  1. Individualisation d’indices acoustiques pour la synthèse binaurale
  2. Phase Unwrapping for Spherical Interpolation of Head-Related Transfer Functions
  3. Transformation characteristics of the external human ear

However I am not sure of the results I got.

A follow up question discussing the results and implementation can be found here: minimum-phase phase via Hilbert transform returned values

$\endgroup$

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.