Finite impulse response
   HOME

TheInfoList



OR:

In
signal processing Signal processing is an electrical engineering subfield that focuses on analyzing, modifying and synthesizing '' signals'', such as sound, images, and scientific measurements. Signal processing techniques are used to optimize transmissions, ...
, a finite impulse response (FIR) filter is a filter whose
impulse response In signal processing and control theory, the impulse response, or impulse response function (IRF), of a dynamic system is its output when presented with a brief input signal, called an impulse (). More generally, an impulse response is the reac ...
(or response to any finite length input) is of ''finite'' duration, because it settles to zero in finite time. This is in contrast to infinite impulse response (IIR) filters, which may have internal feedback and may continue to respond indefinitely (usually decaying). The
impulse response In signal processing and control theory, the impulse response, or impulse response function (IRF), of a dynamic system is its output when presented with a brief input signal, called an impulse (). More generally, an impulse response is the reac ...
(that is, the output in response to a
Kronecker delta In mathematics, the Kronecker delta (named after Leopold Kronecker) is a function of two variables, usually just non-negative integers. The function is 1 if the variables are equal, and 0 otherwise: \delta_ = \begin 0 &\text i \neq j, \\ 1 & ...
input) of an Nth-order discrete-time FIR filter lasts exactly N+1 samples (from first nonzero element through last nonzero element) before it then settles to zero. FIR filters can be discrete-time or
continuous-time In mathematical dynamics, discrete time and continuous time are two alternative frameworks within which variables that evolve over time are modeled. Discrete time Discrete time views values of variables as occurring at distinct, separate "po ...
, and
digital Digital usually refers to something using discrete digits, often binary digits. Technology and computing Hardware *Digital electronics, electronic circuits which operate using digital signals ** Digital camera, which captures and stores digital ...
or analog.


Definition

For a
causal Causality (also referred to as causation, or cause and effect) is influence by which one event, process, state, or object (''a'' ''cause'') contributes to the production of another event, process, state, or object (an ''effect'') where the ca ...
discrete-time FIR filter of order ''N'', each value of the output sequence is a weighted sum of the most recent input values: :\begin y &= b_0 x + b_1 x -1+ \cdots + b_N x -N\\ &= \sum_^N b_i\cdot x -i \end where: * x /math> is the input signal, * y /math> is the output signal, * N is the filter order; an Nth-order filter has N + 1 terms on the right-hand side * b_i is the value of the impulse response at the ''ith instant for 0 \le i \le N of an N^\text-order FIR filter. If the filter is a direct form FIR filter then b_i is also a coefficient of the filter. This computation is also known as discrete
convolution In mathematics (in particular, functional analysis), convolution is a mathematical operation on two functions ( and ) that produces a third function (f*g) that expresses how the shape of one is modified by the other. The term ''convolution'' ...
. The x -i/math> in these terms are commonly referred to as ''s'', based on the structure of a tapped delay line that in many implementations or block diagrams provides the delayed inputs to the multiplication operations. One may speak of a ''5th order/6-tap filter'', for instance. The impulse response of the filter as defined is nonzero over a finite duration. Including zeros, the impulse response is the infinite sequence: : h = \sum_^N b_i\cdot \delta -i= \begin b_n & 0 \le n \le N\\ 0 & \text. \end If an FIR filter is non-causal, the range of nonzero values in its impulse response can start before n=0, with the defining formula appropriately generalized.


Properties

