0% found this document useful (0 votes)
7 views

Chapter 3 Slides

Uploaded by

Afwan Ariffin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Chapter 3 Slides

Uploaded by

Afwan Ariffin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 100

Chapter 3: Digital Filter Design and

Applications

1
Chapter 3(a): Finite Impulse Response (FIR)
Filter Design

2
Finite Impulse Response (FIR) Filter

An FIR filter is completely specified by the following


input-output relationship:
K
y (n) =  bi x(n − i ) = b0 x(n) + b1 x(n − 1) + ... + bK x(n − K )
i =0

where bi, 0 ≤ i ≤ K, represents the FIR filter coefficients


and K+1 denotes the FIR filter length (also known as
the number of taps).
The FIR filter operation does not involve the past
filter outputs.

3
Finite Impulse Response (FIR) Filter

Applying the z-transform on both sides of the difference


equation leads to

Y ( z ) = b0 X ( z ) + b1 z −1 X ( z ) + ... + bK z − K X ( z )

The transfer function that depicts the FIR filter is given


by
Y ( z)
H ( z) = = b0 + b1 z −1 + ... + bK z − K
X ( z)
b0 z K + b1z K −1 + ... + bK
=
zK

4
Stability

The transfer function of a FIR filter has a constant term,


all the other terms have negative powers of z, and all the
poles are located at the origin of the z-plane. Hence, the
stability of the filter is guaranteed. Its impulse response
has only a finite number of terms.

The FIR filter operations involve only multiplying the


filter inputs by their corresponding coefficients and
accumulating them; the implementation of this filter
type in real time is straightforward.

5
Example 1

Given the FIR filter


y(n) = 0.1x(n) + 0.25x(n - 1) + 0.2x(n - 2)
Determine the transfer function, filter length, nonzero
coefficients, and impulse response.

6
Solution

Applying the z-transform on both sides of the difference


equation yields
Y ( z ) = 0.1X ( z ) + 0.25 z −1 X ( z ) + 0.2 z −2 X ( z )
The transfer function that depicts the FIR filter is given
by Y ( z) −1 −2
H ( z) = = 0.1 + 0.25 z + 0.2 z
X ( z)
The FIR filter length is K+1 = 3, and the filter
coefficients are b0 = 0.1, b1 = 0.25, and b2 = 0.2.
Taking the inverse z-transform of the transfer function,
we have
h( n) = 0.1δ ( n) + 0.25δ ( n − 1) + 0.2δ ( n − 2)

7
Design Objective

The design objective of the FIR filter is to obtain the bi


coefficients such that the magnitude frequency response
of the FIR filter will approximate the desired magnitude
frequency response, such as that of a lowpass, highpass,
bandpass, or bandstop filter.

8
Fourier Transform Design
Table 7.1: Summary of Ideal Impulse
Responses for Standard FIR Filters
Filter Type Ideal Impulse Response h(n)
 Ωc
 π , n=0
Lowpass: h( n ) = 
 sin(Ω c n) , n ≠ 0
 nπ
 π − Ωc
 , n=0
Highpass: h ( n) = 
π
 − sin(Ω c n) , n ≠ 0
 nπ
Frequency response of an  ΩH − ΩL
 , n=0
ideal lowpass filter Bandpass: h(n) = 
π
 sin(Ω H n) − sin(Ω L n) , n ≠ 0
 nπ
 π − (Ω H − Ω L )
 , n=0
Bandstop: h(n) = 
π
 − sin(Ω H n) + sin(Ω L n) , n ≠ 0
9  nπ
Example 2

Consider a 3-tap FIR lowpass filter with a cutoff


frequency of 800 Hz and a sampling rate of 8,000 Hz.
(a) Calculate the filter coefficients using the Fourier
transform method.
(b) Determine the transfer function and difference
equation of the designed FIR system.
(c) Determine the magnitude frequency response and
phase response of the system.

10
Solution

Cutoff frequency, fc = 800 Hz


Sampling rate, fs = 8000 Hz
Sampling time, Ts = 1/8000 s
Normalized cutoff frequency,
fc 800
Ω c = 2π f cTs = 2π = 2π × = 0.2π radians
fs 8000

11
The ideal impulse response for standard FIR lowpass
filter is given by  Ωc
 , n=0
 π
h( n) = 
 sin(Ω c n) , n ≠ 0
 nπ
0.2π
h(n = 0) = = 0.2
π
sin(0.2nπ )
For n ≠ 0, h(n) =

sin(0.2π )
h(1) = = 0.1871
π
Theoretically h(n) exists for -∞ < n < ∞ and is
symmetrical about n = 0, i.e. h(n) = h(-n).
Using the symmetry leads to h(-1) = h(1) = 0.1871.
The impulse response is truncated.
12
To remedy the non-causality, we delay the truncated
impulse response h(n) by M samples to yield the
following causal FIR filter:

