Appendix F. Digital Filter
Terminology
The first step in becoming familiar with digital
filters is to learn to speak the language used in the filter
business. Fortunately, the vocabulary of digital filters
corresponds very well to the mother tongue used for continuous
(analog) filters—so we don't have to unlearn anything that we
already know. This appendix is an introduction to the terminology
of digital filters.
Allpass filter— an IIR filter
whose magnitude response is unity over its entire frequency range,
but whose phase response is variable. Allpass filters are typically
appended in a cascade arrangement following a standard IIR filter,
H_{1}(z), as shown in Figure F1.
Figure F1. Typical use of an allpass
filter.
An allpass filter, H_{ap}(z), can be designed so that its phase
response compensates for, or equalizes, the nonlinear phase response
of an original IIR filter [1–3].
Thus, the phase response of the combined filter, Hcombined (z), is more linear than the original
H_{1}(z), and this is particularly desirable
in communications systems. In this context, an allpass filter is
sometimes called a phase
equalizer.
Attenuation— an amplitude loss,
usually measured in dB, incurred by a signal after passing through
a digital filter. Filter attenuation is the ratio, at a given
frequency, of the signal amplitude at the output of the filter
divided by the signal amplitude at the input of the filter, defined
as
For a given frequency, if the output amplitude
of the filter is smaller than the input amplitude, the ratio in Eq. (F1) is less than one,
and the attenuation is a negative number.
Band reject filter— a filter that
rejects (attenuates) one frequency band and passes both a lower and
a higher frequency band. Figure F2(a) depicts the frequency response
of an ideal band reject filter. This filter type is sometimes
called a notch filter.
Bandpass filter— a filter, as
shown in Figure F2(b),
that passes one frequency band and attenuates frequencies above and
below that band.
Bandwidth— the frequency width of
the passband of a filter. For a lowpass filter, the bandwidth is
equal to the cutoff frequency. For a bandpass filter, the bandwidth
is typically defined as the frequency difference between the upper
and lower 3 dB points.
Bessel function— a mathematical
function used to produce the most linear phase response of all IIR
filters with no consideration of the frequency magnitude response.
Specifically, filter designs based on Bessel functions have
maximally constant group delay.
Figure F2. Filter symbols and frequency
responses: (a) band reject filter; (b) bandpass filter.
Butterworth function— a
mathematical function used to produce maximally flat filter
magnitude responses with no consideration of phase linearity or
group delay variations. Filter designs based on a Butterworth
function have no amplitude ripple in either the passband or the
stopband. Unfortunately, for a given filter order, Butterworth
designs have the widest transition region of the most popular
filter design functions.
Cascaded filters— a filtering
system where multiple individual
filters are connected in series; that is, the output of one filter
drives the input of the following filter as illustrated in Figures F1 and 637(a).
Center frequency (f_{o})— the frequency
lying at the midpoint of a bandpass filter. Figure F2(b) shows the _{o} center frequency of a bandpass
filter.
Chebyshev function— a
mathematical function used to produce passband or stopband ripples
constrained within fixed bounds. There are families of Chebyshev
functions based on the amount of ripple, such as 1 dB, 2 dB, and 3
dB of ripple. Chebyshev filters can be designed to have a frequency
response with ripples in the passband and flat passbands (Chebyshev
Type I), or flat passbands and ripples in the stopband (Chebyshev
Type II). Chebyshev filters cannot have ripples in both the
passband and the stopband. Digital filters based upon Chebyshev
functions have steeper transition region rolloff but more
nonlinearphase response characteristics than, say, Butterworth
filters.
Cutoff frequency— the highest
passband frequency for lowpass filters (and the lower passband
frequency for highpass filters) where the magnitude response is
within the peakpeak passband ripple region. Figure F3 illustrates the _{c} cutoff frequency of a lowpass
filter.
Figure F3. A lowpass digital filter
frequency response. The stopband relative amplitude is –20
dB.
Decibels (dB)— a unit of
attenuation, or gain, used to express the relative voltage or power
between two signals. For filters, we use decibels to indicate
cutoff frequencies (–3 dB) and stopband signal levels
(–20 dB) as illustrated in Figure F3. Appendix E discusses
decibels in more detail.
Decimation filter— a lowpass
digital FIR filter where the output sample rate is less than the
filter's input sample rate. As discussed in Section
10.1, to avoid aliasing problems, the output sample rate must
not violate the Nyquist criterion.
Digital filter— computational
process, or algorithm, transforming a discrete sequence of numbers
(the input) into another discrete sequence of numbers (the output)
having a modified frequencydomain spectrum. Digital filtering can
be in the form of a software routine operating on data stored in
computer memory or can be implemented with dedicated hardware.
Elliptic function— a mathematical
function used to produce the sharpest rolloff for a given number
of filter taps. However, filters designed by using elliptic
functions, also called Cauer
filters, have the poorest phase linearity of the most common
IIR filter design functions. The ripple in the passband and
stopband are equal with elliptic filters.
Envelope delay— see group delay.
Filter coefficients— the set of
constants, also called tap
weights, used to multiply against delayed signal sample
values within a digital filter structure. Digital filter design is
an exercise in determining the filter coefficients that will yield
the desired filter frequency response. For an FIR filter, by
definition, the filter coefficients are the impulse response of the
filter.
Filter order— a number describing
the highest exponent in the numerator or denominator of the zdomain transfer function of a digital
filter. For FIR filters, there is no denominator in the transfer
function, and the filter order is merely the number of taps used in
the filter structure. For IIR filters, the filter order is equal to
the number of delay elements in the filter structure. Generally,
the larger the filter order, the better the frequency magnitude
response performance of the filter.
Finite impulse response (FIR)
filter— a class of digital filters that has only zeros
on the zplane. The key
implications of this are that FIR filters are always stable and
have linear phase responses (as long as the filter's coefficients
are symmetrical). For a given filter order, FIR filters have a much
more gradual transition region rolloff than digital IIR
filters.
Frequency magnitude response— a
frequencydomain description of how a filter interacts with input
signals. The frequency magnitude response in Figure F3 is a curve of filter attenuation
(in dB) vs. frequency. Associated with a filter's magnitude
response is a phase response.
Group delay— the derivative of a
filter's phase with respect to frequency, G = –Dø/Df, or the slope of a filter's H_{ø}(m) phase response curve. The concept of
group delay deserves additional explanation beyond a simple
definition. For an ideal filter, the phase will be linear and the
group delay would be constant. Group delay, whose unit of measure
is time in seconds, can also be thought of as the propagation time
delay of the envelope of an amplitudemodulated signal as it passes
through a digital filter. (In this context, group delay is often
called envelope delay.) Group
delay distortion occurs when signals at different frequencies take
different amounts of time to pass through a filter. If the group
delay is denoted G, then the
relationship between group delay, D•ø increment of phase, and D•f
increment of frequency is
Equation F2
If we know a linear phase filter's phase shift
(Dø) in degrees/Hz, or radians/Hz,
we can determine the group delay in seconds using
Equation F3
To demonstrate Eq. (F3) and illustrate the effect of a
nonlinear phase filter, let's assume that we've digitized a
continuous waveform comprising four frequency components defined
by
Equation F4
The x(t) input comprises the sum of 1Hz,
3Hz, 5Hz, and 7Hz sinewaves, and its discrete representation is
shown in Figure F4(a).
If we applied the discrete sequence representing x(t) to
the input of an ideal 4tap linearphase lowpass digital FIR
filter with a cutoff frequency of greater than 7 Hz, and whose
phase shift is –0.25 radians/Hz, the filter's output sequence
would be that shown in Figure
F4(b).
Figure F4. Filter timedomain response
examples: (a) filter input sequence; (b) linearphase filter output
sequence that's time shifted by 0.04 seconds, duplicating the input
sequence; (c) distorted output sequence due to a filter with a
nonlinear phase.
Because the filter's phase shift is –0.25
radians/Hz, Eq. (F3)
tells us that the filter's constant group delay G in seconds is
Equation F5
With a constant group delay of 0.04 seconds, the
1Hz input sinewave is delayed at the filter output by 0.25
radians, the 3Hz sinewave is delayed by 0.75 radians, the 5Hz
sinewave by 1.25 radians, and the 7Hz sinewave by 1.75 radians.
Notice how a linearphase (relative to frequency) filter results in
an output that's merely a time shifted version of the input as seen
in Figure F4(b). The
amount of time shift is the group delay of 0.04 seconds. Figure F4(c), on the other
hand, shows the distorted output waveform if the filter's phase was
nonlinear, for whatever reason, such that the phase shift was 3.5
radians instead of the ideal 1.75 radians at 7 Hz. Notice the
distortion of the beginning of the output waveform envelope in Figure F4(c) compared to Figure F4(b). The point
here is that, if the desired information is contained in the
envelope of a signal that we're passing through a filter, we'd like
that filter's passband phase to be as linear as possible with
respect to frequency. In other words, we'd prefer the filter's
group delay to vary as little as possible in the passband.
(Additional aspects of nonlinearphase filters are discussed in Section
5.8.)
Halfband filter— a type of FIR
filter whose transition region is centered at one quarter of the
sampling rate, or f_{s}/4.
Specifically, the end of the passband and the beginning of the
stopband are equally spaced about f_{s}/4. Due to their
frequencydomain symmetry, halfband filters are often used in
decimation filtering schemes because half of their timedomain
coefficients are zero. This reduces the number of necessary filter
multiplications, as described in Section
5.7.
Highpass filter— a filter that
passes high frequencies and attenuates low frequencies, as shown in
Figure F5(a). We've all
experienced a kind of highpass filtering in our living rooms.
Notice what happens when we turn up the treble control (or turn
down the bass control) on our home stereo systems. The audio
amplifier's normally flat frequency response changes to a kind of
analog highpass filter giving us that sharp and tinny sound as the
highfrequency components of the music are being accentuated.
Figure F5. Filter symbols and frequency
responses: (a) highpass filter; (b) low pass filter.
Impulse response— a digital
filter's timedomain output sequence when the input is a single
unityvalued sample (impulse) preceded and followed by zerovalued
samples. A digital filter's frequencydomain response can be
calculated by taking the discrete Fourier transform of the filter's
timedomain impulse response [4].
Infinite impulse response (IIR)
filter— a class of digital filters that may have both
zeros and poles on the zplane. As
such, IIR filters are not guaranteed to be stable and almost always
have nonlinear phase responses. For a given filter order (number of
IIR feedback taps), IIR filters have a much steeper transition
region rolloff than digital FIR filters.
Linearphase filter— a filter
that exhibits a constant change in phase angle (degrees) as a
function of frequency. The resultant filter phase plot vs.
frequency is a straight line. As such, a linearphase filter's
group delay is a constant. To preserve the integrity of their
informationcarrying signals, linear phase is an important criteria
for filters used in communication systems.
Lowpass filter— a filter that
passes low frequencies and attenuates high frequencies as shown in
Figure F5(b). By way of
example, we experience lowpass filtering when we turn up the bass
control (or turn down the treble control) on our home stereo
systems giving us that dull, muffled sound as the lowfrequency
components of the music are being intensified.
Notch filter— see band reject filter.
Passband— that frequency range
over which a filter passes signal energy with minimum attenuation.
Usually defined as the frequency range where the magnitude response
is within the peakpeak passband ripple region, as depicted in Figure F3.
Passband ripple— peakpeak
fluctuations, or variations, in the frequency magnitude response
within the passband of a filter as illustrated in Figure F3.
Phase response— the difference in
phase, at a particular frequency, between an input sinewave and the
output sinewave at that frequency. The phase response, sometimes
called phase delay, is usually
depicted by a curve showing the filter's phase shift vs. frequency.
Section 5.8
discusses digital filter phase response in more detail.
Phase wrapping— an artifact of
arctangent software routines, used to calculate phase angles, that
causes apparent phase discontinuities. When a true phase angle is
in the range of –180^{o} to –360^{o},
some software routines automatically convert those angles to their
equivalent positive angles in the range of 0^{o} to
+180^{o}. Section 5.8
illustrates an example of phase wrapping when the phase of an FIR
filter is calculated.
Quadrature filter— a dualpath
digital filter operating on complex signals, as shown in Figure F6. One filter
operates on the inphase i(n) data, and the other filter processes
the quadraturephase q(n) signal data. Quadrature filtering is
normally performed with lowpass filters.
Figure F6. Two lowpass filters used to
implement quadrature filtering.
Relative attenuation— attenuation
measured relative to the largest magnitude value. The largest
signal level (minimum attenuation) is typically assigned the
reference level of zero dB, as depicted in Figure F3, making all other magnitude
points on a frequencyresponse curve negative dB values.
Ripple— refers to fluctuations
(measured in dB) in the passband, or stopband, of a filter's
frequencyresponse curve. Elliptic and Chebyshevbased filters have
equiripple characteristics in that their ripple is constant across
their passbands. Bessel and Butterworth derived filters have no
ripple in their passband responses. Ripples in the stopband
response are sometimes called outofband
ripple.
Rolloff— a term used to describe
the steepness, or slope, of the filter response in the transition
region from the passband to the stopband. A particular digital
filter may be said to have a rolloff of 12 dB/octave, meaning that
the secondoctave frequency would be attenuated by 24 dB, and the
thirdoctave frequency would be attenuated by 36 dB, and so on.
Shape factor— a term used to
indicate the steepness of a filter's rolloff. Shape factor is
normally defined as the ratio of a filter's passband width divided
by the passband width plus the transition region width. The smaller
the shape factor value, the steeper the filter's rolloff. For an
ideal filter with a transition region of zero width, the shape
factor is unity. The term shape
factor is also used to describe analog filters.
Stopband— that band of
frequencies attenuated by a digital filter. Figure F3 shows the stopband of a lowpass
filter.
Structure— refers to the block
diagram showing how a digital filter is implemented. A recursive
filter structure is one in which feedback takes place and past
filter output samples are used, along with past input samples, in
calculating the present filter output. IIR filters are implemented
with recursive filter structures. A nonrecursive filter structure
is one in which only past input samples are used in calculating the
present filter output. FIR filters are almost always implemented
with nonrecursive filter structures. See Chapter 6 for examples of
various digital filter structures.
Tap weights— see filter coefficients.
Tchebyschev function— see Chebyshev.
Transfer function— a mathematical
expression of the ratio of the output of a digital filter divided
by the input of the filter. Given the transfer function, we can
determine the filter's frequency magnitude and phase responses.
Transition region— the frequency
range over which a filter transitions from the passband to the
stopband. Figure F3
illustrates the transition region of a lowpass filter. The
transition region is sometimes called the transition band.
Transversal filter— in the field
of digital filtering, transversal
filter is another name for FIR filters implemented with the
nonrecursive structures described in Chapter 5.
Zerophase filter— an offline
(because it operates on a block of filter input samples) filtering
method which cancels the nonlinear phase response of an IIR filter.
Section
13.12 details this nonrealtime filtering technique.
