You are on page 1of 26

4.

Design of Discrete-Time Filters

4.1. Introduction (7.0)


4.2. Frame of Design of IIR Filters (7.1)
4.3. Design of IIR Filters by Impulse Invariance (7.1)
4.4. Design of IIR Filters by Bilinear Transformation (7.1)
4.5. Design of FIR Filters by Windowing (7.2)
4.1. Introduction
4.1.1. Overview
A discrete-time filter is a discrete-time system which passes some
frequency components and stops others. An ideal discrete-time filter
is best in frequency selectivity. It passes the frequency components in
the pass band distortionlessly and stops the frequency components in
the stop band completely. Unfortunately, it is noncausal and cannot
be implemented in real time. This is undesired in many applications.
In such a case, we need to design a causal discrete-time filter which
approximates the ideal discrete-time filter functionally. The goal of
the design is an impulse response, a frequency response, a system
function, a linear constant-coefficient difference equation or another.
An ideal filter can be approximated by an IIR or FIR filter. An IIR
filter usually needs less cost, i.e., less computation and memory, and
an FIR filter usually has a better performance, especially in the phase
response. If a generalized linear phase is needed, we usually use an
FIR filter.
4.1.2. Analysis of Ideal Filters
Consider an ideal lowpass filter. The analysis can be extended to
other types of ideal filters.
Over period [, ), the frequency response of an ideal lowpass
filter is defined as
exp( j), |  | c
H()   . (4.1)
0, otherwise

Let xi(n)=Aiexp(jin) be a frequency component of the input signal.


Then, the corresponding output signal of this filter is
yi(n)=Aiexp(jin)H(i). (4.2)
If |i|c, then
yi(n)=Aiexp[ji(n)], (4.3)
i.e., xi(n) is passed with a constant delay . If |i|>c, then
yi(n)=0, (4.4)
i.e., xi(n) is stopped completely. Thus, the ideal lowpass filter has the
best frequency selectivity.
The impulse response of the ideal lowpass filter is
sin c ( n   )
h (n )  . (4.5)
( n   )
Since h(n)0 for n<0, the ideal lowpass filter is noncausal and cannot
be implemented in real time. However, in practical applications, a
causal lowpass filter is often required. In such cases, we need to find
a causal lowpass filter which approximates the ideal lowpass filter
functionally. Depending on a specific application, this causal lowpass
filter can be an IIR or FIR filter.
4.2. Frame of Design of IIR Filters
Conventionally, the design of a discrete-time IIR filter involves a
transform from a continuous-time IIR filter into the discrete-time IIR
filter. It consists of three steps:
1. Find the specifications on the continuous-time IIR filter from
the specifications on the discrete-time IIR filter.
2. Find the system function of the continuous-time IIR filter from
the specifications on the continuous-time IIR filter.
3. Find the system function of the discrete-time IIR filter from the
system function of the continuous-time IIR filter.
There are two typical methods to transform a continuous-time IIR
filter into a discrete-time IIR filter. One is the impulse invariance,
and the other is the bilinear transformation. Next, we will discuss the
two methods.
4.3. Design of IIR Filters by Impulse Invariance
4.3.1. Definition
A typical method to transform a continuous-time IIR filter into a
discrete-time IIR filter is the impulse invariance. In this method, the
impulse response of the discrete-time IIR filter is obtained by
sampling the impulse response of the corresponding continuous-time
IIR filter, i.e.,
h(n)=Thc(nT). (4.6)
Here, h(n) is the impulse response of the discrete-time IIR filter, hc(t)
is the impulse response of the continuous-time IIR filter, and T is the
sampling interval.
4.3.2. Causality and Stability
If the continuous-time IIR filter has a rational system function and
is causal and stable, the discrete-time IIR filter is causal and stable.
4.3.3. Frequency Response
If H() and Hc() are the frequency responses of the discrete-time
IIR filter and the continuous-time IIR filter, respectively, then

 2 
HT    Hc    m . (4.7)
m    T 

hc(t) Hc()

t 
W
h(n) H(T)

… …
n 
W 2/T
Figure 4.1. Relation between H() and Hc() when 2/T>W.
hc(t) Hc()

t 
W
h(n) H(T)