H ( z ) = b0 + b1 z −1 + ... + b2 M z −2 M

where the delay operation is given by


bn = h(n − M ) for n = 0,1,..., 2 M
2 M + 1 = number of taps

Q 2M + 1 = 3 ∴ M = 1
b0 = h(0 − 1) = h(−1) = 0.1871
b1 = h(0) = 0.2
b2 = h(1) = 0.1871
13
(b) The transfer function is
H ( z ) = b0 + b1 z −1 + b2 z −2 = 0.1871 + 0.2 z −1 + 0.1871z −2
Y ( z)
= 0.1871 + 0.2 z −1 + 0.1871z −2
X ( z)
Y ( z ) = 0.1871X ( z ) + 0.2 z −1 X ( z ) + 0.1871z −2 X ( z )

Applying the inverse z-transform on both sides, the


difference equation is

y ( n) = 0.1871x(n) + 0.2 x( n − 1) + 0.1871x( n − 2)

14
(c) Substituting z = e jΩ into H ( z )
it follows that H (e jΩ ) = 0.1871 + 0.2e − jΩ + 0.1871e − j 2 Ω
= e − jΩ (0.1871e jΩ + 0.2 + 0.1871e − jΩ )
= e − jΩ (0.2 + 0.3742 cos Ω)
The magnitude frequency response is found to be
H (e jΩ ) = 0.2 + 0.3742 cos Ω

The phase response is found to be


jΩ  −Ω if 0.2 + 0.3742 cos Ω > 0
∠H (e ) = 
−Ω + π if 0.2 + 0.3742 cos Ω < 0

15
Example 3

Consider a 5-tap FIR bandpass filter with a lower cutoff


frequency of 2,000 Hz and an upper cutoff frequency of
2,400 Hz and a sampling rate of 8,000 Hz.
(a) Calculate the filter coefficients.
(b) Determine the transfer function and difference
equation of the designed FIR system.
(c) Determine the magnitude frequency response and
phase response of the system.

16
Solution
Sampling rate, fs = 8000 Hz
Sampling time, Ts = 1/8000 s
Lower cutoff frequency, fL = 2000 Hz
Normalized lower cutoff frequency,
fL 2000
Ω L = 2π f LTs = 2π = 2π × = 0.5π radians
fs 8000
Upper cutoff frequency, fH = 2400 Hz
Normalized upper cutoff frequency,
fH 2400
Ω H = 2π f H Ts = 2π = 2π × = 0.6π radians
fs 8000

17
The ideal impulse response for standard FIR bandpass
filter is given by
 ΩH − ΩL
 , n=0
h( n) = 
π
 sin(Ω H n) − sin(Ω L n) , n ≠ 0
 nπ
Ω − Ω L 0.6π − 0.5π
h(0) = H = = 0.1
π π
sin(0.6π ) − sin(0.5π ) 0.95106 − 1
h(1) = = = −0.01558
π π
sin(1.2π ) − sin(π ) −0.58779 − 0
h(2) = = = −0.09355
2π 2π
Theoretically h(n) exists for -∞ < n < ∞ and is
symmetrical about n = 0, i.e. h(n) = h(-n).
Using the symmetry leads to h(-1) = h(1) = -0.01558,
h(-2) = h(2) = -0.09355. 18
The delay operation is given by bn = h(n − M ) for n = 0,1,..., 2 M
Q 2M + 1 = 5
∴M = 2
Delaying h(n) by M = 2 samples gives
b0 = h(0 − 2) = h( −2) = −0.09355
b1 = h(1 − 2) = h( −1) = −0.01558
b2 = h(2 − 2) = h(0) = 0.1
b3 = h(3 − 2) = h(1) = −0.01558
b4 = h(4 − 2) = h(2) = −0.09355

19
(b) The transfer function is
Y ( z)
H ( z) = = b0 + b1z −1 + b2 z −2 + b3 z −3 + b4 z −4
X ( z)
Y ( z)
= −0.09355 − 0.01558 z −1 + 0.1z −2 − 0.01558 z −3 − 0.09355 z −4
X ( z)
Y ( z ) = −0.09355 X ( z ) − 0.01558 z −1 X ( z ) + 0.1z −2 X ( z )
− 0.01558 z −3 X ( z ) − 0.09355 z −4 X ( z )

Applying the inverse z-transform on both sides, the


difference equation is
y (n) = −0.09355 x(n) − 0.01558 x(n − 1) + 0.1x(n − 2)
− 0.01558 x(n − 3) − 0.09355 x(n − 4)

20
jΩ
Substituting z = e into H ( z )
it follows that
H (e jΩ ) = −0.09355 − 0.01558e − jΩ + 0.1e− j 2 Ω − 0.01558e − j 3Ω − 0.09355e − j 4 Ω
= e − j 2 Ω (−0.09355e j 2 Ω − 0.01558e jΩ + 0.1 − 0.01558e − jΩ − 0.09355e− j 2 Ω )
= e − j 2 Ω ( 0.1 − 0.03116 cos Ω − 0.1871cos(2Ω) )

