 Digital filter

In electronics, computer science and mathematics, a digital filter is a system that performs mathematical operations on a sampled, discretetime signal to reduce or enhance certain aspects of that signal. This is in contrast to the other major type of electronic filter, the analog filter, which is an electronic circuit operating on continuoustime analog signals. An analog signal may be processed by a digital filter by first being digitized and represented as a sequence of numbers, then manipulated mathematically, and then reconstructed as a new analog signal (see digital signal processing). In an analog filter, the input signal is "directly" manipulated by the circuit.
A digital filter system usually consists of an analogtodigital converter to sample the input signal, followed by a microprocessor and some peripheral components such as memory to store data and filter coefficients etc. Finally a digitaltoanalog converter to complete the output stage. Program Instructions (software) running on the microprocessor implement the digital filter by performing the necessary mathematical operations on the numbers received from the ADC. In some high performance applications, an FPGA or ASIC is used instead of a general purpose microprocessor, or a specialized DSP with specific paralleled architecture for expediting operations such as filtering.
Digital filters may be more expensive than an equivalent analog filter due to their increased complexity, but they make practical many designs that are impractical or impossible as analog filters. Since digital filters use a sampling process and discretetime processing, they experience latency (the difference in time between the input and the response), which is almost irrelevant in analog filters.
Digital filters are commonplace and an essential element of everyday electronics such as radios, cellphones, and stereo receivers.
Contents
Characterization of digital filters
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 secondorder low pass filter with a specific cutoff frequency), and then producing a transfer function which meets the specifications.
The transfer function for a linear, timeinvariant, digital filter can be expressed as a transfer function in the Zdomain; if it is causal, then it has the form:
where the order of the filter is the greater of N or M. See Ztransform's LCCD equation for further discussion of this transfer function.
This is the form for a recursive filter with both the inputs (Numerator) and outputs (Denominator), which typically leads to an IIR infinite impulse response behaviour, but if the denominator is made equal to unity i.e. no feedback, then this becomes an FIR or finite impulse response filter.
Analysis techniques
A variety of mathematical techniques may be employed to analyze the behaviour 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 analyzes filters by calculating how the filter will respond to a simple input such as an impulse response. One can then extend this information to visualize the filter's response to more complex signals. Riemann spheres have been used, together with digital video, for this purpose.
Impulse response
The impulse response, often denoted h[k] or h_{k}, is a measurement of how a filter will respond to the Kronecker delta function. For example, given a difference equation, one would set x_{0} = 1 and x_{k} = 0 for and evaluate. The impulse response is a characterization of the filter's behaviour. Digital filters are typically considered in two categories: infinite impulse response (IIR) and finite impulse response (FIR). In the case of linear timeinvariant FIR filters, the impulse response is exactly equal to the sequence of filter coefficients:
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 the an IIR filter is thus:
Plotting the impulse response will reveal how a filter will respond to a sudden, momentary disturbance.
Difference equation
In discretetime systems, the digital filter is often implemented by converting the transfer function to a linear constantcoefficient difference equation (LCCD) via the Ztransform. The discrete frequencydomain transfer function is written as the ratio of two polynomials. For example:
This is expanded:
and divided by the highest order of z:
The coefficients of the denominator, a_{k}, are the 'feedbackward' coefficients and the coefficients of the numerator are the 'feedforward' coefficients, b_{k}. The resultant linear difference equation is:
or, for the example above:
rearranging terms:
then by taking the inverse ztransform:
and finally, by solving for y[n]:
This equation shows how to compute the next output sample, y[n], in terms of the past outputs, y[n − p], the present input, x[n], and the past inputs, x[n − p]. Applying the filter to an input in this form is equivalent to a Direct Form I or II realization, depending on the exact order of evaluation.
Filter design
Main article: Filter designThe design of digital filters is a deceptively complex topic.^{[1]} Although filters are easily understood and calculated, the practical challenges of their design and implementation are significant and are the subject of much advanced research.
There are two categories of digital filter: the recursive filter and the nonrecursive filter. These are often referred to as infinite impulse response (IIR) filters and finite impulse response (FIR) filters, respectively.^{[2]}
Filter realization
After a filter is designed, it must be realized by developing a signal flow diagram that describes the filter in terms of operations on sample sequences.
A given transfer function may be realized in many ways. Consider how a simple expression such as ax + bx + c could be evaluated – one could also compute the equivalent x(a + b) + c. In the same way, all realizations may be seen as "factorizations" of the same transfer function, but different realizations will have different numerical properties. Specifically, some realizations are more efficient in terms of the number of operations or storage elements required for their implementation, and others provide advantages such as improved numerical stability and reduced roundoff error. Some structures are better for fixedpoint arithmetic and others may be better for floatingpoint arithmetic.
Direct Form I
A straightforward approach for IIR filter realization is Direct Form I, where the difference equation is evaluated directly. This form is practical for small filters, but may be inefficient and impractical (numerically unstable) for complex designs.^{[3]} In general, this form requires 2N delay elements (for both input and output signals) for a filter of order N.
Direct Form II
The alternate Direct Form II only needs N delay units, where N is the order of the filter – potentially half as much as Direct Form I. This structure is obtained by reversing the order of the numerator and denominator sections of Direct Form I, since they are in fact two linear systems, and the commutativity property applies. Then, one will notice that there are two columns of delays (z ^{− 1}) that tap off the center net, and these can be combined since they are redundant, yielding the implementation as shown below.
The disadvantage is that Direct Form II increases the possibility of arithmetic overflow for filters of high Q or resonance.^{[4]} It has been shown that as Q increases, the roundoff noise of both direct form topologies increases without bounds.^{[5]} This is because, conceptually, the signal is first passed through an allpole filter (which normally boosts gain at the resonant frequencies) before the result of that is saturated, then passed through an allzero filter (which often attenuates much of what the allpole half amplifies).
Cascaded secondorder sections
A common strategy is to realize a higherorder (greater than 2) digital filter as a cascaded series of secondorder "biquadratric" (or "biquad") sections^{[6]} (see digital biquad filter). Advantages of this strategy is that the coefficient range is limited. Cascading direct form II sections result in N delay elements for filter order of N. Cascading direct form I sections result in N+2 delay elements since the delay elements of the input of any section (except the first section) are a redundant with the delay elements of the output of the preceding section.
Other Forms
Other forms include:
 Direct Form I and II transpose
 Series/cascade^{[7]}
 Parallel^{[7]}
 Ladder form^{[7]}
 Lattice form^{[7]}
 Coupled normal form
 Multifeedback
 Analoginspired forms such as Sallenkey and state variable filters
 Systolic arrays
