9
$\begingroup$

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] $$

$\endgroup$
  • 1
    $\begingroup$ 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. $\endgroup$ – Naresh Mar 28 '13 at 10:25
  • $\begingroup$ @Naresh You ought to post that as an answer. $\endgroup$ – Jim Clay Mar 28 '13 at 12:23
  • $\begingroup$ @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 $\endgroup$ – user4234 Mar 28 '13 at 12:23
7
$\begingroup$

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.

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

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.

| improve this answer | |
$\endgroup$
  • $\begingroup$ there are other was (like parallel sections) than cascading. $\endgroup$ – robert bristow-johnson Feb 13 '19 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.