The magnitude frequency response is found to be

H (e jΩ ) = 0.1 − 0.03116 cos Ω − 0.1871cos(2Ω)

The phase response is found to be


jΩ −2Ω if 0.1 − 0.03116 cos Ω − 0.1871cos(2Ω) > 0
∠H (e ) = 
−2Ω + π if 0.1 − 0.03116 cos Ω − 0.1871cos(2Ω) < 0

21
Gibbs Effect

The oscillations (ripples) exhibited in the passband


(main lobe) and stopband (side lobes) of the magnitude
frequency response constitute the Gibbs effect. The
Gibbs oscillatory behaviour originates from the abrupt
truncation of the infinite-length coefficient sequence. To
remedy this problem, window functions will be used.

22
Gibbs Effect

Frequency responses of lowpass FIR filters with 3 coefficients (dashed-


dotted line) and 17 coefficients (solid line)
23
Window Method
The window method (Fourier transform design with
window functions) is developed to remedy the
undesirable Gibbs oscillations in the passband and
stopband of the designed FIR filter.
Applying the window sequence to the filter coefficients
gives
hw (n) = h(n) ⋅ w( n)

where w(n) designates the window function.


Applying the window to remedy the Gibbs effect will
change the characteristics of the magnitude frequency
response of the FIR filter, as the width of the main lobe
becomes wider and more attenuation of the side lobes
occurs. 24
Table 7.7: FIR Filter Length Estimation
Using Window Functions
Window Function Window Passband Stopband
Window Type
w(n), − M ≤ n ≤ M Length Ripple (dB) Attenuation (dB)
0.9
Rectangular 1 N= 0.7416 21
∆f
 nπ  3.1
Hanning 0.5 + 0.5cos   N= 0.0546 44
M  ∆f
 nπ  3.3
Hamming 0.54 + 0.46 cos   N= 0.0194 53
M  ∆f
 nπ 
0.42 + 0.5cos  
 M  5.5
Blackman N= 0.0017 74
 2nπ  ∆f
+0.08cos  
 M 
∆f denotes the normalized transition width
25
Shapes of window functions for the case of 2M+1=81. “o” line,
triangular window; “+” line, Hanning window; solid line, Hamming
window; dashed line, Blackman window.
26
27
Example 4

Given the calculated filter coefficients h(0) = 0.25, h(-1)


= h(1) = 0.22508, h(-2) = h(2) = 0.15915, h(-3) = h(3) =
0.07503, apply the Hamming window function to obtain
windowed coefficients hw(n).

28
Solution  nπ 
M = 3, wham ( n) = 0.54 + 0.46 cos  
 3 
 −3π 
wham ( −3) = 0.54 + 0.46 cos   = 0.08
 3 
 −2π 
wham ( −2) = 0.54 + 0.46 cos   = 0.31
 3 
 −π 
wham ( −1) = 0.54 + 0.46 cos   = 0.77
 3 
wham (0) = 0.54 + 0.46 cos ( 0 ) = 1
π 
wham (1) = 0.54 + 0.46 cos   = 0.77
3
 2π 
wham (2) = 0.54 + 0.46 cos   = 0.31
 3 
 3π 
wham (3) = 0.54 + 0.46 cos   = 0.08
29  3 
Applying the Hamming window function and its
symmetric property to the filter coefficients, we get
hw (0) = h(0) ⋅ wham (0) = 0.25 × 1 = 0.25
hw ( −1) = hw (1) = h(1) ⋅ wham (1) = 0.22508 × 0.77 = 0.17331
hw ( −2) = hw (2) = h(2) ⋅ wham (2) = 0.15915 × 0.31 = 0.04934
hw ( −3) = hw (3) = h(3) ⋅ wham (3) = 0.07503 × 0.08 = 0.00600

30
Example 5

Consider a 3-tap FIR lowpass filter with a cutoff


frequency of 800 Hz and a sampling rate of 8,000 Hz.
(a) Calculate the filter coefficients using the Hamming
window function.
(b) Determine the transfer function and difference
equation of the designed FIR system.
(c) Determine the magnitude frequency response and
phase response of the system.

31
Solution  Ωc
n=0
 π ,
h( n) = 
 sin(Ω c n) , n ≠ 0
 nπ
0.2π
h(n = 0) = = 0.2
Cutoff frequency, fc = 800 Hz π
sin(0.2nπ )
Sampling rate, fs = 8000 Hz For n ≠ 0, h(n) =

Sampling time, Ts = 1/8000 s h(1) =
sin(0.2π )
= 0.1871
π
Normalized cutoff frequency,
fc 800
Ω c = 2π f cTs = 2π = 2π × = 0.2π radians
fs 8000

h(-1) = h(1) = 0.1871