Comparison of analog and digital filters
Digital filters are not subject to the component nonlinearities that greatly complicate the design of analog filters. Analog filters consist of imperfect electronic components, whose values are specified to a limit tolerance (e.g. resistor values often have a tolerance of +/ 5%) and which may also change with temperature and drift with time. As the order of an analog filter increases, and thus its component count, the effect of variable component errors is greatly magnified. In digital filters, the coefficient values are stored in computer memory, making them far more stable and predictable.^{[8]}
Because the coefficients of digital filters are definite, they can be used to achieve much more complex and selective designs – specifically with digital filters, one can achieve a lower passband ripple, faster transition, and higher stopband attenuation than is practical with analog filters. Even if the design could be achieved using analog filters, the engineering cost of designing an equivalent digital filter would likely be much lower. Furthermore, one can readily modify the coefficients of a digital filter to make an adaptive filter or a usercontrollable parametric filter. While these techniques are possible in an analog filter, they are again considerably more difficult.
Digital filters can be used in the design of finite impulse response filters. Analog filters do not have the same capability, because finite impulse response filters require delay elements.
Digital filters rely less on analog circuitry, potentially allowing for a better signaltonoise ratio. A digital filter will introduce noise to a signal during analog low pass filtering, analog to digital conversion, digital to analog conversion and may introduce digital noise due to quantization. With analog filters, every component is a source of thermal noise (such as Johnson noise), so as the filter complexity grows, so does the noise.
However, digital filters do introduce a higher fundamental latency to the system. In an analog filter, latency is often negligible; strictly speaking it is the time for an electrical signal to propagate through the filter circuit. In digital filters, latency is a function of the number of delay elements in the system.
Digital filters also tend to be more limited in bandwidth than analog filters. High bandwidth digital filters require expensive ADC/DACs and fast computer hardware for processing.
In very simple cases, it is more cost effective to use an analog filter. Introducing a digital filter requires considerable overhead circuitry, as previously discussed, including two low pass analog filters.
Types of digital filters
Many digital filters are based on the Fast Fourier transform, a mathematical algorithm that quickly extracts the frequency spectrum of a signal, allowing the spectrum to be manipulated (such as to create bandpass filters) before converting the modified spectrum back into a timeseries signal.
Another form of a digital filter is that of a statespace model. A well used statespace filter is the Kalman filter published by Rudolf Kalman in 1960.
See also
 Bessel filter
 Butterworth filter
 Elliptical filter (Cauer filter)
 LinkwitzRiley filter
 Chebyshev filter
 Ladder filter
 Sample (signal)
 Electronic filter
 Filter design
 Biquad filter
 Highpass filter, Lowpass filter
 Infinite impulse response, Finite impulse response
 Bilinear transform
