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
Digital filter
(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!
==Characterization== A digital filter is characterized by its [[transfer function]], or equivalently, its [[difference equation]]. Mathematical analysis of the transfer function can describe how it will respond to any input. As such, designing a filter consists of developing specifications appropriate to the problem (for example, a second-order low-pass filter with a specific cut-off frequency), and then producing a transfer function that meets the specifications. The [[transfer function]] for a linear, time-invariant, digital filter can be expressed as a transfer function in the [[Z-transform|''Z''-domain]]; if it is causal, then it has the form:<ref>{{cite web |last1=Smith |first1=Julius O. |title=Introduction to digital filters |url=https://www.dsprelated.com/freebooks/filters/ |website=DSPRelated.com |publisher=The Related Media Group |access-date=13 July 2020}}</ref> :<math>H(z) = \frac{B(z)}{A(z)} = \frac{{b_{0}+b_{1}z^{-1}+b_{2}z^{-2} + \cdots + b_{N}z^{-N}}}{{1+a_{1}z^{-1}+a_{2}z^{-2} + \cdots +a_{M}z^{-M}}}</math> where the order of the filter is the greater of ''N'' or ''M''. See [[Z-transform#Linear constant-coefficient difference equation|''Z''-transform's LCCD equation]] for further discussion of this [[transfer function]]. This is the form for a [[recursive filter]], which typically leads to an [[infinite impulse response]] (IIR) behaviour, but if the [[denominator]] is made equal to [[1 (number)|unity]], i.e. no feedback, then this becomes a [[finite impulse response]] (FIR) filter. ===Analysis techniques=== A variety of mathematical techniques may be employed to analyze the behavior of a given digital filter. Many of these analysis techniques may also be employed in designs, and often form the basis of a filter specification. Typically, one characterizes filters by calculating how they will respond to a simple input such as an impulse. One can then extend this information to compute the filter's response to more complex signals. ====Impulse response==== The [[impulse response]], often denoted <math>h[k]</math> or <math>h_k</math>, is a measurement of how a filter will respond to the [[Kronecker delta]] function.<ref>{{cite web |title=Lab.4&5. Introduction to FIR Filters |url=http://www.just.edu.jo/~hazem-ot/Lab.4&5.%20FIR%20Filters.pdf |archive-url=https://ghostarchive.org/archive/20221009/http://www.just.edu.jo/~hazem-ot/Lab.4&5.%20FIR%20Filters.pdf |archive-date=2022-10-09 |url-status=live |publisher=Jordan University of Science and Technology-Faculty of Engineering |access-date=13 July 2020}}</ref> For example, given a difference equation, one would set <math>x_0 = 1</math> and <math>x_k = 0</math> for <math>k \ne 0</math> and evaluate. The impulse response is a characterization of the filter's behavior. Digital filters are typically considered in two categories: [[infinite impulse response]] (IIR) and [[finite impulse response]] (FIR). In the case of linear time-invariant FIR filters, the impulse response is exactly equal to the sequence of filter coefficients, and thus: :<math>\ y_n= \sum_{k=0}^{N} b_{k} x_{n-k} =\sum_{k=0}^{N} h_{k} x_{n-k}</math> IIR filters on the other hand are recursive, with the output depending on both current and previous inputs as well as previous outputs. The general form of an IIR filter is thus: :<math>\ \sum_{m=0}^{M} a_{m}y_{n-m} = \sum_{k=0}^{N} b_{k} x_{n-k}</math> Plotting the impulse response reveals how a filter responds to a sudden, momentary disturbance. An IIR filter is always recursive. While it is possible for a recursive filter to have a finite impulse response, a non-recursive filter always has a finite impulse response. An example is the moving average (MA) filter, which can be implemented both recursively{{citation needed|date=May 2019}} and non recursively. ====Difference equation ==== In [[discrete-time]] systems, the digital filter is often implemented by converting the [[transfer function]] to a [[Z-transform#Linear constant-coefficient difference equation|linear constant-coefficient difference equation]] (LCCD) via the [[Z-transform]]. The discrete [[frequency-domain]] transfer function is written as the ratio of two polynomials. For example: :<math>H(z) = \frac{(z+1)^2} {(z-\frac{1}{2}) (z+\frac{3}{4})}</math> This is expanded: :<math>H(z) = \frac{z^2+ 2z +1} {z^2 +\frac{1}{4} z - \frac{3}{8}}</math> and to make the corresponding filter [[causal filter|causal]], the numerator and denominator are divided by the highest order of <math>z</math>: :<math> H(z) = \frac{1 + 2z^{-1} +z^{-2}} {1 +\frac{1}{4} z^{-1} - \frac{3}{8} z^{-2}} = \frac{Y(z)}{X(z)} </math> The coefficients of the denominator, <math>a_{k}</math>, are the 'feed-backward' coefficients and the coefficients of the numerator are the 'feed-forward' coefficients, <math>b_{k}</math>. The resultant [[difference equation|linear difference equation]] is: :<math> y[n] = -\sum_{k=1}^{M} a_{k} y[n-k] + \sum_{k=0}^{N} b_{k} x[n-k] </math> or, for the example above: :<math> \frac{Y(z)}{X(z)} = \frac{1 + 2z^{-1} +z^{-2}} {1 +\frac{1}{4} z^{-1} - \frac{3}{8} z^{-2}} </math> rearranging terms: :<math> \Rightarrow (1 +\frac{1}{4} z^{-1} - \frac{3}{8} z^{-2}) Y(z) = (1 + 2z^{-1} +z^{-2}) X(z) </math> then by taking the inverse ''z''-transform: :<math> \Rightarrow y[n] + \frac{1}{4} y[n-1] - \frac{3}{8} y[n-2] = x[n] + 2x[n-1] + x[n-2] </math> and finally, by solving for <math>y[n]</math>: :<math> y[n] = - \frac{1}{4} y[n-1] + \frac{3}{8} y[n-2] + x[n] + 2x[n-1] + x[n-2] </math> This equation shows how to compute the next output sample, <math>y[n]</math>, in terms of the past outputs, <math>y[n-p]</math>, the present input, <math>x[n]</math>, and the past inputs, <math>x[n-p]</math>. Applying the filter to an input in this form is equivalent to a Direct Form I or II (see below) realization, depending on the exact order of evaluation. In plain terms, for example, as used by a computer programmer implementing the above equation in code, it can be described as follows: <math>y</math> = the output, or filtered value<br /> <math>x</math> = the input, or incoming raw value<br /> <math>n</math> = the sample number, iteration number, or time period number and therefore: <math>y[n]</math> = the current filtered (output) value<br /> <math>y[n-1]</math> = the last filtered (output) value<br /> <math>y[n-2]</math> = the 2nd-to-last filtered (output) value<br /> <math>x[n]</math> = the current raw input value<br /> <math>x[n-1]</math> = the last raw input value<br /> <math>x[n-2]</math> = the 2nd-to-last raw input value
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
Digital filter
(section)
Add topic