32
Q 2M + 1 = 3
∴M =1
Applying the Hamming window function,
 nπ 
wham (n) = 0.54 + 0.46 cos  
 1 
wham (0) = 0.54 + 0.46 cos ( 0 ) = 1
wham (1) = 0.54 + 0.46 cos (π ) = 0.08
Using the symmetry of the window function gives
wham ( −1) = wham (1) = 0.08

The windowed impulse response is calculated as


hw (0) = h(0) ⋅ wham (0) = 0.2 × 1 = 0.2
hw ( −1) = hw (1) = h(1) ⋅ wham (1) = 0.1871× 0.08 = 0.01497
33
bn = hw ( n − M ) for n = 0,1,..., 2 M

Delaying hw(n) by M = 1 sample gives


b0 = hw (0 − 1) = hw ( −1) = 0.01497
b1 = hw (0) = 0.2
b2 = hw (1) = 0.01497
(b)
H ( z ) = b0 + b1 z −1 + b2 z −2 = 0.01497 + 0.2 z −1 + 0.01497 z −2
Y ( z)
= 0.01497 + 0.2 z −1 + 0.01497 z −2
X ( z)
Y ( z ) = 0.01497 X ( z ) + 0.2 z −1 X ( z ) + 0.01497 z −2 X ( z )

y ( n) = 0.01497 x(n) + 0.2 x(n − 1) + 0.01497 x(n − 2)

34
jΩ
(c) Substituting z = e into H ( z )
it follows that H (e jΩ ) = 0.01497 + 0.2e − jΩ + 0.01497e − j 2 Ω
= e − jΩ (0.01497e jΩ + 0.2 + 0.01497e − jΩ )
= e − jΩ (0.2 + 0.02994 cos Ω)

The magnitude frequency response is found to be


H (e jΩ ) = 0.2 + 0.02994 cos Ω

The phase response is found to be

jΩ −Ω if 0.2 + 0.02994 cos Ω > 0


∠H (e ) = 
−Ω + π if 0.2 + 0.02994 cos Ω < 0

35
| f stop − f pass |
Normalized transition band, ∆f =
fs
f pass + f stop
Cutoff frequency, f c =
2
Passband ripple, δ p dB = 20 log10 (1 + δ p )
Stopband attenuation, δ s dB = −20 log10 (δ s )
36
Example 6

A lowpass FIR filter has the following specifications:


Passband 0 – 1850 Hz
Stopband 2150 – 4000 Hz
Stopband attenuation 20 dB
Passband ripple 1 dB
Sampling rate 8000 Hz
Determine the window method, the FIR filter length,
and the cutoff frequency to be used in the design.

37
Solution
A rectangular window results in a passband ripple of
0.74 dB and stopband attenuation of 21 dB. Selecting a
rectangular window will satisfy the design requirement.
The normalized transition band is given by
| f stop − f pass | 2150 − 1850
∆f = = = 0.0375
fs 8000
0.9 0.9
N= = = 24
∆f 0.0375
We choose the smallest odd number that is larger than
24, i.e. N = 25.
1850 + 2150
fc = = 2000 Hz
2
38
Chapter 3(b): Infinite Impulse Response
(IIR) Filter Design

39
Infinite Impulse Response (IIR) Filter
An IIR filter is described using the following difference
equation:
y (n) = b0 x(n) + b1 x(n − 1) + ... + bM x(n − M )
−a1 y (n − 1) − ... − aN y (n − N )
M N
y (n) =  bi x(n − i ) −  a j y (n − j )
i =0 j =1

where bi, 0 ≤ i ≤ M, and aj, 1 ≤ j ≤ N, represent the


coefficients of the system and n is the time index.
The IIR filter transfer function is given by
Y ( z ) b0 + b1 z −1 + ... + bM z − M
H ( z) = =
X ( z ) 1 + a1 z −1 + ... + aN z − N
40
Example 7

Given the IIR filter


y(n) = 0.2x(n) + 0.4x(n - 1) + 0.5y(n - 1)
Determine the transfer function, nonzero coefficients,
and impulse response.

41
Solution

Applying the z-transform on both sides of the difference


equation yields
Y ( z ) = 0.2 X ( z ) + 0.4 z −1 X ( z ) + 0.5 z −1Y ( z )
The transfer function that depicts the IIR filter is
Y ( z ) 0.2 + 0.4 z −1
H ( z) = =
X ( z) 1 − 0.5 z −1
The filter coefficients are b0 = 0.2, b1 = 0.4, and
a1 = -0.5. Using the inverse z-transform and shift
theorem, we obtain the impulse response as
h( n) = 0.2(0.5) n u ( n) + 0.4(0.5) n −1 u ( n − 1)

42
Bilinear Transformation (BLT) Design
Method

43
Bilinear Transformation (BLT) Design Method

44
Transformation by Lowpass Prototype
Filter

