Showing posts with label FIR Filter. Show all posts
Showing posts with label FIR Filter. Show all posts

Sunday, November 6, 2016

Differenece between FIR and IIR Filter.

FIR vs IIR filter:

FIR Filter
IIR Filter
A finite impulse response (FIR) filter produces an output that will go to zero when the input goes to zero and stays zero
An infinite impulse response (IIR) filter produces an output that may continue indefinitely even after its input goes to zero and stays zero.
Its response to an impulse function input is finite
Its response to an impulse function input is infinite
FIR filter uses only current and past input digital samples to obtain a current output sample value. It does not utilize past output samples. Simple FIR equation is mention below.

y(n)= h(0)x(n) + h(1)x(n-1) + h(2)x(n-2) + h(3)x(n-3) + h(4)x(n-4)
IIR filter uses current input sample value, past input and output samples to obtain current output sample value. Simple IIR equation is mention below. 

y(n)= b(0)x(n) + b(1)x(n-1) + b(2)x(n-2) + b(3)x(n-3) + a(1)y(n-1) + a(2)y(n-2) + a(3)y(n-3)
FIR filters are preferred due to its linear phase response and also they are non-recursive. Feedback is not involved in FIR; hence they are stable
IIR filters are not stable as they are recursive in nature and feedback is also involved in the process of calculating output sample values. 
FIR have no analog equivalent
IIR filters have analog equivalent
FIR filters are used as anti-aliasing, low pass and baseband filters
 IIR filters are used as notch (band stop), band pass functions
Transfer function of FIR filter will have only zeros, need more memory
Transfer function of IIR filter will have both zeros and poles and will require less memory than FIR counterpart. 
An FIR filter’s z-Transform has zeroes and poles only at 0 + j0, so it is always stable
An IIR filter’s z-Transform has pole(s) and may also have zeroes, so it may be unstable if any of the poles are outside the unit circle
FIR Filters have linear phase.
IIR filters don’t have linear phase so they are used at places where phase distortion is tolerable.


FIR filter need higher order than IIR filter to achieve same performance. Delay is more than IIR filter. It has lower sensitivity than IIR filter. These are disadvantages of FIR filters.

Saturday, October 22, 2016

What is the intuitive meaning of FIR and IIR filters? What is the difference? Why do we prefer FIR over IIR? What is the physical significance?



"Impulse Response" of any system is the output you get when you apply a standard "impulse" signal at its input. An impulse response fully describes the behavior of the system.
 
As the name suggests, an FIR filter gives a finite-length output for an impulse, while if you excite an IIR filter with an impulse, it continues producing output for infinite duration. This is because an IIR filter has a "feedback" which continues to provide input to the filter implicitly, even when you have removed your external input signal.
 
Since IIR filter continues to generate output from a feedback process you can't control, the output might "feed" on itself and increase to undesired/harmful levels if the filter is not designed correctly. So, it is easier to design stable FIR filters. However, IIR filters are more "powerful" than FIR as you can make smart use of feedback to reduce total number of elements in the filter.
 
Assume you are speaking at a huge public function, with loudspeakers lining up the road for a kilometer. You speak a sharp "Hi" into the mic and the speakers relay your voice with successive (propagation) delays till the end of the road. This is like a stable FIR filter response.
 
Now assume that a speaker is placed close to the mic itself. As soon as you say "Hi", the speaker feeds it back to the mic with a larger amplitude and a slight delay. This starts a cycle till the speaker output increases uncontrollably to its maximum. This is why you sometimes hear the "screeching" in a mic+speaker system, and is analogous to an unstable IIR filter.