# Is this system an FIR filter or an IIR filter?

Consider this system:

 y[n]=y[n-1] + x[n]


It can be verified easily that this system has a finite impulse response (by putting x[n]= delta[n] i.e impulse, and evaluating impulse response h[n]=y[n]). Yet for a unit step input U[n], this system is an unstable system. On wikipedia it is mentioned that FIR filters are always stable

Now my question is , is this an FIR filter or an IIR filter?

It is an IIR filter. I think you misunderstand what is meant by "finite impulse response". It does not mean finite amplitude, it means finite time- i.e. that the impulse response eventually becomes zeros.

The impulse response of the filter is a step function, which is infinite in time.

x[-1] = 0
x[ 0] = 1
x[ 1] = 0 ...

y[-1] = 0
y[ 0] = 1
y[ 1] = 1
y[ 2] = 1 ...


When $y[n]$ depends upon $y[n-k]$, where $k$ is a positive integer , then the system is said to be IIR . Otherwise , it is FIR filter. The above system is IIR.

This is an IIR filter as the output is recursively related to input and previous output values (here: y[n-1]).

If $x[n] = \delta[n]$, then $h[n] = y[n -1] + \delta[n]$ which is infinite in time.

• Just because a filter is written recursively, does not make it infinite impulse response. Consider: $y(n)=y(n−1)+x(n)−x(n−M)$. It's recursive, but it implements a finite impulse response filter. – Peter K. Mar 20 '13 at 0:21
• @PeterK.: your example shows that recursive filters can have a finite impulse response, I agree. But I had a look into a few textbooks and lectures and the common definition of an IIR filter is: a filter whose transfer function has poles (D. Schlichthärle: Digital Filters, B. Yang: DSP lecture, Uni Stuttgart, German Wikipedia de.wikipedia.org/wiki/Filter_mit_unendlicher_Impulsantwort, D. Kammeyer: Digitale Signalverarbeitung). So according to this definition an IIR filter can have infinite impulse response but it's not necessary. – Deve Mar 20 '13 at 9:13
• So you're saying that an infinite impulse response filter is not necessarily an infinite impulse response filter? You're even more confused if you think an FIR filter does not have poles. FIR filters have poles: they are just all at the origin (for a causal FIR filter). Think about $Y(z) = 1 + z^{-1}$. It is FIR, and yet it has a pole at the origin (what happens when $z=0$). – Peter K. Mar 20 '13 at 11:46
• @PeterK.: I'm just saying that according to the above sources a recursive filter is called IIR filter (even though it might have a finite impulse response as you've showed). I was wrong when setting "has poles" equal to "is recursive". Thanks for the clarification. – Deve Mar 20 '13 at 17:01

The satement of Peter K. regarding terms FIR , IIR and non-recursive , recursive is true. Many text books and also wikipedia is wrong when saying that IIR is the same as recursive filter and FIR is non-recursuve. Both filters FIR and IIR can be implemeted as recursive or non-recursive form. Please see lecture of prof. Dutta Roy about this.

It is obviously IIR because the output sequence y[...] occurs on both the left-hand and right-hand sides.

• Just because a filter is written so that the output appears on both sides of the equation, does not make it infinite impulse response. Consider: $y(n)=y(n−1)+x(n)−x(n−M)$. It has $y$ on both sides of the equation, but it implements a finite impulse response filter. – Peter K. Mar 20 '13 at 0:22
• @PeterK. Look at en.wikipedia.org/wiki/Finite_impulse_response . Look at the definition. Do you see the y[...] on the right hand side? – stackoverflowuser2010 Mar 20 '13 at 3:07
• @stackoverflouser2010: Sure, see my previous comment for an example of an FIR filter with $y[n-1]$ on the right hand side. – Peter K. Mar 20 '13 at 11:42
• @PeterK. Look at en.wikipedia.org/wiki/Finite_impulse_response#Definition . There is no y[...] component on the right hand side. By that definition, your example is not an FIR filter. – stackoverflowuser2010 Mar 20 '13 at 17:27
• @stackoverflouser2010: No matter how many times you repeat it, it's a non-sequitur for the issue at hand. It's perfectly possible to write an FIR filter with the output, $y$, on the right hand side. Of course you can write it without the output on the right hand side; I'm making the point that it's not a definition of FIR. The definition of FIR is that it has a finite duration impulse response --- nothing more, nothing less. – Peter K. Mar 20 '13 at 19:11