This method converts an analog lowpass filter with a


cutoff frequency of 1 radians/second, called the lowpass
prototype, into practical analog lowpass, highpass,
bandpass, and bandstop filters with specified
frequencies.

45
Analog Filters Using Lowpass Prototype
Transformation
Analog
lowpass
prototype
to lowpass
filter

Analog
lowpass
prototype
to highpass
filter

46
Analog
lowpass
prototype
to
bandpass
filter

Analog
lowpass
prototype
to
bandstop
filter
47
Table 8.1: Analog Lowpass Prototype Transformations

Filter Type Prototype Transformation


s
Lowpass , ωc is the cutoff frequency
ωc
ωc
Highpass , ωc is the cutoff frequency
s
s 2 + ω0 2
Bandpass , ω0 = ωlωh ,W = ωh − ωl
sW
sW
Bandstop 2 2
, ω0 = ωlωh ,W = ωh − ωl
s + ω0

48
Example 8

Given a lowpass prototype


1
H P (s) =
s +1

determine each of the following analog filters:


(a) A highpass filter with a cutoff frequency of 40 rad/s.
(b) A bandpass filter with a center frequency of 100
rad/s and a bandwidth of 20 rad/s.

49
Solution

(a) In order to obtain an analog highpass filter by


applying the lowpass prototype transformation,
we substitute
ωc 40
s= =
s s
into the lowpass prototype giving

1 s
H HP ( s ) = =
40
+ 1 s + 40
s

50
Solution

(b) In order to obtain an analog bandpass filter by


applying the lowpass prototype transformation, we
substitute the following into the lowpass prototype:
2 2
s + ω0
s=
sW
s 2 + 1002
=
20s
1 20 s
As a result, H BP ( s ) = 2 2
= 2
s + 100 s + 20 s + 10000
+1
20 s

51
Bilinear Transformation (BLT) and
Frequency Warping
The BLT method is a mapping or transformation of
points on the s-plane to the z-plane, which is given in
either one of the following equations:

2 z −1
s= ⋅
T z +1
1 + sT / 2
z=
1 − sT / 2

T denotes the sampling period.

52
Mapping between the s-plane and the
z-plane by the bilinear transformation

53
Example 9

Given an analog filter whose transfer function is

10
H ( s) =
s + 10
convert it to the digital filter transfer function and obtain
the difference equation when the sampling period is
T = 0.01 s.

54
Solution
2 z −1 10
Substitute with s = ⋅ , we have H ( z ) = 2 z − 1
T z +1 ⋅ + 10
T z +1
1
H ( z) =
z −1
20 +1
z +1
z +1
=
21z − 19
1
+ 1
= 21 1921z
1 − 21z
0.0476 + 0.0476 z −1
=
1 − 0.9048 z −1
55
The difference equation is found as follows:

Y ( z ) 0.0476 + 0.0476 z −1
=
X ( z) 1 − 0.9048 z −1
(1 − 0.9048 z −1 )Y ( z ) = (0.0476 + 0.0476 z −1 ) X ( z )
y (n) − 0.9048 y (n − 1) = 0.0476 x(n) + 0.0476 x( n − 1)
y (n) = 0.0476 x(n) + 0.0476 x(n − 1) + 0.9048 y (n − 1)

56
Let ωa denote the analog frequency marked on the jω-axis on
the s-plane, and ωd denote the digital frequency marked on
the unit circle in the z-plane.
jωd T
2 e −1
jωa = . jω T
T e d +1
2  ωd T 
ωa = tan 
T  2 
2 −1  ωaT 
ωd = tan  
T  2 

57
Frequency Warping from Bilinear
Transformation

58
Bilinear Transformation (BLT) Design
Procedure
1. Given the digital filter frequency specifications,
prewarp the digital frequency specifications to the
analog frequency specifications.
2  ωd T 
ωa = tan  
T  2 
2. Perform the prototype transformation using the
lowpass prototype HP(s) (as tabulated in Table 8.1).
3. Substitute the BLT to obtain the digital filter.
H ( z ) = H ( s) | 2 z −1
s= ⋅
T z +1

59
60
Example 10

The normalized lowpass filter with a cutoff frequency of


1 rad/s is given by
1
H P ( s) =
s +1
Use BLT to design a corresponding digital IIR lowpass
filter with a cutoff frequency of 15 Hz and a sampling
frequency of 90 Hz.

61
Solution
ωd = 2πf = 2π(15) = 30π rad/s, and T = 1/fs = (1/90) s
1. 2  ωd T 
ωa = tan  
T  2 
 30π 
= 180 tan  
 180 
= 60 3
= 103.92 rad/s
2. 1 ωa
H ( s) = H P ( s) | s = s =
s=
ωa ωa + 1 s + ωa

