# Force an unstable IIR filter to be stable by forcing a nonlinearity in the digital block diagram

I am modeling an analog filter with digital software and have reduced the model to a 4th order FIR filter in discrete space with transfer function

$$H(z) = \frac{b_0 + b_1 z^{-1} + b_2 z^{-2} + b_3 z^{-3} + b_4 z^{-4}}{1 + a_1 z^{-1} + a_2 z^{-2} + a_3 z^{-3} + a_4 z^{-4}}$$

It happens to be unstable, but I have noticed that most analog "musical" LP filters distort non-linearly when in this realm of high resonance rather than blow up to infinity (of course). Is it possible to simulate this by adding a nonlinear element to the IIR block diagram?

Clipping with $y[n] = \operatorname{clip}(x[n] + \ldots)$ creates a periodic [-1, -1, 1, 1, ...] in the output signal, so is there another way I can prevent numerical blowup?

• I doubt that this unstable filter will be useful in practice. I would go back one step and try to understand why the filter is unstable. If it is supposed to model a (stable) analog filter, it should also be stable. If you added more information about the analog filter and about the way you came up with the digital version, we would be able to help a bit better. – Matt L. Oct 27 '16 at 12:31
• Perhaps what I'm doing is unusual. I'm trying to model filter feedback in transistor and diode filters used in synthesizers (e.g. the Moog ladder). You can control the cutoff frequency and resonance (negative feedback) with knobs, which in turn set the analog transfer coefficients, and it is possible to reach a state which I believe is unstable, since the output distorts on the analog device. I'm not exactly trying to model this nonlinearity precisely, but I'd like to know where it would show up in the block diagram of the digital filter to prevent blowups. – Vortico Oct 27 '16 at 12:51
• Due to your comment, I decided to look back at my derivation of the analog -> digital part and noticed that I normalized the gain of the digital filter so that $\lim_{s\to 0} H(s) = 1$. This pushes the resonance peak above 0dB, which causes blowups. I think you're right, because in the real analog filter, the peak is fixed at around 0dB, and the low shelf is actually attenuated as I turn up the resonance knob rather than fixed. – Vortico Oct 27 '16 at 12:57
• The Moog ladder (and other ladder filters) relies strongly on internal nonlinearities for the sound it produces. Especially in case of high resonance, the nonlinearity in the feedback path guarantees stability and allows the filter to drive into self-oscillation. It does not make much sense to use linear analog stability analysis on this kind of filter. – Jazzmaniac Oct 27 '16 at 13:37
• @Vortico, modeling the Moog filter is not trivial. Do you rely on any resources for the model? If so, can you point to any references? If you attempt to model the filter entirely on your own, It's possible that your approach is not suitable. – Jazzmaniac Oct 27 '16 at 13:39