# Shall a $1^{\rm st}$ order IIR filter include $x[n-1]$ term?

I have seen a $1^{\rm st}$ order IIR filter in the following form:

$$y[n] = \alpha x[n] + (1 - \alpha) y[n - 1]$$

Such as: another post in this forum

However, the filters generated by Matlab, such as [b,a] = ellip(1,1,10,0.1); usually have following format:

$$y[n] = b_1 x[n] + b_2 x[n-1]-a_2 y[n - 1]$$

There is a $x[n-1]$ case in the second format.

• May I know why there is such a difference?
• Is it possible to deduce one format from the other?
• i guess that 1st-order elliptical filter has a zero somewhere. the top equation is a simple 1-pole LPF with no zero. Apr 1 '16 at 6:41

A filter described by the difference equation

$$y[n]=bx[n]+ay[n-1]\tag{1}$$

is just a special case of a first-order filter. Its transfer function is given by

$$H(z)=\frac{b}{1-az^{-1}}=\frac{bz}{z-a}\tag{2}$$

from which you can see that it has one pole (at $z=a$) and one zero (at $z=0$). A more general first-order filter has a zero that is not necessarily at the origin of the $z$-plane:

$$H(z)=\frac{b_0z+b_1}{z-a}\tag{3}$$

Now the zero is at $z=-b_1/b_0$. This corresponds to the more general first-order difference equation

$$y[n]=b_0x[n]+b_1x[n-1]+ay[n-1]\tag{4}$$

You can see that $(1)$ and $(2)$ are just special cases of $(4)$ and $(3)$ with $b_1=0$. So both filters you mentioned in your question are first-order filters, but the first one is a special case because its zero is at $z=0$.

• You are basically saying that "first order" stands for single pole, y[n] and y[n-1], which is a restriction on the autoregressive part of the LTI equation whereas there are no restrictions on the moving average (input) part. You seem have chosen a contrived way to say that single-pole LTI is described by $y_n + ay_{n-1} = b_0 x_n + b_1 x_{n-1} + \cdots + b_n x_0$. Apr 2 '16 at 16:06
• @ValentinTihomirov: No, that's not what I'm saying. "First order" means that there is one pole and one zero, so it's also a restriction on the non-recursive part. Apr 2 '16 at 19:23