60 3
H (s) =
s + 60 3
62
3.
H ( z ) = H ( s ) s = 2 . z −1
T z +1
z +1
60 3 =
= (1 + 3 ) z + 1 − 3
2 z −1
. + 60 3 1 1
T z +1 + z −1
3 = 1+ 3 1+ 3
= 1 − 3 −1
z −1 1+ z
3. + 3 1+ 3
z +1
z +1 0.3660 + 0.3660 z −1
= =
3 ( z − 1) + z + 1 1 − 0.2679 z −1

63
Digital Butterworth and Chebyshev
Filter Designs

64
Butterworth Filter
First described by the British engineer, Stephen
Butterworth in 1930.
Designed to have a frequency response which is as flat
as mathematically possible in the passband.
Also known as maximally flat magnitude filters.
Maximally flat – no ripples in passband and rolls off
towards zero in stopband.
Has a monotonically changing magnitude function with
ω.
Is the only filter that maintains this same shape for
higher orders (but with a steeper decline in the
stopband).
65
Butterworth filter is characterised by the magnitude
function
2 1
H (ω ) = where n = filter order
1 + ω 2n
The magnitude is a monotonic decreasing function of ω,
with its maximum value of unity occurring at ω = 0.

1
For ω = 1, the magnitude is equal to H (ω ) = for
all n. 2

Thus, the normalised Butterworth filter has a 3dB cutoff


frequency of unity.

66
Plot of the gain of Butterworth lowpass filters of orders
1 to 5. Note that the slope is -20n dB/decade where n is
the filter order. 67
The magnitude of transfer function for Butterworth approximation is
1
H ( jω ) =
1 + ε 2ω 2n

where ε is the ripple parameter or the absolute ripple specification.

Normalising the frequency ω about the passband edge frequency ω p gives


1
H ( jω ) =
2n
2 ω 
1 + ε  
 ωP 
  
2n 
 2 ω  
The attenuation can then be obtained as: A = 10 log 1 + ε
 ωp  
   

68
With the given passband ripple Ap dB at the normalized
passband frequency edge vp = 1,

(
Ap = 10 log 1 + ε 2 ) vp =
ωp
2 0.1 Ap ωp
ε = 10 −1

With the stopband attenuation As dB at the normalized


stopband frequency edge vs,

(
As = 10 log 1 + ε 2vs2n ) vs =
ωs
ε 2vs2n = 100.1As − 1 ωp

69
100.1 As − 1 100.1 As − 1
vsn = 0. 1 A p
=
10 −1 ε2
0.1 As
10 −1
20 log10
n= ε2
20 log10 (vs )
 100.1 As − 1 
log10  
 ε 2 
n≥  
2 log10 (vs )

70
Table 8.3: 3-dB Butterworth Lowpass
Prototype Transfer Functions (ε = 1)

n H P (s)
1
1
s +1
1
2
s 2 + 1.4142s + 1
1
3
s3 + 2s 2 + 2s + 1

71
Chebyshev Filter
Is named in honor of Pafnuty Chebyshev because their
mathematical characteristics are derived from
Chebyshev polynomials.

Are analog/digital filters having steeper roll-off and


more passband ripple (type 1) than Butterworth filters.

Thus, for filters with same order, Chebyshev filter has a


smaller transition bandwidth than Butterworth filter.

72
Chebyshev type 2
Not covered in this course

73
1
Chebyshev approximation H ( jω ) =
1 + ε 2Cn2 (ω )

In Chebyshev approximation, the polynomial Cn(ω) is

(
Cn (ω ) = cos n cos −1 ω ; ) | ω |≤ 1

and (
Cn (ω ) = cosh n cosh −1 ω ; ) | ω |> 1

where n = order of filter.


For example, for n = 0 and n = 1, the polynomials are

n = 0, C0(ω) = 1
n = 1, C1(ω) = ω
1 x
cosh x = (e + e − x )
2
cosh −1 x = ln( x + x 2 − 1); x ≥ 1
74
With the given passband ripple Ap dB at the normalized
passband frequency edge vp = 1,

( ) (
Ap = 10 log 1 + ε 2Cn2 (1) = 10 log 1 + ε 2 )
2 0.1 Ap
ε = 10 −1

With the stopband attenuation As dB at the normalized


stopband frequency edge vs,

(
As = 10 log 1 + ε 2Cn2 (vs ) )
ε 2Cn2 (vs ) = 100.1As − 1

75
100.1 As − 1 100.1 As − 1
C n (v s ) = 0.1 Ap
=
10 −1 ε2
100.1 As − 1
cosh( n cosh −1 vs ) =
ε2
100.1 As − 1
n cosh −1 vs = cosh −1 2
ε
 100.1 As − 1 
cosh −1  
 ε 2 
n≥  
cosh −1 (vs )

76
Table 8.4: Chebyshev
Lowpass Prototype
Transfer Functions with
0.5 dB Ripple (ε =
0.3493)

