# IIR Filter for Smoothing (Low Pass Filter)

I am using IIR filter for smoothing

$$y[n] = ax[n]+(1-a)y[n-1]$$

My question is, if I add another IIR filter, will it be the second order of IIR filter? If not, what it can be called?

My second filter is

$$y_2[n] = ay[n] + (1-a)y_2[n-1]$$

• Yes, the combination of the two IIR filters would be called a 2nd order IIR filter. The process of combining two first order filters to form a second order filter is called cascading. – Naresh Mar 28 '13 at 10:25
• @Naresh You ought to post that as an answer. – Jim Clay Mar 28 '13 at 12:23
• @Naresh Thank you for your answer. I was confused because in the Wikipedia, the second order of smoothing have a different equation. Here is the link: en.wikipedia.org/wiki/Exponential_smoothing – user4234 Mar 28 '13 at 12:23

If you apply two filters in a series cascade, then the behavior of the cascade can be expressed in two different ways. In the time domain, the overall system's impulse response can be calculated by convolving the impulse responses of $y[n]$ and $y_2[n]$ together. For IIR filters, this can be somewhat cumbersome.

In the frequency domain, the overall system's $z$-domain transfer function can be calculated by multiplying the transfer functions $H_y(z)$ and $H_{y_2}(z)$ together. This is usually a much easier route for filters with feedback.

In your case, the two filters actually have the same input/output relationship (assuming that $y[n]$ is the input to $y_2[n]$. Using the $z$-transform, it's easy to find that:

$$H_y(z) = H_{y_2}(z) = \frac{Y(z)}{X(z)} = \frac{a}{1 - (1-a)z^{-1}}$$

Using the relationship I mentioned above, you can calculate the transfer function of the two filters in cascade using:

$$H(z) = H_y(z) H_{y_2}(z) = \left(\frac{a}{1 - (1-a)z^{-1}}\right)^2$$

$$H(z) = \frac{a^2}{1 - 2(1-a)z^{-1} + (1-a)^2z^{-2}}$$

We can just as easily use the inverse $z$-transform to arrive back at the difference equation for the two cascaded filters:

$$y_c[n] = a^2x[n] - 2(1-a)y[n-1]+(1-a)^2y[n-2]$$

By inspection, we can state that this is a second-order filter (provided $a \not= 1\$), as you suspected.

• I think the denominator of the first transfer function should be 1 - (1-a)z^-1 (notice the minus). – jrast Jun 26 '14 at 14:59
• You're right; fixed. – Jason R Jun 26 '14 at 16:05

Yes, the combination of the two first order IIR filters would be called a 2nd order IIR filter. The process of combining two first order filters to form a second order filter is called cascading.

• there are other was (like parallel sections) than cascading. – robert bristow-johnson Feb 13 '19 at 9:25