… …
n 
W 2/T
Figure 4.2. Relation between H() and Hc() when 2/TW.
(4.7) shows that H(T) equals Hc() extended with period 2/T. Let
W be the bandwidth of Hc(). If 2/T>W, then H(T) equals Hc()
over the interval [/T, /T) (figure 4.1). Aliasing happens otherwise
(figure 4.2).
The above analysis implies that the impulse invariance can be used
to design band-limited filters, such as lowpass filters and bandpass
filters but cannot be used to design other filters, like highpass filters
and bandstop filters.
4.3.4. Procedure
The impulse invariance is carried out in three steps:
1. Find the specifications on the continuous-time IIR filter from
the specifications on the discrete-time IIR filter according to
=/T, (4.8)
where  is the physical frequency of the continuous-time IIR filter, 
is the normalized frequency of the discrete-time IIR filter, and T is
the sampling interval.
2. Find the system function of the continuous-time IIR filter from
the specifications on the continuous-time IIR filter.
3. Find the system function of the discrete-time IIR filter from the
system function of the continuous-time IIR filter. This consists of
three steps: (1) Find the impulse response of the continuous-time IIR
filter from its system function. (2) Find the impulse response of the
discrete-time IIR filter from the impulse response of the continuous-
time IIR filter. (3) Find the system function of the discrete-time IIR
filter from its impulse response.
Example. Design a causal lowpass discrete-time IIR filter with the
cutoff frequency 0.2, i.e.,
| H[exp( j0.2)] | 1
 , (4.9)
| H[exp( j0)] | 2
where H(z) is the system function of the filter. A requirement is that
the filter should be generated from a causal lowpass continuous-time
IIR filter
a
H c (s)  , Re(s)  a , (4.10)
sa
where a>0, by the impulse invariance.
4.4. Design of IIR Filters by Bilinear Transformation
4.4.1. Definition
Another typical method to transform a continuous-time IIR filter
into a discrete-time IIR filter is the bilinear transformation. Assume
that H(z) and Hc(s) are the system functions of the discrete-time IIR
filter and the continuous-time IIR filter, respectively. In the bilinear
transformation, H(z) is obtained from Hc(s) by letting
2  1  z 1 
s   ,
1  (4.11)
T 1 z 

and that is,


 2  1  z 1 
H(z)  H c    ,
1  (4.12)
 T  1  z 
where T is a positive constant.
4.4.2. Causality and Stability
The discrete-time IIR filter is causal and stable if the continuous-
time IIR filter is causal and stable.
4.4.3. Frequency Response
Letting z=exp(j) in (4.12), we obtain
 2   
Hexp( j)  H c  j tan . (4.13)
 T  2 
(4.13) shows that H[exp(j)] equals Hc(j) when
2  
  tan  (4.14)
T 2
(figure 4.3).
Aliasing is avoided. However, a nonlinear distortion is caused due
to the nonlinear mapping from  to .



Hc(j)

… …

 0  3
0

H[exp(j)]

… …
0 
  3
Figure 4.3. Relation between H[exp(j)] and Hc(j).
4.4.4. Procedure
The bilinear transformation is carried out in the following steps:
1. Find the specifications on the continuous-time IIR filter from
the specifications on the discrete-time IIR filter according to (4.14).
2. Find the system function of the continuous-time IIR filter from
the specifications on the continuous-time IIR filter.
3. Find the system function of the discrete-time IIR filter from the
system function of the continuous-time IIR filter according to (4.12).
Example. Design a causal lowpass discrete-time IIR filter which
has the cutoff frequency 0.2, i.e.,
| H[exp( j0.2)] | 1
 , (4.15)
| H[exp( j0)] | 2
where H(z) is the system function of the filter. A requirement is that
the filter should be obtained from a causal lowpass continuous-time
IIR filter
a
H c (s)  , Re(s)  a , (4.16)
sa
where a>0, by the bilinear transformation.
4.5. Design of FIR Filters by Windowing
4.5.1. Principle
An ideal filter can be approximated by a causal FIR filter as well.
This can be carried out by different methods. A widely used method
is the windowing method. In this method, the impulse response of
the causal FIR filter is obtained by windowing the impulse response
of the ideal filter.
Let us consider the design of a lowpass filter. The addressed ideas
and methods, however, also apply to other cases.
In period [, ), the frequency response of an ideal lowpass filter
is defined as
exp( j), |  | c
H d ()   . (4.17)
0, otherwise

Taking the inverse Fourier transform of Hd(), we obtain the impulse


response of the ideal lowpass filter, i.e.,
sin c (n  )
h d (n )  . (4.18)
(n  )
Since hd(n)0 for n<0, the ideal lowpass filter is noncausal. However,
windowing hd(n), we can obtain the impulse response of a causal FIR
lowpass filter. That is,
h(n)=hd(n)w(n), (4.19)
where w(n) is a window function and is equal to 0 for n<0. Generally,
w(n) is real and symmetric, and has a maximum of unit.
 is chosen as