n H P ( s)
2.8628
1
s + 2.8628
1.4314
2
s 2 + 1.4256s + 1.5162
0.7157
3 3
s + 1.2529s 2 + 1.5349s + 0.7157

77
Table 8.5: Chebyshev
Lowpass Prototype
Transfer Functions with 1
dB Ripple (ε = 0.5088)

n H P (s)
1.9652
1
s + 1.9652
0.9826
2
s 2 + 1.0977 s + 1.1025
0.4913
3
s 3 + 0.9883s 2 + 1.2384s + 0.4913

78
Table 8.6: Conversion from Analog Filter
Specifications to Lowpass Prototype Specifications
Analog Filter Specifications Lowpass Prototype Specifications
ωas
Lowpass: ωap , ωas vs =
ωap
ωap
Highpass: ωap , ωas vs =
ωas
Bandpass: ωapl , ωaph , ωasl , ωash ωash − ωasl
vs =
ω0 = ωaplωaph , ω0 = ωaslωash ωaph − ωapl
Bandstop: ωapl , ωaph , ωasl , ωash ωaph − ωapl
vs =
ω0 = ωaplωaph , ω0 = ωaslωash ωash − ωasl

ωap , passband frequency edge; ωas , stopband frequency edge


ωapl , lower cutoff frequency in passband; ωaph , upper cutoff frequency in passband
ωasl , lower cutoff frequency in stopband; ωash , upper cutoff frequency in stopband
ω0 , geometric center frequency
79
Specifications for analog lowpass and bandpass filters

80
Example 11

Design a digital lowpass Butterworth filter with the


following specifications:
1. 3-dB attenuation at the passband frequency of 1.5
kHz
2. 10-dB stopband attenuation at the frequency of 3 kHz
3. Sampling frequency of 8,000 Hz

81
Solution

First, we obtain the digital frequencies in rad/s:


ωdp = 2πf = 2π(1500) = 3000π rad/s
ωds = 2π(3000) = 6000π rad/s
T = 1/fs = (1/8000) s
We then follow the design procedure steps.
1. We apply the warping equation as follows:

2  ωdpT  2  ωdsT 
ωap = tan   ωas = tan  
T  2  T  2 
 3000π   6000π 
= 16000 tan  = 16000 tan  
  16000 
 16000 
= 1.0691× 10 4 rad/s 82
= 3.8627 × 104 rad/s
From Table 8.6, we find the lowpass prototype
specifications as follows:
ωas 3.8627
vs = = = 3.6130
ωap 1.0691
Ap = 3 dB is given in the question.
The absolute ripple parameter is found as
0.1 Ap
ε 2 = 10 −1
ε =1

83
As = 10 dB is given in the question.
The Butterworth lowpass prototype with order n is
given as
 10 0.1 As − 1 
log10  
 ε 2 
n≥  
2 log10 (vs )
 10 0.1(10) − 1 
log10  
 1 
n≥   = 0.8553
2 log10 (3.6130)

84
2. Rounding n up, we choose n = 1 for the lowpass
prototype. From Table 8.3, we have

1
H P (s) =
s +1

Applying the prototype transformation (lowpass to


lowpass) yields the analog filter

1 ω ap 1.0691× 10 4
H ( s) = H P ( s) | s = s = = 4
s=
ωap ωap
+ 1 s + ω ap s + 1.0691 × 10

85
3. Finally, using the BLT, we have
H ( z ) = H ( s) | 2 z −1
s= ⋅
T z +1

1.0691×104
=
2 z −1
⋅ + 1.0691× 104
T z +1
1.0691
=
 z −1 
1.6   + 1.0691
 z +1 
1.0691z + 1.0691
=
1.6 z − 1.6 + 1.0691z + 1.0691
1.0691z + 1.0691
=
2.6691z − 0.5309
0.4005 + 0.4005 z −1
=
1 − 0.1989 z −1
86
Example 12

Design a highpass digital Chebyshev filter with the


following specifications:
1. 0.5 dB ripple on the passband at a frequency of 3 kHz
2. 25 dB attenuation at a frequency of 1 kHz
3. Sampling frequency of 8,000 Hz

87
Solution
From the specifications, we obtain the digital
frequencies in rad/s as follows:
ωdp = 2πf = 2π(3000) = 6000π rad/s
ωds = 2π(1000) = 2000π rad/s
T = 1/fs = (1/8000) s
1. Using the design procedure, it follows that
2  ωdpT  2 ω T 
ωap = tan   ωas = tan  ds 
T  2  T  2 
 6000π   2000π 
= 16000 tan   = 16000 tan  
 16000   16000 
= 3.8627 × 10 4 rad/s = 6.6274 × 103 rad/s
88
From Table 8.6, we find the lowpass prototype
specification (that corresponds to highpass analog filter
specification) as follows:
ωap 3.8627 ×104
vs = = 3
= 5.8284
ωas 6.6274 ×10
Ap = 0.5 dB is given in the question.
2 0.1 Ap
ε = 10 − 1 = 0.1220