An FIR filter has a number of useful properties which sometimes make it preferable to an infinite impulse response (IIR) filter. FIR filters: *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. *Are inherently
stable A stable is a building in which livestock, especially horses, are kept. It most commonly means a building that is divided into separate stalls for individual animals and livestock. There are many different types of stables in use today; the ...
, 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. *Can easily be designed to be
linear phase In signal processing, linear phase is a property of a filter where the phase response of the filter is a linear function of frequency. The result is that all frequency components of the input signal are shifted in time (usually delayed) by the s ...
by making the coefficient sequence symmetric. This property is sometimes desired for phase-sensitive applications, for example data communications,
seismology Seismology (; from Ancient Greek σεισμός (''seismós'') meaning "earthquake" and -λογία (''-logía'') meaning "study of") is the scientific study of earthquakes and the propagation of elastic waves through the Earth or through other ...
, crossover filters, and mastering. The main disadvantage of FIR filters is that considerably more computation power in a general purpose processor is required compared to an IIR filter with similar sharpness or selectivity, especially when low frequency (relative to the sample rate) cutoffs are needed. However, many digital signal processors provide specialized hardware features to make FIR filters approximately as efficient as IIR for many applications.


Frequency response

The filter's effect on the sequence x /math> is described in the frequency domain by the convolution theorem: :\underbrace_ = \underbrace_ \cdot \underbrace_     and     y = x h \mathcal^\big\, where operators \mathcal and \mathcal^ respectively denote the
discrete-time Fourier transform In mathematics, the discrete-time Fourier transform (DTFT) is a form of Fourier analysis that is applicable to a sequence of values. The DTFT is often used to analyze samples of a continuous function. The term ''discrete-time'' refers to the ...
(DTFT) and its inverse. Therefore, the complex-valued, multiplicative function H(\omega) is the filter's frequency response. It is defined by a
Fourier series A Fourier series () is a summation of harmonically related sinusoidal functions, also known as components or harmonics. The result of the summation is a periodic function whose functional form is determined by the choices of cycle length (or '' ...
: :H_(\omega)\ \triangleq \sum_^ h cdot \left(\right)^ = \sum_^b_n\cdot \left(\right)^, where the added subscript denotes 2π-periodicity. Here \omega represents frequency in normalized units (''radians/sample''). The substitution \omega = 2\pi f, favored by many filter design programs, changes the units of frequency (f) to ''cycles/sample'' and the periodicity to 1. When the x sequence has a known sampling-rate, f_s ''samples/second'', the substitution \omega = 2\pi f/f_s changes the units of frequency (f) to ''cycles/second'' (
hertz The hertz (symbol: Hz) is the unit of frequency in the International System of Units (SI), equivalent to one event (or cycle) per second. The hertz is an SI derived unit whose expression in terms of SI base units is s−1, meaning that o ...
) and the periodicity to f_s. The value \omega = \pi corresponds to a frequency of f = \tfrac ''Hz'' = \tfrac ''cycles/sample'', which is the
Nyquist frequency In signal processing, the Nyquist frequency (or folding frequency), named after Harry Nyquist, is a characteristic of a sampler, which converts a continuous function or signal into a discrete sequence. In units of cycles per second ( Hz), it ...
. H_(\omega) can also be expressed in terms of the Z-transform of the filter impulse response: : \widehat H(z)\ \triangleq \sum_^ h cdot z^. :H_(\omega) = \left. \widehat H(z) \, \_ = \widehat H(e^).


Filter design

An FIR filter is designed by finding the coefficients and filter order that meet certain specifications, which can be in the time domain (e.g. a
matched filter In signal processing, a matched filter is obtained by correlating a known delayed signal, or ''template'', with an unknown signal to detect the presence of the template in the unknown signal. This is equivalent to convolving the unknown signal w ...
) and/or the frequency domain (most common). Matched filters perform a cross-correlation between the input signal and a known pulse shape. The FIR convolution is a cross-correlation between the input signal and a time-reversed copy of the impulse response. Therefore, the matched filter's impulse response is "designed" by sampling the known pulse-shape and using those samples in reverse order as the coefficients of the filter. When a particular frequency response is desired, several different design methods are common: #
Window design method In signal processing, a finite impulse response (FIR) filter is a filter whose impulse response (or response to any finite length input) is of ''finite'' duration, because it settles to zero in finite time. This is in contrast to infinite impulse r ...
# Frequency sampling method # Least MSE (mean square error) method # Parks–McClellan method (also known as the equiripple, optimal, or minimax method). 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 possible to the desired response given that only N + 1 coefficients can be used. This method is particularly easy in practice since at least one text includes a program that takes the desired filter and ''N'', and returns the optimum coefficients. # Equiripple FIR filters can be designed using the DFT algorithms as well.A. E. Cetin, O.N. Gerek, Y. Yardimci, "Equiripple FIR filter design by the FFT algorithm," IEEE Signal Processing Magazine, pp. 60–64, March 1997. The algorithm is iterative in nature. The DFT of an initial filter design is computed using the FFT algorithm (if an initial estimate is not available, h delta can be used). In the Fourier domain, or DFT domain, the frequency response is corrected according to the desired specs, and the inverse DFT is then computed. In the time-domain, only the first N coefficients are kept (the other coefficients are set to zero). The process is then repeated iteratively: the DFT is computed once again, correction applied in the frequency domain and so on. Software packages such as
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementat ...
,
GNU Octave GNU Octave is a high-level programming language primarily intended for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a lan ...
,
Scilab Scilab is a free and open-source, cross-platform numerical computational package and a high-level, numerically oriented programming language. It can be used for signal processing, statistical analysis, image enhancement, fluid dynamics simula ...
, and
SciPy SciPy (pronounced "sigh pie") is a free and open-source Python library used for scientific computing and technical computing. SciPy contains modules for optimization, linear algebra, integration, interpolation, special functions, FFT, ...
provide convenient ways to apply these different methods.


Window design method

In the window design method, one first designs an ideal IIR filter and then truncates the infinite impulse response by multiplying it with a finite length
window function In signal processing and statistics, a window function (also known as an apodization function or tapering function) is a mathematical function that is zero-valued outside of some chosen interval, normally symmetric around the middle of the int ...
. The result is a finite impulse response filter whose frequency response is modified from that of the IIR filter. Multiplying the infinite impulse by the window function in the time domain results in the frequency response of the IIR being convolved with the Fourier transform (or DTFT) of the window function. If the window's main lobe is narrow, the composite frequency response remains close to that of the ideal IIR filter. The ideal response is often rectangular, and the corresponding IIR is a
sinc function In mathematics, physics and engineering, the sinc function, denoted by , has two forms, normalized and unnormalized.. In mathematics, the historical unnormalized sinc function is defined for by \operatornamex = \frac. Alternatively, the u ...
. The result of the frequency domain convolution is that the edges of the rectangle are tapered, and ripples appear in the passband and stopband. Working backward, one can specify the slope (or width) of the tapered region ('' transition band'') and the height of the ripples, and thereby derive the frequency-domain parameters of an appropriate window function. Continuing backward to an impulse response can be done by iterating a filter design program to find the minimum filter order. Another method is to restrict the solution set to the parametric family of Kaiser windows, which provides closed form relationships between the time-domain and frequency domain parameters. In general, that method will not achieve the minimum possible filter order, but it is particularly convenient for automated applications that require dynamic, on-the-fly, filter design. The window design method is also advantageous for creating efficient half-band filters, because the corresponding sinc function is zero at every other sample point (except the center one). The product with the window function does not alter the zeros, so almost half of the coefficients of the final impulse response are zero. An appropriate implementation of the FIR calculations can exploit that property to double the filter's efficiency.


Least mean square error (MSE) method

Goal: :To design FIR filter in the MSE sense, we minimize the mean square error between the filter we obtained and the desired filter. ::\text=f_s^ \int_^ , H(f)-H_d(f), ^2\,df , where f_s\, is sampling frequency, H(f)\, is the spectrum of the filter we obtained, and H_d(f)\, is the spectrum of the desired filter. Method: :Given an ''N''-point FIR filter h , and r = h +k k = \frac. :Step 1: Suppose h even symmetric. Then, the discrete time Fourier transform of r /math> is defined as ::R(F) = e^H(F) = \sum_^k s \cos (2 \pi nF) :Step 2: Calculate mean square error. ::\text=\int_^ , R(F)-H_d(F), ^2\,dF ::Therefore, ::\text= \int_^ \sum_^k s \cos (2 \pi nF) \sum_^k s tau\cos (2 \pi \tau F)\,dF -2\int_^ \sum_^k s \cos (2 \pi nF) H_d\,dF + \int_^ H_d(F)^2\,dF :Step 3: Minimize the mean square error by doing partial derivative of MSE with respect to s /math> :: \frac = 2\sum_^k s tau \int_^ \cos (2 \pi nF) \cos (2 \pi \tau F) \,dF - 2\int_^ H_d(F)^2 \cos (2 \pi nF)\,dF = 0 ::After organization, we have :: s = \int_^ H_d(F)\, dF :: s = \int_^ \cos (2 \pi nF) H_d(F) \,dF, \ \text n \ne 0 :Step 4: Change s back to the presentation of h ::h = s h +n= s 2, h -ns 2, \; for \; n=1,2,3, \ldots, k, \text k = (N-1)/2 and h =0 \text n < 0 \text n \ge N In addition, we can treat the importance of passband and stopband differently according to our needs by adding a weighted function, W(f) Then, the MSE error becomes : \text =\int_^ W(F), R(F)-H_d(F), ^2\,dF


Moving average example

A moving average filter is a very simple FIR filter. It is sometimes called a
boxcar A boxcar is the North American (AAR) term for a railroad car that is enclosed and generally used to carry freight. The boxcar, while not the simplest freight car design, is considered one of the most versatile since it can carry most ...
filter, especially when followed by decimation. The filter coefficients, b_0, \ldots, b_N, are found via the following equation: :b_i=\frac To provide a more specific example, we select the filter order: :N = 2 The impulse response of the resulting filter is: :h = \frac\delta + \frac\delta -1+ \frac\delta -2/math> The block diagram on the right shows the second-order moving-average filter discussed below. The transfer function is: :H(z) = \frac + \fracz^ + \fracz^ = \frac\frac. The next figure shows the corresponding pole–zero diagram. Zero frequency (DC) corresponds to (1, 0), positive frequencies advancing counterclockwise around the circle to the Nyquist frequency at (−1, 0). Two poles are located at the origin, and two zeros are located at z_1 = -\frac + j\frac, z_2 = -\frac - j \frac. The frequency response, in terms of normalized frequency ''ω'', is: : \begin H\left(e^\right) &= \frac + \frace^ + \frace^\\ &= \frace^\left(1+2\cos(\omega)\right). \end The magnitude and phase components of H\left(e^\right) are plotted in the figure. But plots like these can also be generated by doing a
discrete Fourier transform In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a comple ...
(DFT) of the impulse response. And because of symmetry, filter design or viewing software often displays only the , πregion. The magnitude plot indicates that the moving-average filter passes low frequencies with a gain near 1 and attenuates high frequencies, and is thus a crude low-pass filter. The phase plot is linear except for discontinuities at the two frequencies where the magnitude goes to zero. The size of the discontinuities is π, representing a sign reversal. They do not affect the property of linear phase, as illustrated in the final figure.


See also

*
Electronic filter Electronic filters are a type of signal processing filter in the form of electrical circuits. This article covers those filters consisting of lumped electronic components, as opposed to distributed-element filters. That is, using components ...
*
Filter (signal processing) In signal processing, a filter is a device or process that removes some unwanted components or features from a signal. Filtering is a class of signal processing, the defining feature of filters being the complete or partial suppression of some asp ...
* Infinite impulse response (IIR) filter * Z-transform (specifically Linear constant-coefficient difference equation) * FIR transfer function * Filter design * Cascaded integrator–comb filter *
Compact support In mathematics, the support of a real-valued function f is the subset of the function domain containing the elements which are not mapped to zero. If the domain of f is a topological space, then the support of f is instead defined as the smalle ...


Notes

{{notelist-ua


References

Digital signal processing Filter theory