# Minimum phase FIR method

I am trying to make a minimum phase filter (in wxMaxima) according to these steps:

• first create a "normal" FIR (a simple sinc, wc=0.4, random example, but in the pictures a remez with Octave)

• calculate the zeroes (allroots() function)

• delete the zeroes outside the unit circle (anything>1/0.98, tolerances&co)

• delete half of the zeroes on the unit circle (the conjugate pairs, 0.98 < x < 1/0.98)

• reconstruct the polynomial => coefficients.

As I understand it, these are the correct steps to follow, but this is what I'm getting:

and this only if I don't delete half the zeroes. If I do, no matter how I sort, choose, etc, I get bogus results. Is this the right way to achieve a minimum phase? I can provide the wxMaxima approach if needed (I tested it first to see if I can reconstruct the original impulse and I could do it, so obtaining the coefficients is not the problem, but the how to).

I wanted to add this later that day but got busy. Here's a graph showing the frequency response of the four filters, ignore the blatant uglyness in attenuation, it's meant to be an example. The 2nd is by zero inversion (and doubling), the 3rd is by spectral factorization and the 4th is like the 3rd only done by geometric mean between adjacent zeroes, to avoid the manual tweaking of adding the DC offset to h[M/2]:

Here are the zeroes:

The idea with the geometric mean came after realizing that the response of the equiripple wasn't quite equiripple, so adding $\delta_2$ to h[M/2] was tricky (you can see the green zeroes aren't quite overlapping). This also gave me the idea that I can use it with non-equiripple, too (that pdf implies the method can only be applied there). Sure enough, here's the result:

Of course, windowing with a Kaiser (Dolph-Chebyshev, or exponential, or cosh) window(s) should be necessary to compensate for the stop-band. Here's a quick example with a Hamming window:

I think the geometric mean ($\sqrt{z_1 \cdot z_2}$) comes as a good alternative, as long as the zeroes are fairly evenly-spaced, otherwise choosing between non-overlapping zeroes (see the green ones) results in going away from their center.

After this I reached the conclusion that if you need a minimum-phase FIR then it's safe to go for an inverse Chebyshev IIR for the sake of less computation power. The half-order minimum phase might be worth it in terms of delay, but it's a pain matching the amplitude. Here are some results with LTspice, showing two FIRs with N=64, linear and nimimum phase, and an inverse Chebyshev IIR (not Cauer, chosen for flatness and similarity in response) with N=11 and matching attenuation:

And, for the sake of comparison, here are the phases of the min.-ph. FIR and the inv. Cheb. IIR:

...and the step responses of all three:

• I forgot and don't want to edit again, this is solved now. – a concerned citizen Sep 2 '15 at 8:10

You made a minimum-phase filter but with a different magnitude response than the original linear phase filter. What you have to do to keep the magnitude the same is to reflect the zeros outside the unit circle into the circle. Since for linear phase filters the zeros are symmetrical with respect to the unit circle (or on the circle), you simply have to double each zero inside the unit circle and leave the zeros on the circle unchanged. Apart from doubling each zero inside the circle you also need to apply a scale factor $$1/z_i$$ for each zero that gets reflected (where $$z_i$$ is the location of the zero).

So each pair of zeros of the linear phase filter (assuming $$|z_i|<1$$)

$$(1-z_iz^{-1})(1-z^{-1}/z_i^*)$$

needs to be replaced by the following scaled double zero:

$$\frac{1}{|z_i|}(1-z_iz^{-1})^2$$

This will keep the magnitude unchanged while transforming the linear phase function to a minimum-phase function.

• Thank you for the answer. In wxMaxima, I had p:<z on circle> and q:<z inside> and the new vector for reforming the polynomial was p and q joined. Now I simply doubled q (new:append(q,q,p)) and it worked, minus gain normalization, trivial. But now, I was under the assumption that converting the FIR to min. phase would also reduce the number of taps and the final result is the same. Is this not so or is it another approach for this? – a concerned citizen Aug 30 '15 at 13:37
• This would probably warrant a separate question "How do miminize number of taps for an FIR by allowing minimum phase". But check out eeweb.poly.edu/iselesni/EL713/mpfir/mpfir.pdf – Hilmar Aug 30 '15 at 13:49
• @aconcernedcitizen: You are right that the resulting minimum-phase filter is sub-optimal. The approach you sketched in your question is also possible, but then the linear phase filter must approximate $|H(\omega)|^2$ (note the square!). Then you can do spectral factorization as described by you, and you'll get a minimum-phase filter approximating $|H(\omega)|$. I think the misunderstanding on your side was that you thought both filters must have the magnitude response. This is the case in the approach I showed you, but not in the other one. – Matt L. Aug 30 '15 at 14:02
• Of course I meant to write "... the SAME magnitude response." – Matt L. Aug 30 '15 at 14:09
• @Hilmar you're probably right, but if it would be required I'll first have to chew on the link you gave, first. [Matt - can't use two "add"] Obviously, I need to learn more. I can't vote up, unfortunately, but I'll drink the next beer in your names. :-) Now I have some reading to do... Thank you, both. – a concerned citizen Aug 30 '15 at 15:00