89
As = 25 dB is given in the question.
The Chebyshev lowpass prototype with order n is given
as  100.1 A − 1 
s

cosh  −1

 ε 2

n≥  
cosh −1 (vs )
 100.1(25) − 1 
cosh  −1

 0.1220 
= 
cosh −1 (5.8284)
cosh −1 (50.8314)
=
cosh −1 (5.8284)

=
(
ln 50.8314 + 50.83142 − 1 )
(
ln 5.8284 + 5.82842 − 1 )
= 1.8875 90
2. Rounding n up, we choose n = 2 for the lowpass
prototype. From Table 8.4, we have
1.4314
H P (s) =
s 2 + 1.4256 s + 1.5162

H ( s) = H P (s) | ωap
s=
Applying the prototype s

1.4314
transformation (lowpass = 2 ωap
s + 1.4256 s + 1.5162 s=
s
to highpass) yields the 1.4314
= 2
analog filter  ωap   ωap 
  + 1.4256   + 1.5162
 s   s 
1.4314 s 2
=
ωap 2 + 1.4256ωap s + 1.5162s 2
0.9441s 2
= 2
91 s + 3.6319 ×104 s + 9.8407 ×108
H ( z ) = H (s) | 2 z −1
3. Using the s= ⋅
T z +1

BLT, convert 0.9441s 2


= 2
s + 3.6319 ×104 s + 9.8407 ×108 s =16000×
z −1

the analog z +1

2
 z −1 
filter to the 0.9441 16000 × 
=  z +1 
2
digital filter 
 16000 ×
z −1 
 + 3.6319 × 10 4
× 16000 ×
z −1
+ 9.8407 ×108
 z +1  z +1
2
 z −1 
0.9441 
=  z +1 
2
 z −1  z −1
  + 2.2699 × + 3.8440
 z +1  z +1
0.9441( z − 1) 2
=
( z − 1)2 + 2.2699( z 2 − 1) + 3.8440( z + 1)2
0.9441( z 2 − 2 z + 1)
= 2
z − 2 z + 1 + 2.2699 z 2 − 2.2699 + 3.8440( z 2 + 2 z + 1)
0.9441( z 2 − 2 z + 1)
=
7.1139 z 2 + 5.688 z + 2.5741
0.1327 − 0.2654 z −1 + 0.1327 z −2
=
1 + 0.7996 z −1 + 0.3618 z −2
92
Impulse-Invariant Design Method

93
Impulse-Invariant Design Method

• Given the transfer function of a designed analog filter,


an analog impulse response can be easily found by the
inverse Laplace transform of the transfer function.
• To replace the analog filter by the equivalent digital
filter, we apply an approximation in the time domain in
which the digital filter impulse response must be
equivalent to the analog impulse response.
• Therefore, we can sample the analog impulse response
to get the digital impulse response, and take the z-
transform of the sampled analog impulse response to
obtain the transfer function of the digital filter.

94
Impulse-Invariant Design Method

95
Why is there a need to scale the impulse response by T?

Area under the curve indicates the DC gain.

Rectangular approximation is used.

The higher the sampling rate, the smaller the sampling


interval, the more accurately the digital filter gain
matches the analog filter gain.
96
Laplace Transform Table
Time Function x(t ) Laplace Transform X ( s ) = L ( x(t ) )
δ (t ) 1
1
1 or u (t )
s
1
tu (t )
s2
1
e − at u (t )
s+a
ω
sin(ωt )u (t )
s2 + ω 2
s
cos(ωt )u (t )
s2 + ω 2
s sin θ + ω cos θ
sin(ωt + θ )u (t )
s2 + ω 2
ω
e − at sin(ωt )u (t )
( s + a)2 + ω 2
s+a
e − at cos(ωt )u (t )
( s + a)2 + ω 2
97
Example 13

Consider the following Laplace transfer function:


2
H (s) =
s+2
Determine H(z) using the impulse-invariant method if
the sampling rate fs = 10 Hz.

98
Solution
Taking the inverse Laplace transform of the analog
transfer function,
h(t ) = 2e−2t u (t )

Sampling the impulse response h(t) with T = 1/fs = 1/10


= 0.1 s,
T ⋅ h(n) = T ⋅ 2e −2 nT u (nT ) = 0.2e −0.2 nu (n)

Using the z-transform table,


n 1
Z (a u (n)) =
1 − az −1
0.2 0.2
H ( z) = =
1 − e −0.2 z −1 1 − 0.8187 z −1

99
Application Examples of Digital Filters

1. Digital speech and audio equalizer


2. Pre-emphasis of speech
3. Echo cancellation
4. 60-Hz hum eliminator that helps enhance
electrocardiography (ECG) signal
5. Generation and detection of dual-tone multifrequency
(DTMF) signals used for telephone touch keypads

100

You might also like