# How to stabilize a filter

Suppose we have an unstable all-pole filter with transfer function $H(z) = A(z)^{-1}$. What is the best way to design a stable filter with frequency response as close to that of $H$ as possible. (I don't really know enough dsp to better define ''as close as possible'', but I am thinking in $L^2$ sense)

• I suppose you're talking about the magnitude of the frequency response, not the phase. You can obtain a stable filter with exactly the same magnitude response by reflecting all poles outside the unit circle into the circle, i.e. by replacing a pole $z_p$ with $|z_p|>1$ by $1/z_p^*$, and by appropriate scaling. The phase will of course be different. – Matt L. Sep 29 '15 at 9:40
• @MattL. That should be an answer! – Peter K. Sep 29 '15 at 11:48
• @MattL. Yes, thank you, this is what I meant and was looking for. Please write this as an answer so I can accept it. – sarasvati119 Sep 29 '15 at 11:57
• @PeterK.: OK, see below ... – Matt L. Sep 29 '15 at 13:08

The magnitude of the frequency response will remain unchanged if you reflect any poles outside the unit circle - these are the ones causing instability - back inside the circle. I.e., a pole $p$ (with $|p|>1$) is replaced by the new pole $\tilde{p}=1/p^*$, where $*$ denotes complex conjugation. This will not change the magnitude of the frequency response (up to a scaling factor), but it will change the phase response.
The correct scaling is obtained if each factor $(1-p_iz^{-1})$ with $|p_i|>1$ of the denominator polynomial $A(z)$ is replaced by $|p_i|(1-z^{-1}/p_i^*)$.