- Finite impulse response
A

**finite impulse response (FIR)**filter is a type of adigital filter . Theimpulse response , the filter's response to aKronecker delta input, is 'finite' because it settles to zero in a finite number of sample intervals. This is in contrast toinfinite impulse response filters which have internal feedback and may continue to respond indefinitely. The impulse response of an Nth order FIR filter lasts for N+1 samples, and then dies to zero.**Definition**We start the discussion by stating the

difference equation which defines how the input signal is related to the output signal:$y\; [n]\; =b\_0\; x\; [n]\; +\; b\_1\; x\; [n-1]\; +\; cdots\; +\; b\_N\; x\; [n-N]$

where $x\; [n]$ is the input signal, $y\; [n]$ is the output signal and $b\_\{i\}$ are the filter coefficients. $N$ is known as the "filter order"; an $N$

^{th}-order filter has $(N+1)$ terms on the right-hand side; these are commonly referred to as "taps".The previous equation can also be expressed as a

convolution of filter coefficients and the input signal.:$y\; [n]\; =\; sum\_\{i=0\}^\{N\}\; b\_i\; x\; [n-i]\; .$

**Impulse response and transfer function**To find the

impulse response we set:$x\; [n]\; =\; delta\; [n]$

where $delta\; [n]$ is the

Kronecker delta impulse. The impulse response for an FIR filter is the set of coefficients $b\_n$, as follows:$egin\{align\}\; h\; [n]\; =\; sum\_\{i=0\}^\{N\}b\_i\; delta\; [n-i]\; \backslash \; =\; b\_n.end\{align\}$for $n\; =\; 0$ to $N$.

The

Z-transform of the impulse response yields thetransfer function of the FIR filter:$egin\{align\}\; H(z)\; =\; Z\{h\; [n]\; \}\; \backslash \; =\; sum\_\{n=-infty\}^\{infty\}\; h\; [n]\; z^\{-n\}\; \backslash \; =\; sum\_\{n=0\}^\{N\}b\_n,z^\{-n\}.end\{align\}$

FIR filters are clearly "bounded-input bounded-output" (BIBO) stable, since the output is a sum of a finite number of finite multiples of the input values, so can be no greater than $sum\; |b\_i|$ times the largest value appearing in the input.

**Properties**An FIR filter has a number of useful properties which sometimes make it preferable to an

infinite impulse response filter. FIR filters:

*Are inherently stable. This is due to the fact that all the poles are located at the origin and thus are located within the unit circle.

*Require no feedback. This means that any rounding errors are not compounded by summed iterations. The same relative error occurs in each calculation. This also makes implementation simpler.

*They can be designed to belinear phase , which means the phase change is proportional to the frequency. This is usually desired for phase-sensitive applications, for example crossover filters, and mastering, where transparent filtering is adequate.The main disadvantage of FIR filters is that considerably more computation power is required compared with a similar IIR filter. This is especially true when low frequencies (relative to the sample rate) are to be affected by the filter.

**Filter design**To design a filter means to select the coefficients such that the system has specific characteristics. The required characteristics are stated in filter specifications. Most of the time filter specifications refer to the frequency response of the filter. There are different methods to find the coefficients from frequency specifications:

# Window design method

# Frequency Sampling method

#Weighted least squares design

#Minimax design

#Equiripple design . The Remez exchange algorithm is commonly used to find an optimal equiripple set of coefficients. Here the user specifies a desired frequency response, a weighting function for errors from this response, and a filter order "N". The algorithm then finds the set of $(N+1)$ coefficients that minimize the maximum deviation from the ideal. Intuitively, this finds the filter that is as close as you can get to the desired response given that you can use only $(N+1)$ coefficients. This method is particularly easy in practice since at least one text [*Rabiner, Lawrence R., and Gold, Bernard, 1975: Theory and Application of Digital Signal Processing (Englewood Cliffs, New Jersey: Prentice-Hall, Inc.) ISBN 0139141014*] includes a program that takes the desired filter and "N", and returns the optimum coefficients.Software packages like

MATLAB ,GNU Octave andScilab provide convenient ways to apply these different methods.Some of the time, the filter specifications refer to the time-domain shape of the input signal the filter is expected to "recognize". The optimum

matched filter is to sample that shape and use those samples directly as the coefficients of the filter -- giving the filter an impulse response that is the time-reverse of the expected input signal.**Moving average example**A

moving average filter is a very simple FIR filter. The filter coefficients are found via the following equation::$b\_\{i\}=frac\{1\}\{N+1\}$ for $i=0,1,dots,N$

To provide a more specific example, we select the filter order:

:$N=2$

The impulse response of the resulting filter is:

:$h\; [n]\; =frac\{1\}\{3\}delta\; [n]\; +frac\{1\}\{3\}delta\; [n-1]\; +frac\{1\}\{3\}delta\; [n-2]$

The following figure shows the block diagram of such a second-order moving-average filter.

To discuss stability and spectral topics we take the z-transform of the impulse response:

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

The following figure shows the pole-zero diagram of the filter. Two poles are located at the origin, and two zeros are located at $z\_\{1\}=-frac\{1\}\{2\}+jfrac\{sqrt\{3\{2\}$, $z\_\{2\}=-frac\{1\}\{2\}-jfrac\{sqrt\{3\{2\}$

The frequency response, for frequency "ω" in radians per sample, is:

:$H(e^\{jomega\})=frac\{1\}\{3\}+frac\{1\}\{3\}e^\{-jomega\}+frac\{1\}\{3\}e^\{-j2omega\}$

The following figure shows the absolute value of the frequency response. Clearly, the moving-average filter passes low frequencies with a gain near 1, and attenuates high frequencies. This is a typical low-pass filter characteristic. Frequencies about π are aliases of the frequencies below π, and are generally ignored or filtered out it reconstructing a

continuous-time signal. :The following figure shows the

phase response .:

**ee also***

Electronic filter

*Filter (signal processing)

*Infinite impulse response (IIR) filter

*Z-transform (specificallyZ-transform#Linear_constant-coefficient_difference_equation )

*Filter design

*Cascaded Integrator-Comb Filter **References****External links*** [

*http://dspguru.com/info/faqs/firfaq.htm FIR FAQ*]

* [*http://www.ludd.luth.se/~torger/brutefir.html BruteFIR; A software for applying long FIR filters to multi-channel digital audio, either offline or in realtime.*]

* [*http://freeverb3.sourceforge.net/ Freeverb3 Reverb Impulse Response Processor*]

*Wikimedia Foundation.
2010.*