Design of Digital Filters
Design of Digital Filters
A digital filter is a linear shift-invariant discrete-time system that is realized using finite
precision arithmetic. The design of digital filters involves three basic steps:
These three steps are independent; here we focus our attention on the second step.
The desired digital filter is to be used to filter a digital signal that is derived from
an analog signal by means of periodic sampling. The specifications for both analog and
digital filters are often given in the frequency domain, as for example in the design of low
pass, high pass, band pass and band elimination filters. Given the sampling rate, it is
specifications on the corresponding digital filter, the analog frequencies being in terms
of Hertz and digital frequencies being in terms of radian frequency or angle around the
unit circle with the point Z=-1 corresponding to half the sampling frequency. The least
confusing point of view toward digital filter design is to consider the filter as being specified
in terms of angle around the unit circle rather than in terms of analog frequencies.
1
Figure 4.1: Tolerance limits for approximation of ideal low-pass filter
digital filter. In the case of a low pass filter, for example, the specifications often take the
1 − δ1 ≤| H(ejω ) | ≤ 1, | ω |≤ ωp
| H(ejω ) | ≤ δ2 , ωs ≤| ω |≤ π
Many of the filters used in practice are specified by such a tolerance scheme, with no
constraints on the phase response other than those imposed by stability and causality
requirements; i.e., the poles of the system function must lie inside the unit circle.
Given a set of specifications in the form of Fig. 4.1, the next step is to find a discrete-
time linear system whose frequency response falls within the prescribed tolerances. At this
point the filter design problem becomes a problem in approximation. In the case of infinite
2
impulse response (IIR) filters, we must approximate the desired frequency response by a
rational function, while in the finite impulse response (FIR) filters case we are concerned
The traditional approach to the design of IIR digital filters involves the transformation of
an analog filter into a digital filter meeting prescribed specifications. This is a reasonable
approach because:
• The art of analog filter design is highly advanced and since useful results can be
analog filters.
• Many useful analog design methods have relatively simple closed-form design for-
mulas. Therefore, digital filter design methods based on analog design formulas are
N M
X dk ya (t) X dk xa (t)
ck = d k (4.1)
k=0 dtk k=0 dtk
PM
dk sk ya (s)
Ha (s) = Pk=0
N k
= (4.2)
k=0 ck s xa (s)
3
N
X M
X
ak y(n − k) = bk x(n − k) (4.3)
k=0 k=0
PM
k=0 bk z −k Y (z)
H(z) = PN = (4.4)
k=0 ak z
−k X(z)
In transforming an analog filter to a digital filter we must therefore obtain either H(z)
or h(n) (inverse Z-transform of H(z) i.e., impulse response) from the analog filter design.
In such transformations, we want the imaginary axis of the S-plane to map into the nit
circle of the Z-plane, a stable analog filter should be transformed to a stable digital filter.
That is, if the analog filter has poles only in the left-half of S-plane, then the digital
filter must have poles only inside the unit circle. These constraints are basic to all the
This technique of transforming an analog filter design to a digital filter design corresponds
to choosing the unit-sample response of the digital filter as equally spaced samples of the
jωT 1 X ∞
2π
H(e )= Ha (jΩ + j k) (4.6)
T k=−∞ T
4
Figure 4.2: Mapping of s-plane into z-plane
or
1 X ∞
2π
H(z) |z=esT = Ha (s + j k) (4.7)
T k=−∞ T
From the relationship Z = eST it is seen that strips of width 2π/T in the S-plane map
into the entire Z-plane as shown in Fig. 4.2. The left half of each S-plane strip maps into
interior of the unit circle, the right half of each S-plane strip maps into the exterior of the
unit circle, and the imaginary axis of length 2π/T of S-plane maps on to once round the
unit circle of Z-plane. Each horizontal strip of the S-plane is overlaid onto the Z-plane to
The frequency response of the digital filter is related to the frequency response of the
5
Figure 4.3: Illustration of the effects of aliasing in the impulse invariance technique
analog filter as
1 X ∞
ω 2π
H(ejω ) = Ha (j + j k) (4.8)
T k=−∞ T T
From the discussion of the sampling theorem it is clear that if and only if
π
Ha (jΩ) = 0, | Ω |≥
T
Then
1 ω
H(ejω ) = Ha (j ), | ω |≤ π
T T
Unfortunately, any practical analog filter will not be band limited, and consequently
there is interference between successive terms in Eq. (4.8) as illustrated in Fig. 4.3.
Because of the aliasing that occurs in the sampling process, the frequency response of the
resulting digital filter will not be identical to the original analog frequency response.
To get the filter design procedure, let us consider the system function of the analog
6
N
X Ak
Ha (s) = (4.9)
k=1 s − sk
N
Ak esk t U (t)
X
ha (t) = (4.10)
k=1
N N
n
Ak esk nT u(n) = Ak (esk T ) U (n)
X X
h(n) = ha (nT ) = (4.11)
k=1 k=1
N
X Ak
H(z) = sk T z −1 )
(4.12)
k=1 (1 − exp
In comparing Eqs. (4.9) and (4.12) we observe that a pole at s=sk in the S-plane
impulse invariant design procedure does not correspond to a mapping of the S-plane to
the Z-plane.
(4.1) by finite differences. If the samples are closer together, the approximation to the
derivative would be increasingly accurate. For example, suppose that the first derivative
7
dya (t) y(n) − y(n − 1)
|t=nT −→ ∇(1) [y(n)] = (4.13)
dt T
N M
ck ∇(k) [y(n)] = dk ∇(k) [x(n)]
X X
(4.16)
k==0 k=0
Where y(n) = ya (nT ) and x(n) = xa (nT ). We note that the operation ∇(1) [ ] is a
linear shift-invariant operator and that ∇(k) [ ] can be viewed as a cascade of (k) operators
∇(1) [ ]. In particular,
1 − z −1
Z[∇(1) [x(n)]] = [ ]X(z)
T
and
1 − z −1 k
Z[∇(1) [x(n)]] = [ ] X(z)
T
8
PM −1
dk [ 1−zT ]k
k=0
H(z) = P 1−z −1 k
(4.17)
k=0 N ck [ T ]
Comparing Eq. (4.17) to (4.2), we observe that the digital transfer function can be
obtained directly from the analog transfer function by means of a substitution of variables
1 − z −1
s= (4.18)
T
So that, this technique does indeed truly correspond to a mapping of the S-plane to
the Z-plane, according to Eq. (4.18). To investigate the properties of this mapping, we
1
z=
1 − sT
1
z =
1 − jΩT
1 1 1
= + −
1 − jΩT 2 2
1 1 1 + jΩT
= + [ ]
2 2 1 − jΩT
1 1 + jΩT
= [1 + ]
2 1 − jΩT
1 −1
= [1 + ej2 tan (ΩT ) ] (4.19)
2
Which corresponds to a circle whose center is at z=1/2 and radius is 1/2, as shown
an Fig. 4.4. It is easily verified that the left half of the S-plane maps into the inside
of the small circle and the right half of the S-plane maps onto the outside of the small
9
Figure 4.4: Mapping of s-plane to z-plane corresponding to first backward-difference ap-
proximation to the derivative
circle. Therefore, although the requirement of mapping the jΩ -axis to the unit circle is
very small region of the unit circle. These two procedures are highly unsatisfactory for
In the previous section a digital filter was derived by approximating derivatives by differ-
ences. An alternative procedure is based on integrating the differential equation and then
using a numerical approximation to the integral. Consider the first - order equation
10
0
c1 ya (t) + c0 ya (t) = d0 xa (t) (4.20)
0
Where ya (t) is the first derivative of ya (t). The corresponding analog system function
is
d0
Ha (s) =
c0 + c 1 s
0
We can write ya (t) as an integral of ya (t), as in
Z t 0
ya (t) = ya (t)dt + ya (t0 )
t0
Z nT 0
ya (nT ) = ya (τ )dτ + ya ((n − 1)T )
(n−1)T
T 0 0
ya (nT ) = ya ((n − 1)T ) + [ya (nT ) + ya ((n − 1)T )] (4.21)
2
0 c0 d0
ya (nT ) = − ya (nT ) + xa (nT )
c1 c1
T c0 d0
[y(n) − y(n − 1)] = [− (y(n) + y(n − 1)) + (x(n) + x(n − 1))]
2 c1 c1
where y(n) = y(nT ) and x(n) = x(nT ). Taking the Z-transform and solving for H(z)
gives
11
Y (z) d0
H(z) = = (4.22)
c0 + c1 T2 1−z
−1
X(z) 1+z −1
From Eq. (4.22) it is clear that H(z) is obtained from Ha (s) by the substitution
2 1 − z −1
s= (4.23)
T 1 + z −1
That is,
This can be shown to hold in general since an N th - order differential equation of the
form of Eq. (4.1) can be written as a set of N first-order equations of the form of Eq.
1 + T2 s
z= (4.25)
1 − T2 s
see that this mapping has the property that the imaginary axis in the s-plane maps onto
the unit circle in the z-plane, consider z = ejω , then from Eq. (4.23), s is given by
2 1 − e−jω
s =
T 1 + e−jω
2 j sin(ω/2)
=
T cos(ω/2)
2
= j tan(ω/2)
T
= σ + jΩ
12
Figure 4.5: Mapping of analog frequency axis onto the unit circle using the bilinear
transformation
TΩ
= tan(ω/2)
2
or
From the figure it is clear that the positive and negative imaginary axis of the s-plane
are mapped, respectively, into the upper and lower halves of the unit circle in the z-plane.
In addition to the fact that the imaginary axis in the s-plane maps into the unit circle
in the z-plane, the left half of the s-plane maps to the inside of the unit circle and the
right half of the s-plane maps to the outside of the unit circle, as shown in Fig. (4.6).
Thus we see that the use of the bilinear transformation yields stable digital filter from
analog filter. Also this transformation avoids the problem of aliasing encountered with
the use of impulse invariance, because it maps the entire imaginary axis in the s-plane
13
Figure 4.6: Mapping of the s-plane into the z-plane using the bilinear transformation
onto the unit circle in the z-plane. The price paid for this, however, is the introduction
Another method for converting an analog filter into an equivalent digital filter is to map
the poles and zeros of Ha (s) directly into poles and zeros in the z-plane. For analog filter
QM
k=1 (s − sk )
Ha (s) = QN (4.26)
k=1 (s − pk )
QM
k=1 (1 − ezk T z −1 )
H(z) = QN pk T z −1 )
(4.27)
k=1 (1 − e
where T is the sampling interval. Thus each factor of the form (s-a) in Ha (s) is mapped
14
4.1.5 Characteristics Of Commonly Used Analog Filters:
From the previous discussion it is clear that, IIT digital filters can be obtained by begin-
ning with an analog filter. Thus the design of a digital filter is reduced to designing an
appropriate analog filter and then performing the conversion from Ha (s) to H(z).
Analog filter design is a well - developed field, many approximation techniques, viz.,
Butterworth, Chebyshev, Elliptic, etc., have been developed for the design of analog low
pass filters. Our discussion is limited to low pass filters, since, frequency transformation
can be applied to transform a designed low pass filter into a desired high pass, band pass
Butterworth Filters:
Low pass Butterworth filters are all - pole filters with monotonic frequency response
in both pass band and stop band, characterized by the magnitude - squared frequency
response
1 1
| Ha (Ω) |2 = 2N
= (4.28)
1 + (Ω/Ωc ) 1 + (Ω/Ωp )2N
2
Where, N is the order of the filter, Ωc is the -3dB frequency, i.e., cutoff frequency,
Ωp is the pass band edge frequency and 1/(1 + 2 ) is the band edge value of | Ha (Ω) |2 .
Since the product Ha (s)Ha (−s) and evaluated at s = jΩ is simply equal to | Ha (Ω) |2 , it
follows that
1
Ha (s)Ha (−s) = 2 (4.29)
1 + ( −s
Ω2
)N
c
15
The poles of Ha (s)Ha (−s) occur on a circle of radius Ωc at equally spaced points. From
−s2
= (−1)1/N = ej(2k+1)π/N , k = 0, 1, , · · · , N − 1 (4.30)
Ω2c
and hence, the N poles in the left half of the s-plane are
sk = Ωc ejπ/2 e(2k+1)π/2N , k = 0, 1, · · · , N − 1
= σk + jΩk (4.31)
Note that, there are no poles on the imaginary axis of s-plane, and for N odd there
will be a pole on real axis of s-plane, for N even there are no poles even on real axis of
s-plane. Also note that all the poles are having conjugate symmetry.
Thus the design methodology to design a Butterworth low pass filter with δ2 attenu-
Find N,
log[(1/δ22 ) − 1] log(δ/)
N= = (4.32)
2 log(Ωs /Ωc ) log(Ωs /Ωp )
√
where by definition, δ2 = 1/ 1 + δ 2 . Thus the Butterworth filter is completely charac-
Then, from Eq. (4.31) find the pole positions sk , k = 0, 1, · · · , N − 1. Finally the
N
Y 1
Ha (s) = (4.33)
k==1 (s − sk )
16
Chebyshev Filters:
There are two types of Chebyshev filters. Type I Chebyshev filters are all-pole filters that
exhibit equiripple behavior in the pass band and a monotonic characteristic in the stop
band. On the other hand, type II Chebyshev filters contain both poles and zeros and
exhibit a monotonic behavior in the pass band and an equiripple behavior in the stop
band. The zeros of this class of filters lie on the imaginary axis in the s-plane.
filter is given as
1
| Ha (Ω) |2 = (4.34)
1+ 2 TN2 (Ω/Ωp )
where is a parameter of the filter related to the ripple in the pass band as shown in Fig.
(
cos(N cos−1 x), | x |≤ 1
TN (x) = (4.35)
cosh(N cosh−1 x), |x|>1
1
√ = 1 − δ1
1 + 2
17
Figure 4.7: Type I Chebysehev filter characteristic
or equivalently
1
2 = −1 (4.36)
(1 − δ1 )2
The poles of Type I Chebyshev filter lie on an ellipse in the s-plane with major axis
β2 + 1
r1 = Ω p (4.37)
2β
√
1 + 2 + 1 1/N
β=[ ] (4.39)
The angular positions of the left half s-plane poles are given by
18
π (2k + 1)π
φk = + , k = 0, 1, · · · , N − 1 (4.40)
2 2N
Then the positions of the left half s-plane poles are given by
sk = σk + jΩk , k = 0, 1, · · · , N − 1 (4.41)
where σk = r2 cos φk and Ωk = r1 sin φk . The order of the filter is obtained from
q q
log[( 1 − δ22 + 1 − δ22 (1 + 2 ))/δ2 ]
N = Ωs
q
Ωs 2
log[ Ω p
+ (Ω p
) − 1]
cosh−1 ( δ )
= Ωs (4.42)
cosh−1 ( Ω p
)
where, by definition δ2 = √ 1 .
1+δ 2
N
Y 1
Ha (s) =
k=1 (s − sk )
A Type II Chebyshev filter contains zero as well as poles. The magnitude squared
response is given as
1
| Ha (−Ω) |2 = Ωs (4.43)
1+ 2 [TN2 ( Ω p
)/TN2 ( ΩΩs )]
where TN (x) is the N-order Chebyshev polynomial. The zeros are located on the imaginary
Ωs
zk = j , k = 0, 1, . . . , N − 1 (4.44)
sin φk
19
sk = σk + jΩk , k = 0, 1, . . . , N − 1 (4.45)
where
Ωs r2 cos φk
σk = q (4.46)
r22 cos2 φk + r12 sin2 φk
and
Ωs r1 sin φk
Ωk = q (4.47)
r22 cos2 φk + r12 sin2 φk
N
Y s − zk
Ha (s) = (4.48)
k=1 s − sk
The other approximation techniques are elliptic (equiripple in both passband and
4.2 Examples:
Using
20
Figure 4.8: Frequency response plot of the example
Solution
From the given digital domain frequency, find the corresponding analog domain fre-
quencies.
ωc ωs
Ωc = T
and Ωs = T
where T is the sampling period and 1/T is the sampling frequency and it always
sec.
( δ12 − 1)
N= 2
2 log( Ω
Ωc
s
)
21
Where δ2 is the gain at the stop band edge frequency ωs .
−15 dB = 20 log δ2
δ2 = 20 log δ2
π
δ2 = 10− 20 = 0.1778
1
log( (0.1778) 2 − 1
N= = 4.219 ' 5
2 log( 0.75π
0.5π
)
Then the 5 poles on the Butterworth circle of radius Ωc = 0.5π are given by
π π
s0 = 0.5πej( 2 + 10 ) = −0.485 + j1.493
π 3π
s1 = 0.5πej( 2 + 10 ) = −1.27 + j0.923
π 5π
s2 = 0.5πej( 2 + 10 ) = −1.57 + j0.0
π 7π
s3 = 0.5πej( 2 + 10 ) = −1.27 − j0.923
π 9π
s5 = 0.5πej( 2 + 10 ) = −0.485 − j1.493
1
Ha (s) =
(s + 0.485 − j1.493)(s + 1.27 − j0.923)(s + 1.57)(s + 1.27 + j0.923)(s + 0.485 + j0.923)
5
X Ak
=
k=1 (s − sk )
22
Finally, the transfer function of the digital filter is
5
X Ak
H(z) = sk −1
, where sk ’s are the poles on the Butterworth circle
k=1 (1 − e z )
b)
5
X 1
H(z) =
k=1 (1 − z −1 − sk )
c) For the bilinear transformation technique, we need to prewarp the digital frequencies
2
i.e., Ω = T
tan( ω2 )
0.5π
Ωc = 2 tan( ) = 2 rad.
2
and
0.75π
Ωs = 2 tan( ) = 4.828 rad.
2
π π
s0 = 2ej( 2 + 4 ) = −1.414 + j1.414
π 3π
s1 = 2ej( 2 + 4 ) = −1.414 − j1.414
1
Ha (s) =
(s + 1.414 − j1.414)(s + 1.414 + j1.414)
23
Finally, the transfer function of the digital filter is
1
H(z) = 1−z −1 1−z −1
(2 1+z −1 + 1.414 − j1.414)(2 1+z −1 + 1.414 + j1.414)
II Design a digital filter using impulse invariant technique to satisfy following charac-
teristics
(ii) -3dB ripple with pass band edge frequency at 0.5π radians.
when
1
20 log √ = −3|mboxdB
1 + 2
i.e.,
10 log(1 + 2 ) = 3dB
2 = 100.3 − 1 = 0.9952
= 0.9976
and
20 log δ2 = −15 dB
24
δ2 = 10−0.75 = 0.1778
Hence
q q
[( 1 − (0.1778)2 + 1 − (0.1778)2 (1 + 0.9952))/0.9976 × 0.1778]
N = q
log[ 0.75π
0.5π
+ ( 0.75π
0.5π
)2 − 1]
= 2.48
' 3
β2 + 1
r1 = Ωp
2β
(1.341)2 + 1
= 0.5π ×
2 × 1.341
= 1.639
β2 − 1
r2 = Ω p
2β
(1.341)2 − 1
= 0.5π ×
2 × 1.341
= 0.469
The angles,
π (2k + 1)π
φk = + , k = 0,1 ,2
2 2N
25
4π 4π
s0 = 0.469 cos( ) + j1.639 sin( )
6 6
= −0.2345 + j1.419
= −0.469 + j0.0
8π 8π
s2 = 0.469 cos( ) + j1.6939 sin( )
6 6
= −0.2345 − j1.419
1
Ha (s) =
s + 0.2345 − j1.419)(s + 0.469) + (s + 0.2345 + j1.419)
3
X Ak
=
k=1 (s − sk )
3
X Ak
H(z) = sk −1 )
k=1 (1 − e z
26