|
|
Line 1: |
Line 1: |
| {{more footnotes|date=December 2012}}
| | That this person who wrote the article is [http://www.guardian.co.uk/search?q=called+Leland called Leland] but it's not those most masucline name around the world. To go to karaoke is the thing he loves most of each of the. He works best as a cashier. His wife and him live on Massachusetts and he is bound to have everything that he calls for there. He's not godd at design but consider want to check our website: http://prometeu.net<br><br> |
|
| |
|
| {{redirect|Filter theory|the theory on mate selection|Filter theory (sociology)}}
| | Check out my web page ... clash of clans cheat ([http://prometeu.net just click the following internet site]) |
| | |
| '''Filter design''' is the process of designing a [[Filter (signal processing)|signal processing filter]] that satisfies a set of requirements, some of which are contradictory. The purpose is to find a realization of the filter that meets each of the requirements to a sufficient degree to make it useful.
| |
| | |
| The filter design process can be described as an optimization problem where each requirement contributes with a term to an error function which should be minimized. Certain parts of the design process can be automated, but normally an experienced electrical engineer is needed to get a good result.
| |
| | |
| == Typical design requirements ==
| |
| | |
| Typical requirements which are considered in the design process are:
| |
| * The filter should have a specific [[frequency response]]
| |
| * The filter should have a specific [[phase shift]] or [[group delay]]
| |
| * The filter should have a specific [[impulse response]]
| |
| * The filter should be [[Causal filter|causal]]
| |
| * The filter should be [[BIBO stability|stable]]
| |
| * The filter should be localized
| |
| * The computational complexity of the filter should be low
| |
| * The filter should be implemented in particular hardware or software
| |
| | |
| === The frequency function ===
| |
| | |
| Typical examples of frequency function are:
| |
| * A [[low-pass filter]] is used to cut unwanted high-frequency signals.
| |
| * A [[high-pass filter]] passes high frequencies fairly well; it is helpful as a filter to cut any unwanted low frequency components.
| |
| * A [[band-pass filter]] passes a limited range of frequencies.
| |
| * A [[band-stop filter]] passes frequencies above and below a certain range. A very narrow band-stop filter is known as a notch filter.
| |
| * A [[differentiator]] has an amplitude response proportional to the frequency.
| |
| * A low-shelf filter passes all frequencies, but increases or reduces frequencies below the shelf frequency by specified amount.
| |
| * A high-shelf filter passes all frequencies, but increases or reduces frequencies above the shelf frequency by specified amount.
| |
| * A peak EQ filter makes a peak or a dip in the frequency response, commonly used in [[Equalization|parametric equalizers]].
| |
| | |
| An important [[parameter]] is the required [[frequency response]].
| |
| In particular, the steepness and complexity of the response curve is a deciding factor for the filter order and feasibility.
| |
| | |
| A first order [[Infinite impulse response|recursive]] filter will only have a single frequency-dependent component. This means that the [[slope]] of the frequency response is limited to 6 [[Decibel|dB]] per [[octave]]. For many purposes, this is not sufficient. To achieve steeper slopes, higher order filters are required.
| |
| | |
| In relation to the desired frequency function, there may also be an accompanying ''weighting'' function which describes, for each frequency, how important it is that the resulting frequency function approximates the desired one. The larger weight, the more important is a close approximation.
| |
| | |
| === Phase and group delay ===
| |
| * An all-pass filter passes through all frequencies unchanged, but changes the phase of the signal. Filters of this type can be used to equalize the group delay of recursive filters. This filter is also used in [[Phaser (effect)|phaser effects]].
| |
| * A [[Hilbert transform]]er is a specific all-pass filter that passes sinusoids with unchanged amplitude but shifts each sinusoid phase by ±90°.
| |
| * A fractional delay filter is an all-pass that has a specified and constant group or phase delay for all frequencies.
| |
| | |
| === The impulse response ===
| |
| | |
| There is a direct correspondence between the filter's frequency function and its impulse response: the former is the [[Fourier transform]] of the latter. That means that any requirement on the frequency function is a requirement on the impulse response, and vice versa.
| |
| | |
| However, in certain applications it may be the filter's impulse response that is explicit and the design process then aims at producing as close an approximation as possible to the requested impulse response given all other requirements.
| |
| | |
| In some cases it may even be relevant to consider a frequency function and impulse response of the filter which are chosen independently from each other. For example, we may want both a specific frequency function of the filter ''and'' that the resulting filter have a small effective width in the signal domain as possible. The latter condition can be realized by considering a very narrow function as the wanted impulse response of the filter even though this function has no relation to the desired frequency function. The goal of the design process is then to realize a filter which tries to meet both these contradicting design goals as much as possible.
| |
| | |
| === Causality ===
| |
| | |
| In order to be implementable, any time-dependent filter (operating in real time) must be [[Causal filter|causal]]: the filter response only depends on the current and past inputs. A standard approach is to leave this requirement until the final step. If the resulting filter is not causal, it can be made causal by introducing an appropriate time-shift (or delay). If the filter is a part of a larger system (which it normally is) these types of delays have to be introduced with care since they affect the operation of the entire system.
| |
| | |
| Filter that do not operate in real time (e.g. for image processing) can be non-causal. This e.g. allows the design of zero delay recursive filter, where the group delay of a causal filter is canceled by its Hermitian non-causal filter.
| |
| | |
| === Stability ===
| |
| | |
| A [[BIBO stability|stable filter]] assures that every limited input signal produces a limited filter response. A filter which does not meet this requirement may in some situations prove useless or even harmful. Certain design approaches can guarantee stability, for example by using only feed-forward circuits such as an FIR filter. On the other hand, filter based on feedback circuits have other advantages and may therefore be preferred, even if this class of filters include unstable filters. In this case, the filters must be carefully designed in order to avoid instability.
| |
| | |
| === Locality ===
| |
| | |
| In certain applications we have to deal with signals which contain components which can be described as local phenomena, for example pulses or steps, which have certain time duration. A consequence of applying a filter to a signal is, in intuitive terms, that the duration of the local phenomena is extended by the width of the filter. This implies that it is sometimes important to keep the width of the filter's impulse response function as short as possible.
| |
| | |
| According to the uncertainty relation of the Fourier transform, the product of the width of the filter's impulse response function and the width of its frequency function must exceed a certain constant. This means that any requirement on the filter's locality also implies a bound on its frequency function's width. Consequently, it may not be possible to simultaneously meet requirements on the locality of the filter's impulse response function as well as on its frequency function. This is a typical example of contradicting requirements.
| |
| | |
| === Computational complexity ===
| |
| | |
| A general desire in any design is that the number of operations (additions and multiplications) needed to compute the filter response is as low as possible. In certain applications, this desire is a strict requirement, for example due to limited computational resources, limited power resources, or limited time. The last limitation is typical in real-time applications.
| |
| | |
| There are several ways in which a filter can have different computational complexity. For example, the order of a filter is more or less proportional to the number of operations. This means that by choosing a low order filter, the computation time can be reduced.
| |
| | |
| For discrete filters the computational complexity is more or less proportional to the number of filter coefficients. If the filter has many coefficients, for example in the case of multidimensional signals such as tomography data, it may be relevant to reduce the number of coefficients by removing those which are sufficiently close to zero. In multirate filters, the number of coefficients by taking advantage of its bandwidth limits, where the input signal is downsampled (e.g. to its critical frequency), and upsampled after filtering.
| |
| | |
| Another issue related to computational complexity is separability, that is, if and how a filter can be written as a convolution of two or more simpler filters. In particular, this issue is of importance for multidimensional filters, e.g., 2D filter which are used in image processing. In this case, a significant reduction in computational complexity can be obtained if the filter can be separated as the convolution of one 1D filter in the horizontal direction and one 1D filter in the vertical direction. A result of the filter design process may, e.g., be to approximate some desired filter as a separable filter or as a sum of separable filters.
| |
| | |
| === Other considerations ===
| |
| | |
| It must also be decided how the filter is going to be implemented:
| |
| * [[Analog filter]]
| |
| * [[Analog sampled filter]]
| |
| * [[Digital filter]]
| |
| * [[Mechanical filter]]
| |
| | |
| ==== Analog filters ====
| |
| | |
| The design of linear analog filters is for the most part covered in the [[linear filter]] section.
| |
| | |
| ==== Digital filters ====
| |
| | |
| [[Digital filter]]s are classified into one of two basic forms, according to how they respond to a [[Kronecker delta|unit impulse]]:
| |
| | |
| *[[Finite impulse response]], or '''FIR''', filters express each output sample as a weighted sum of the last ''N'' input samples, where ''N'' is the order of the filter. FIR filters are normally non-recursive, meaning they do not use feedback and as such are inherently stable. A [[moving average]] filter or [[CIC filter]] are examples of FIR filters that are normally recursive (that use feedback). If the FIR coefficients are symmetrical (often the case), then such a filter is [[linear phase]], so it [[Group delay|delays]] signals of all frequencies equally which is important in many applications. It is also straightforward to avoid overflow in an FIR filter. The main disadvantage is that they may require significantly more [[Instructions per second|processing]] and [[computer memory|memory]] resources than cleverly designed IIR variants. FIR filters are generally easier to design than IIR filters - the [[Parks-McClellan filter design algorithm]] (based on the [[Remez algorithm]]) is one suitable method for designing quite good filters semi-automatically. (See [[#Methodology|Methodology]].)
| |
| | |
| *[[Infinite impulse response]], or '''IIR''', filters are the digital counterpart to analog filters. Such a filter contains internal state, and the output and the next internal state are determined by a [[linear combination]] of the previous inputs and outputs (in other words, they use [[feedback]], which FIR filters normally do not). In theory, the impulse response of such a filter never dies out completely, hence the name IIR, though in practice, this is not true given the finite resolution of computer arithmetic. IIR filters normally require less [[computing]] resources than an FIR filter of similar performance. However, due to the feedback, high order IIR filters may have problems with [[instability]], [[arithmetic overflow]], and [[limit cycle]]s, and require careful design to avoid such pitfalls. Additionally, since the [[Phase (waves)|phase shift]] is inherently a non-linear function of frequency, the time delay through such a filter is frequency-dependent, which can be a problem in many situations. 2nd order IIR filters are often called '[[Digital biquad filter|biquads]]' and a common implementation of higher order filters is to cascade biquads. A useful reference for computing biquad coefficients is the [http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt RBJ Audio EQ Cookbook].
| |
| | |
| ==== Sample rate ====
| |
| | |
| Unless the [[sample rate]] is fixed by some outside constraint, selecting a suitable sample rate is an important design decision. A high rate will require more in terms of computational resources, but less in terms of [[anti-aliasing filter]]s. [[Interference (wave propagation)|Interference]] and [[Beat (acoustics)|beating]] with other signals in the system may also be an issue.
| |
| | |
| ==== Anti-aliasing ====
| |
| | |
| For any digital filter design, it is crucial to analyze and avoid [[aliasing]] effects. Often, this is done by adding analog anti-aliasing filters at the input and output, thus avoiding any frequency component above the [[Nyquist frequency]]. The complexity (i.e., steepness) of such filters depends on the required [[signal to noise ratio]] and the ratio between the [[sampling rate]] and the highest frequency of the signal.
| |
| | |
| == Theoretical basis ==
| |
| | |
| Parts of the design problem relate to the fact that certain requirements are described in the frequency domain while others are expressed in the signal domain and that these may contradict. For example, it is not possible to obtain a filter which has both an arbitrary impulse response and arbitrary frequency function. Other effects which refer to relations between the signal and frequency domain are
| |
| | |
| * The uncertainty principle between the signal and frequency domains
| |
| * The variance extension theorem
| |
| * The asymptotic behaviour of one domain versus discontinuities in the other
| |
| | |
| === The uncertainty principle ===
| |
| | |
| As stated in the [[uncertainty principle]], the product of the width of the frequency function and the width of the impulse response cannot be smaller than a specific constant. This implies that if a specific frequency function is requested, corresponding to a specific frequency width, the minimum width of the filter in the signal domain is set. Vice versa, if the maximum width of the response is given, this determines the smallest possible width in the frequency.
| |
| This is a typical example of contradictory requirements where the filter design process may try to find a useful compromise.
| |
| | |
| === The variance extension theorem ===
| |
| | |
| Let <math>\sigma^{2}_{s}</math> be the variance of the input signal and let <math>\sigma^{2}_{f}</math> be the variance of the filter. The variance of the filter response, <math>\sigma^{2}_{r}</math>, is then given by
| |
| | |
| : <math>\sigma^{2}_{r}</math> = <math>\sigma^{2}_{s}</math> + <math>\sigma^{2}_{f}</math>
| |
| | |
| This means that <math>\sigma_{r} > \sigma_{f}</math> and implies that the localization of various features such as pulses or steps in the filter response is limited by the filter width in the signal domain. If a precise localization is requested, we need a filter of small width in the signal domain and, via the uncertainty principle, its width in the frequency domain cannot be arbitrary small.
| |
| | |
| === Discontinuities versus asymptotic behaviour ===
| |
| | |
| Let ''f(t)'' be a function and let <math>F(\omega)</math> be its Fourier transform.
| |
| There is a theorem which states that if the first derivative of ''F'' which is discontinuous has order <math>n \geq 0</math>, then ''f'' has an asymptotic decay like <math>t^{-n-1}</math>.
| |
| | |
| A consequence of this theorem is that the frequency function of a filter should be as smooth as possible to allow its impulse response to have a fast decay, and thereby a short width.
| |
| | |
| == Methodology ==
| |
| One common method for designing FIR filters is the [[Parks-McClellan filter design algorithm]], based on the [[Remez exchange algorithm]]. 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'' 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'' coefficients. This method is particularly easy in practice and at least one text<ref>Rabiner, Lawrence R., and Gold, Bernard, 1975: Theory and Application of Digital Signal Processing (Englewood Cliffs, New Jersey: Prentice-Hall, Inc.) ISBN 0-13-914101-4</ref> includes a program that takes the desired filter and ''N'' and returns the optimum coefficients. One possible drawback to filters designed this way is that they contain many small ripples in the passband(s), since such a filter minimizes the peak error.
| |
| | |
| Another method to finding a discrete FIR filter is ''filter optimization'' described in Knutsson et al., which minimizes the integral of the square of the error, instead of its maximum value. In its basic form this approach requires that an ideal frequency function of the filter <math>F_{I}(\omega)</math> is specified together with a frequency weighting function <math>W(\omega)</math> and set of coordinates <math>x_{k}</math> in the signal domain where the filter coefficients are located.
| |
| | |
| An error function <math>\varepsilon</math> is defined as
| |
| | |
| :<math>\varepsilon = \| W \cdot (F_{I} - \mathcal{F} \{ f \}) \|^{2}</math>
| |
| | |
| where <math>f(x)</math> is the discrete filter and <math>\mathcal{F}</math> is the [[discrete-time Fourier transform]] defined on the specified set of coordinates. The norm used here is, formally, the usual norm on <math>L^{2}</math> spaces. This means that <math>\varepsilon</math> measures the deviation between the requested frequency function of the filter, <math>F_{I}</math>, and the actual frequency function of the realized filter, <math>\mathcal{F} \{ f \}</math>. However, the deviation is also subject to the weighting function <math>W</math> before the error function is computed.
| |
| | |
| Once the error function is established, the optimal filter is given by the coefficients <math>f(x)</math> which minimize <math>\varepsilon</math>. This can be done by solving the corresponding least squares problem. In practice, the <math>L^{2}</math> norm has to be approximated by means of a suitable sum over discrete points in the frequency domain. In general, however, these points should be significantly more than the number of coefficients in the signal domain to obtain a useful approximation.
| |
| | |
| === Simultaneous optimization in both domains ===
| |
| | |
| The previous method can be extended to include an additional error term related to a desired filter impulse response in the signal domain, with a corresponding weighting function. The ideal impulse response can be chosen independently of the ideal frequency function and is in practice used to limit the effective width and to remove ringing effects of the resulting filter in the signal domain. This is done by choosing a narrow ideal filter impulse response function, e.g., an impulse, and a weighting function which grows fast with the distance from the origin, e.g., the distance squared. The optimal filter can still be calculated by solving a simple least squares problem and the resulting filter is then a "compromise" which has a total optimal fit to the ideal functions in both domains. An important parameter is the relative strength of the two weighting functions which determines in which domain it is more important to have a good fit relative to the ideal function.
| |
| | |
| == See also ==
| |
| *[[Digital filter]]
| |
| *[[Prototype filter]]
| |
| *[[Finite impulse response#Filter design]]
| |
| | |
| == References ==
| |
| | |
| {{Reflist}}
| |
| | |
| *{{cite book|
| |
| author=A. Antoniou|
| |
| title=Digital Filters: Analysis, Design, and Applications|
| |
| edition=2|
| |
| year=1993|
| |
| isbn=0-07-002117-1|
| |
| publisher=McGraw-Hill, New York, NY}}
| |
| *{{cite book|
| |
| author=A. Antoniou|
| |
| title=Digital Signal Processing: Signals, Systems, and Filters|
| |
| year=2006|
| |
| isbn=0-07-145424-1|
| |
| doi=10.1036/0071454241|
| |
| publisher=McGraw-Hill, New York, NY}}
| |
| * {{cite journal|
| |
| author=S.W.A. Bergen and A. Antoniou|
| |
| title=Design of Nonrecursive Digital Filters Using the Ultraspherical Window Function|
| |
| journal=EURASIP Journal on Applied Signal Processing|
| |
| year=2005|
| |
| volume=2005|
| |
| issue=12|
| |
| page=1910| | |
| doi=10.1155/ASP.2005.1910
| |
| }}
| |
| * {{cite journal|
| |
| author=A.G. Deczky|
| |
| title=Synthesis of Recursive Digital Filters Using the Minimum p-Error Criterion|
| |
| journal=IEEE Trans. Audio Electroacoust|
| |
| volume=AU-20|
| |
| issue=4|
| |
| pages=257–263|date=October 1972|
| |
| doi=10.1109/TAU.1972.1162392
| |
| |url=http://ieeexplore.ieee.org/search/wrapper.jsp?arnumber=1162392}}
| |
| * {{cite conference|
| |
| author=J.K. Kaiser|
| |
| title=Nonrecursive Digital Filter Design Using the ''I''<sub>0</sub>-sinh Window Function|
| |
| booktitle=Proc. 1974 IEEE Int. Symp. Circuit Theory (ISCAS74)|
| |
| pages=20–23|
| |
| location=San Francisco, CA|
| |
| year=1974}}
| |
| * {{cite conference|
| |
| author=H. Knutsson, M. Andersson and J. Wiklund|
| |
| title=Advanced Filter Design|
| |
| booktitle=Proc. Scandinavian Symposium on Image Analysis, Kangerlussuaq, Greenland|date=June 1999}}
| |
| *{{cite book|
| |
| author=S.K. Mitra|
| |
| title=Digital Signal Processing: A Computer-Based Approach|
| |
| year=1998|
| |
| isbn=0-07-286546-6|
| |
| publisher=McGraw-Hill, New York, NY}}
| |
| *{{cite book|
| |
| author=A.V. Oppenheim and R.W. Schafer and J.R. Buck|
| |
| title=Discrete-Time Signal Processing|
| |
| year=1999|
| |
| isbn=0-13-754920-2|
| |
| publisher=Prentice-Hall, Upper Saddle River, NJ}}
| |
| * {{cite journal|
| |
| author=T.W. Parks and J.H. McClellan|
| |
| title=Chebyshev Approximation for Nonrecursive Digital Filters with Linear Phase|
| |
| journal=IEEE Trans. Circuit Theory|
| |
| volume=CT-19|
| |
| issue=2|
| |
| pages=189–194|date=March 1972|
| |
| doi=10.1109/TCT.1972.1083419
| |
| |url=http://ieeexplore.ieee.org/search/wrapper.jsp?arnumber=1083419}}
| |
| * {{cite journal|
| |
| author=L.R. Rabiner, J.H. McClellan, and T.W. Parks|
| |
| title=FIR Digital Filter Design Techniques Using Weighted Chebyshev Approximation|
| |
| journal=Proc. IEEE|
| |
| volume=63|
| |
| issue=4|
| |
| pages=595–610|date=April 1975|
| |
| doi=10.1109/PROC.1975.9794
| |
| |url=http://ieeexplore.ieee.org/search/wrapper.jsp?arnumber=1451724}}
| |
| | |
| == External links ==
| |
| *[http://www.circuitsage.com/filter.html An extensive list of filter design articles and software at Circuit Sage]
| |
| *[http://www.dspguru.com/dsp/links/digital-filter-design-software A list of digital filter design software at dspGuru]
| |
| *[http://www.maxim-ic.com/appnotes.cfm/appnote_number/1795/CMP/AN-1 Analog Filter Design Demystified]
| |
| *[http://www.student.oulu.fi/~oniemita/dsp/dspstuff.txt Yehar's digital sound processing tutorial for the braindead!] This paper explains simply (between others topics) filters design theory and give some examples
| |
| | |
| [[Category:Digital signal processing]]
| |
| [[Category:Filter theory]]
| |
| [[Category:Signal processing filter]]
| |