My problem is this: Given a frequency magnitude response $|\hat{h}(\omega)|$ of a minimum phase system, how can one reliably recover its phase response?
In my case, the magnitude is quite short (~30-50 samples). Here is an example:
I don't want to use any approach requiring polynomial root finding since they are very sensitive to noise (in my experience, at least).
My current approach is to use the Hilbert transform:
$$ \operatorname{arg} \left[\hat{h}(\omega) \right] = - \mathcal{H} \left[ \ln | \hat{h}( \omega ) | \right] $$
This is how I've coded it in Python (I've padded the log magnitude with zeros as suggested by this post):
def min_phase_fir(freq_mag, zero_pad): logmag = np.log(freq_mag) logmag = np.pad(logmag, (0, zero_pad), 'constant', constant_values=(0, 0)) phase_response = -np.imag(hilbert(logmag)) return phase_response[:len(freq_mag)] My questions are:
- How do I verify that this phase response is indeed the correct answer?
- Should I window the frequency magnitude at the point where I add zero-padding to ensure it's (somewhat) continuous? If yes, how?
Edit: Here is the impulse response from which the above magnitude was obtained, in case you need reference. Note it is not minimum-phase: 