References
General
 A. Antoniou, Digital Filters: Analysis, Design, and Applications, New York, NY: McGrawHill, 1993.
 J. O. Smith III, Introduction to Digital Filters with Audio Applications, Center for Computer Research in Music and Acoustics (CCRMA), Stanford University, September 2007 Edition.
 S.K. Mitra, Digital Signal Processing: A ComputerBased Approach, New York, NY: McGrawHill, 1998.
 A.V. Oppenheim and R.W. Schafer, DiscreteTime Signal Processing, Upper Saddle River, NJ: PrenticeHall, 1999.
 J.F. Kaiser, Nonrecursive Digital Filter Design Using the Iosinh Window Function, Proc. 1974 IEEE Int. Symp. Circuit Theory, pp. 20–23, 1974.
 S.W.A. Bergen and A. Antoniou, Design of Nonrecursive Digital Filters Using the Ultraspherical Window Function, EURASIP Journal on Applied Signal Processing, vol. 2005, no. 12, pp. 1910–1922, 2005.
 T.W. Parks and J.H. McClellan, Chebyshev Approximation for Nonrecursive Digital Filters with Linear Phase, IEEE Trans. Circuit Theory, vol. CT19, pp. 189–194, Mar. 1972.
 L. R. Rabiner, J.H. McClellan, and T.W. Parks, FIR Digital Filter Design Techniques Using Weighted Chebyshev Approximation, Proc. IEEE, vol. 63, pp. 595–610, Apr. 1975.
 A.G. Deczky, Synthesis of Recursive Digital Filters Using the Minimum pError Criterion, IEEE Trans. Audio Electroacoust., vol. AU20, pp. 257–263, Oct. 1972.
Cited
 ^ M. E. Valdez, Digital Filters, 2001.
 ^ A. Antoniou, chapter 1
 ^ J. O. Smith III, Direct Form I
 ^ J. O. Smith III, Direct Form II
 ^ L. B. Jackson, "On the Interaction of Roundoff Noise and Dynamic Range in Digital Filters," Bell Sys. Tech. J., vol. 49 (1970 Feb.), reprinted in Digital Signal Process, L. R. Rabiner and C. M. Rader, Eds. (IEEE Press, New York, 1972).
 ^ J. O. Smith III, Series Second Order Sections
 ^ ^{a} ^{b} ^{c} ^{d} A. Antoniou
 ^ http://www.dspguide.com/ch21/1.htm
External links
 WinFilter – Free filter design software
 Filtplot – Free customizable digital filter design software built with python and boost (WinXP/Ubuntu 6.10/RHEL4). Also with interactive web interface.
 DISPRO – Free filter design software
 Java demonstration of digital filters
 IIR Explorer educational software
 Introduction to Filtering
 Introduction to Digital Filters
 Publicly available, very comprehensive lecture notes on Digital Linear Filtering (see bottom of the page)
Categories: Digital signal processing
 Synthesiser modules
 Signal processing filter
Wikimedia Foundation. 2010.