# Criteria to distinguish FIR and IIR filters from difference equation?

What criteria should be used to safely decide if it is an IIR filter or FIR filter from a difference equation? FIR filter are always stable, meaning all poles are inside the unit circle AND have pole-zero cancellations i.e have equal number of poles and zeros at the same point in the z-plane. IIR filters are conditionally stable, i.e always have poles on/outside the unit circle. Is this good enough to distinguish from the difference equation? what other criteria should be considered?

PS: Please don't say IIR filters have recursive difference equations, and FIR doesn't. It is not true.

• Why do you say it isn't true? – Jim Clay Feb 12 '14 at 21:58
• Because FIR filters can also be realized recursively. For example, y[n] = y[n-1]+x[n]-x[n-3] is FIR even though it has a recursive equation. Please correct me if I'm wrong! – Masked Feb 12 '14 at 22:25
• Minimum phase IIR filters do not have any poles outside the unit circle, and do not require any poles on the unit circle. – hotpaw2 Feb 13 '14 at 0:37
• @Masked I see your point. – Jim Clay Feb 13 '14 at 0:37
• The recursive difference equation you show as an example can be converted into a non-recursive form. Not so for an IIR. – hotpaw2 Feb 13 '14 at 0:45

Consider your example: $y[n] = y[n-1] + x[n] - x[n-3]$.
The Z-transform is $\mathrm Y(z)- z^{-1}\mathrm Y(z) = \mathrm X(z) - z^{-3}\mathrm X(z)$, and the Z-transform of the response is $\mathrm H(z) = \mathrm Y(z)/\mathrm X(z) = (1 - z^{-3})/(1 - z^{-1}) = 1 + z^{-1} + z^{-2}$. This means that the filter can be realized as $\mathrm y[n] = \mathrm x[n] + \mathrm x[n-1] + \mathrm x[n-2]$, which is clearly FIR.
Having said that though, if you randomly pick up a piece of papaer that has a difference equation written on it, you can't automatically say "Oh they are working with filters and signal processing here", because difference equations are used in lots of other applications where you aren't even processing a signal. And the solution to the equation (giveng initial conditions or an input $X[n]$) might mean something completely different to the output of a filter.