Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
General Considerations
Digital filter design involves four steps:
1) Determining specifications
H( z ) = ∑ M − 1k = 0bk z− k ∑ N − 1k = 0 a k z− k H(z)=∑k=0M−1b
kz−k∑k=0N−1akz−k
Equation (1)
FIR Filters
An FIR filter is a special case of Equation (1),
where a 0 = 1 a0=1and a k = 0 ak=0for k = 1 ,..., N − 1 k=1,...,N−1, hence
we obtain:
H( z ) = M − 1 ∑ k = 0bk z− k H(z)=∑k=0M−1bkz−k
Equation (2)
The direct form realization of Equation (2) for M=3 is shown in Figure (2). As
shown in this figure, a digital filter can be implemented using only three
elements:
1. Addition
2. Multiplication by a constant (necessary for the implementation of the
coefficients)
3. Delay blocks
There are three coefficients and two delay cells in Figure (2). Note that this filter
is of order 2, the number of delay cells, not 3, the number of coefficients.
An FIR filter has two important advantages over an IIR design:
Firstly, as shown in Figure (2), there is no feedback loop in the structure of an
FIR filter. Due to not having a feedback loop, an FIR filter is inherently stable.
Meanwhile, for an IIR filter, we need to check the stability.
Secondly, an FIR filter can provide a linear-phase response. As a matter of fact,
a linear-phase response is the main advantage of an FIR filter over an IIR
design—otherwise, for the same filtering specifications, an IIR filter will lead to
a lower order.
In order to have a linear-phase FIR filter, we must provide symmetry in the time
domain, i.e. b[ n ] = ±b[M − 1 −n ] b[n]=±b[M−1−n]. In the example
shown in Figure (2), assume that b0 = b2 b0=b2, hence Equation (2) gives
Equation (3)
ω ) < 0 ∡H(z)={−ωpb1+2b0cos(ω)>0−ωp+πb1+2b0cos(ω)<0
Equation (4)
Therefore, the phase response will be linear. Although this example shows
a linear-phase response in the case of a three-tap filter, it can be shown that for
an arbitrary value of M M, time-domain symmetry leads to a linear-phase
response. This is an important property which helps us to examine the linear-
phase response of an FIR filter just by considering the values of bk bkwithout
any calculation.
The reader may wonder why a linear-phase frequency response is important. To
gain insight, consider the continuous-time case. Assume that the frequency
response of a system is
H( s ) = αe− j β ω H(s)=αe−jβω
Equation (5)
where α αand β βare real constants. The phase response of this system is linear,
Equation (6)
ωndω
Equation (7)
ωc+ωcejωndω=sin(nωc)nπ
Equation (8)
The next option is shown in Figure (5) which, despite being causal, does not
have a linear-phase response (the most important property of an FIR system).
Figure (5) Truncated impulse response: causal, but nonlinear-phase
The last option is shown in Figure (6). This system is both causal and linear
phase. The only drawback to this system is its delay which
is M − 12 M−12samples. In other words, in response to an impulse
at n = 0 n=0, the system will not react until almost n = M − 12 n=M−12. This
delay may cause problems in some applications.
Figure (6) Truncated impulse response: causal and linear phase
Equation (9)
Clearly the spectrum of the rectangular window will cause the filter response to
deviate from the ideal response in Equation (6). Figure (7) compares the
response of the designed filter with that of the ideal one.
This figure shows that, unlike the ideal filter, the designed filter has a smoother
transition from the passband to the stopband. Moreover, there are some ripples
in both the passband and stopband of H( ω ) H(ω). How can we make the
transition band sharper? How can we make the ripples smaller? What other
options are there to be used instead of a rectangular window?
Summary
To design a digital filter, we need to find the coefficients, a k akand bk bk,
in Equation (1).
An FIR filter is a special case of Equation (1),
where a 0 = 1 a0=1and a k = 0 ak=0for k = 1 ,..., N − 1 k=1,...,N−1.
Stability and linear-phase response are the two most important advantages
of an FIR filter over an IIR filter.
A linear-phase frequency response corresponds to a constant delay.
Truncation of the impulse response is equivalent to
multiplying hd[ n ] hd[n]by a rectangular window, w [ n ] w[n], which is
equal to one for n = 0 ,..., M − 1 n=0,...,M−1and zero otherwise.
A wider transition band and ripples in the passband and stopband are the
most important differences between the ideal filters and those designed by
window method.