=(N1)/2, (4.20)
where N is the length of w(n). Thus, h(n) is real and symmetric, and
the causal FIR lowpass filter has a generalized linear phase.
4.5.2. Frequency Response
Let W() be the spectrum of w(n). Then the frequency response of
the causal FIR lowpass filter equals the periodic convolution of Hd()
and W() divided by 2, i.e.,
1
H() 
2 2 
H d () W (  )d. (4.21)

Hd() can be expressed as


Hd()=Ad()exp(j), (4.22)
where Ad() is the amplitude of Hd(). W() can be expressed as
W()=E()exp(j), (4.23)
where E() is a real function. Substituting (4.22)-(4.23) into (4.21),
we obtain
H()=A()exp(j), (4.24)
where A() is the periodic convolution of Ad() and E() divided by
2, i.e.,
1
A() 
2 2 
A d ()E(  )d. (4.25)

Evidently, A() is also a real function.


From (4.22) and (4.24), we see that the difference between Hd()
and H() is actually the difference between Ad() and A(). Based
on (4.25), there exist two significant differences between Ad() and
A() (figure 4.4).
hd(n) Ad()
… …
n 
 c 

w(n) E()
… …
n 
  

h(n)  A()
… …
n 
 c 

Figure 4.4. Differences between Ad() and A().


1. At each cutoff frequency, Ad() is discontinuous, but A() has a
transition band. (1) The width of the transition band is determined by
the width of the main lobe of E(). In order for A() to have a
narrow transition band, E() should have a narrow main lobe. (2)
The width of the main lobe of E() is determined by both the shape
and the length of w(n). A longer w(n) results in a narrower main lobe.
2. Over the passband and the stopbands, Ad() is equal to 1 and 0
respectively, but A() has ripples. (1) The amplitudes of the ripples
are determined by the areas of the side lobes of E(). In order for
A() to have small-amplitude ripples, E() should have small-area
side lobes. (2) The areas of the side lobes of E() are determined by
the shape of w(n) only.
From (4.24), we have a better understanding about the generalized
linear phase of the causal FIR lowpass filter. It has a strict linear
phase in the passband, which is desired. Its phase is not strictly linear
in the stopbands, but this is trivial.
4.5.3. Windows
The rectangular window is defined as
1, 0  n  N  1
w (n )   . (4.26)
0, otherwise

The Bartlett window is defined as


2n /( N  1), 0  n  ( N  1) / 2

w (n )  2  2n /( N  1), (N  1)/2  n  N  1 . (4.27)
0,
 otherwise
The Hann window is defined as
  2n 
0 . 5  0 . 5 cos , 0  n  N  1
w (n )    N 1  . (4.28)
0,
 otherwise
The Hamming window is defined as
  2n 
0.54  0.46 cos , 0  n  N  1
w (n )    N 1  . (4.29)
0,
 otherwise

The Blackman window is defined as


  2n   4n 
0.42  0.5 cos   0.08 cos , 0  n  N  1
w (n )    N 1   N 1  . (4.30)
0,
 otherwise
The above windows are illustrated in figure 4.5.
Table 4.1 gives the features of these windows. When the length of
the window is fixed, a narrow transition band always corresponds to
large-amplitude ripples, and therefore there exists a tradeoff between
the width of the transition band and the amplitudes of the ripples.
Figure 4.5. Shapes of Commonly Used Windows.
Shape of Width of Transition Peak Amplitude
Window Band ( in Figure 4.4) of Ripples
Rectangular 4/N 21dB
Bartlett 8/(N1) 25dB
Hann 8/(N1) 44dB
Hamming 8/(N1) 53dB
Blackman 12/(N1) 74dB
Table 4.1. Features of Commonly Used Windows.
The Kaiser window is defined as
  2
 I 0  1   2n  1 
 
  N  1  
w (n )   , 0  n  N 1 . (4.31)
 I 0 ()

0, otherwise
Here I0(·) is the zero-order modified Bessel function of the first kind
and  is a shape parameter.
4.5.4. Procedure
The windowing method is carried out in the following steps:
1. Determine the shape of the window based on the specifications
on the amplitudes of the ripples.
2. Determine the length of the window based on the specifications
on the width of the transition band.
3. Determine  based on (4.20).
4. Determine the impulse response of the causal FIR lowpass filter
based on (4.19).
Example. Design a causal FIR lowpass filter. The cutoff frequency
is 0.2. The width of the transition band is less than or equal to 0.01.
The amplitudes of the ripples are less than or equal to 0.01.

You might also like