Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Filter design
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Typical design requirements == Typical requirements which may be considered in the design process are: * [[Frequency response]] * [[Phase shift]] or [[group delay]] * [[impulse response]] * [[Causal filter]] required? * [[BIBO stability|Stable filter]] required? * Finite (in duration) impulse response required? * Computational complexity * Technology === The frequency function === The required [[frequency response]] is an important [[parameter]]. The steepness and complexity of the response curve determines 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. 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. * An [[all-pass filter]] passes all frequencies equally in gain. Only the phase shift is changed, which also affects the [[Group delay and phase delay|group delay.]] * 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 (audio)|parametric equalizers]]. === Phase and group delay === {{Main|Group delay and phase 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 [[Digital delay line|fractional delay filter]] is an all-pass that has a specified and constant group or phase delay for all frequencies. === The impulse response === {{Main|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. An example is for [[high-resolution audio]] in which the frequency response (magnitude and phase) for [[steady state]] signals (sum of sinusoids) is the primary filter requirement, while an unconstrained impulse response may cause unexpected degradation due to time spreading of [[Transient (acoustics)|transient]] signals.<ref>{{cite web|last1=Story|first1=Mike|title=A Suggested Explanation For (Some Of) The Audible Differences Between High Sample Rate And Conventional Sample Rate Audio Material |date=September 1997|url=http://sdg-master.com:80/lesestoff/aes97ny.pdf |publisher=dCS Ltd|archive-date=28 November 2009|archive-url=https://web.archive.org/web/20091128021651/http://sdg-master.com:80/lesestoff/aes97ny.pdf|url-status=live}}</ref><ref>{{cite web|last1=Robjohns|first1=Hugh|title= MQA Time-domain Accuracy & Digital Audio Quality|url= https://www.soundonsound.com/techniques/mqa-time-domain-accuracy-digital-audio-quality|website=soundonsound.com|date=August 2016|publisher= Sound On Sound|archive-date=10 March 2023|archive-url= https://web.archive.org/web/20230310175409/https://www.soundonsound.com/techniques/mqa-time-domain-accuracy-digital-audio-quality|url-status=live}}</ref> === Causality === Any filter operating in real time (the filter response only depends on the current and past inputs) must be [[Causal filter|causal]]. If the design process yields a noncausal filter, the resulting filter can be made causal by introducing an appropriate time-shift (or delay). Filters that do not operate in real time (e.g. for image processing) can be non-causal. Noncausal filters may be designed to have zero delay. === 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, filters based on feedback circuits have other advantages and may therefore be preferred, even if this class of filters includes 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 [https://www.w3.org/TR/audio-eq-cookbook/ 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.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Filter design
(section)
Add topic