Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

DSP Module 5

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

MODULE - IV

IIR Filter Design: Infinite Impulse response Filter Format, Bilinear Transformation Design
Method, Analog Filters using Lowpass prototype transformation, Normalized Butterworth
Functions, Bilinear Transformation and Frequency Warping, Bilinear Transformation Design
Procedure, Digital Butterworth Filter Design using BLT. Realization of IIR Filters in Direct
form I and II.

4.1 Introduction
The filters designed by considering all the infinite samples of impulse response are called
infinite impulse response (IIR) filters. The IIR filter is a recursive filter in that the output
from the filter is computed by using the current and previous inputs and previous outputs. In
digital domain, the processing of infinite samples of impulse response is practically not pos-
sible. Hence direct design of IIR filter is not possible. Therefore, the IIR filters are designed
via analog filters. In design of IIR filter, the specification of an IIR filter is transformed to
specification of an analog filter and an analog filter with transfer function, H(s) is designed
to satisfy the specification. Then the analog filter is transformed to digital filter with transfer
function, H(z).
IIR filters can be designed using different methods. One of the most commonly used is via
the reference analog prototype filter. This method is the best for designing all standard types
of filters such as low-pass, high-pass, band-pass and band-stop filters. Fig. 4.1 illustrates the
block diagram of this method. The IIR filter transfer function is a ratio of two polynomials of
complex variable. The numerator defines location of zeros, whereas the denominator defines
location of poles of the resulting IIR filter transfer function.

Analog
Analog
Prototype Digital
Filter
Filter Filter

Fig. 4.1. Block diagram of design method using reference analog prototype filter.

112
Digital Signal Processing 113

4.2 IIR Filter Format


The general IIR difference equation is of the form:

N
X M
X
y[n] = − al y[n − l] + bk x[n − k]
l=1 k=0

y[n] = −a1 y[n − 1] − a2 y[n − 2] − · · · − aN y[n − N ] + b0 x[n] + b1 x[n − 1] + · · · + bM x[n − M ]


Applying z-transform
Y [z] = −a1 z −1 Y [z] − a2 z −2 Y [z] − · · · − aN z −N Y [z] + b0 X[z] + b1 z −1 X[z] + · · · + bM z −M X[z]
Y [z] + a1 z −1 Y [z] + a2 z −2 Y [z] + · · · + aN z −N Y [z] = b0 X[z] + b1 z −1 X[z] + · · · + bM z −M X[z]
   
Y [z] −a1 z −1 + a2 z −2 + · · · + aN z −N = X[z] b0 + b1 z −1 + · · · + bM z −M
Y [z] b0 + b1 z −1 + · · · + bM z −M
= H(z) =
X[z] 1 + a1 z −1 + a2 z −2 + · · · + aN z −N
Also, we assume that a0 = 1.

Example 4.1: Determine the transfer function, nonzero coefficients, and impulse response for
the IIR filter defined as y(n) = 0.2x(n) + 0.4x(n − 1) + 0.5y(n − 1).

 Solution: Given, y(n) = 0.2x(n) + 0.4x(n − 1) + 0.5y(n − 1)


Applying the z-transform,

Y (z) = 0.2X(z) + 0.4z −1 X(z) + 0.5z −1 Y (z)


Y (z)[1 − 0.5z −1 ] = X(z)[0.2 + 0.4z −1 ]
Y (z) 0.2 + 0.4z −1
∴ T.F. = H(z) = =
X(z) 1 − 0.5z −1

comparing with the general difference equation,

Y (z) b0 + b1 z −1 + · · · + bM z −M
=
X(z) 1 + a1 z −1 + a2 z −2 + · · · + aN z −N
coefficients b0 = 0.2; b1 = 0.4 & a1 = −0.5.
Now rewrite the transfer function as

0.2 0.4z −1
H(z) = −1
+
1 − 0.5z 1 − 0.5z −1
114 Module-4

Using the inverse z-transform, we obtain the impulse response as

h(n) = 0.2(0.5)n u(n) + 0.4(0.5)n−1 u(n − 1)

The obtained impulse response has an infinite number of terms, where the first several terms
are calculated as

n = 0; h(0) = 0.2
n = 1; h(1) = 0.7
n = 2; h(0) = 0.25
and so on....
To design a stable and causal IIR filter, the following requirements are necessary:
• The IIR filter output y(n) depends not only on the current input x(n) and past inputs
x(n − 1), ..., but also on the past output(s) y(n − 1), ..., (recursive terms). The transfer
function (H(z)) should be a rational function of z, and the coefficients of z should be
real.

• The poles should lie inside the unit circle of the z-plane.

• The number of zeros should be less than or equal to the number of poles. For the
effective conversion from an analog filter to a digital one, the imaginary axis of the
s-plane should map into the unit circle of the z-plane.

• The left half of the s-plane should map into the inside of the unit circle of the z-plane.

4.3 Bilinear transformation Design Method


The bilinear transformation (BLT) is a conformal mapping that transforms the imaginary
axis of s-plane into the unit circle in the z-plane only once, thus avoiding aliasing of frequency
components. In this mapping all points in the left half of s-plane are mapped inside the unit
circle in the z-plane and all points in the right half of s-plane are mapped outside the unit
circle in the z-plane. Fig. 4.2 illustrates a flow chart of the BLT design. The design procedure
includes:
1. Transforming digital filter specifications into analog filter specifications.

2. Performing analog prototype filter design.

3. Applying BLT and verifying the frequency response.


Digital Signal Processing 115

Digital filter specifications


frequency warping

Analog filter specifications


lowpass prototype filter

Analog filter transfer function

BLTF

Digital filter transfer function

Fig. 4.2. General procedure for IIR filter design using BLT.

4.3.1 Analog Filters using Lowpass Prototype Transformation

All analog prototype filters, regardless of their type, converts an analog lowpass filter with
a cutoff frequency of 1 radians per second, called the lowpass prototype, into practical analog
lowpass, highpass, banspass, and bandstop filters with specified frequencies. Transformation
from an analog prototype filter to appropriate analog filter is performed before transforming
it in digital filter. Frequency scaling depends on the type of analog filter being designed.
Scaling is explained for low-pass, high-pass, band-pass and band-stop filters.

Filter Type Transformation


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

1
Example 4.2: Given a lowpass prototype HP (s) = s+1 . Perfrom the following,
(i) A lowpass filter with a cutoff frequency of 5 r/s.
(ii) A highpass filter with a cutoff frequency of 40 r/s.
(iii) A bandpass filter with a center frequency of 100 r/s and bandwidth of 20 r/s.

 Solution:
s
(i) Applying the lowpass prototype transformation by substituting s → 5 into the lowpass
116 Module-4

prototype, we obtain an analog lowpass filter:

1 5
HLP (s) = s = .
5 +1 s+5

40
(ii) Applying the lowpass prototype transformation by substituting s → s into the
lowpass prototype, we obtain an analog highpass filter:

1 s
HHP (s) = 40 = .
s +1 s + 40

s2 +100
(iii) Applying the lowpass prototype transformation by substituting s → 20s into the
lowpass prototype, we obtain an analog bandpass filter:

1 20s
HHP (s) = s2 +100
= .
20s +1 s2 + 20s + 100

4.3.2 Bilinear Transformation and Frequency Warping

Consider the first order differential equation of an analog system

dy
= x(t) (4.1)
dt

On integrating both sides of equation

dy
Z Z
= x(t)
dt
Z nT Z nT
dy(t)
= x(t)dt
(n−1)T dt (n−1)T
Z nT
[y(t)]nT
(n−1)T = x(t)dt
(n−1)T
Z nT
y(nT ) − y((n − 1)T ) = x(t)dt
(n−1)T

The integral on the right side of the above equation can be approximated by the trapezoidal
rule, so that,
T
y(nT ) − y((n − 1)T ) = [x(nT ) + x((n − 1)T )]
2
For discrete time system, the equation can be written as,

T
y(n) − y(n − 1) = [x(n) + x(n − 1)]
2
Digital Signal Processing 117

Applying z-transform, we get

T
Y (z) − z −1 Y (z) = [X(z) + z −1 X(z)]
2
T
Y (z)[1 − z −1 ] = X(z)[1 + z −1 ]
2
Y (z) T [1 + z −1 ]
= (4.2)
X(z) 2[1 − z −1 ]
Applying Laplace transform on eqn. (4.1), we get

sY (s) = X(s)

Y (s) 1
= (4.3)
X(s) s
Comparing eqns. (4.2) and (4.3), we get

1 T [1 + z −1 ]
=
s 2[1 − z −1 ]

2 [1 − z −1 ] 2 [z − 1]
∴s= = (4.4)
T [1 + z −1 ] T [z + 1]
The BLT method is a mapping or transformation of points on the s-plane to the z-plane.
Equation (4.4) can be alternatively written as

1 + sT /2
z=
1 − sT /2

The general mapping properties are summarized as:

• The left-half s-plane is mapped onto the inside of the unit circle of the z-plane.

• The right-half s-plane is mapped into the outside of the unit circle of the z-plane.

• As shown in the Fig. 4.3, the positive jω axis portion in the s-plane is mapped onto
the positive half circle on the unit circle, while the negative jω axis is mapped onto the
negative half circle on the unit circle.
118 Module-4

jw Im(z)

Stable region
σ Re(z)
0 0 1
Stable region

Fig. 4.3. Mapping between the s-plane and the z-plane by the BLT.

Example 4.3: Given,


(i) s = −1 + j, on the left half of the s-plane
(ii) s = 1 − j, on the right half of the s-plane
(iii) s = j, on the positive jω on the s-plane
(iv) s = −j, on the negative jω on the s-plane
Convert each of the points in the s-plane to the z-plane, and verify mapping properties.
Assume T = 2.

 Solution: We know that, z = 1+sT /2


1−sT /2 = 1+s
1−s
1+sT /2 1−1+j j 1∠90◦
(i) s = −1 + j; z = 1−sT /2 = 1+1−j = 2−j = 2.2360∠−26.57◦ = 0.4472∠116.57◦
since |z| = 0.4472 < 1, which is inside the unit circle on the z-plane.

1+sT /2 1+1−j 2−j 2.2360∠−26.57◦


(ii) s = 1 − j; z = 1−sT /2 = 1−1+j = j = 1∠90◦ = 2.2361∠ − 116.57◦
since |z| = 2.2361 > 1, which is outside the unit circle on the z-plane.

1+sT /2 1+j 1.414∠45◦ ◦


(iii) s = j; z = 1−sT /2 = 1−j = 1.414∠−45◦ = 1∠90
since |z| = 1 and θ = 90◦ , which is on the positive half circle on the unit circle on the z-plane.

1+sT /2 1−j 1.414∠−45◦


(iv) s = −j; z = 1−sT /2 = 1+j = 1.414∠45◦ = 1∠ − 90◦
since |z| = 1 and θ = −90◦ , which is on the negative half circle on the unit circle on the
z-plane.
Digital Signal Processing 119

10
Example 4.4: Given an analog filter whose transfer function H(s) = s+10 . Convert it to the
digital filter transfer function and difference equation, respectively, when the sampling period
is given as T = 0.01 second.

 Solution:
10 10
H(z) = H(s)|s= 2 z−1 = =
T z+1 s + 10 2
s= 0.01 z−1
z+1
s + 10 s=200 z−1
z+1
10 10 0.05
H(z) = =  = 
200 z−1
 
+ 10 z−1 z−1
z+1 200 z+1 + 0.05 z+1 + 0.05
0.05(z + 1) 0.05z + 0.05
H(z) = =
(z − 1) + 0.05(z + 1) 1.05z − 0.95
(0.05z + 0.05)/1.05z 0.0476 + 0.0476z −1
H(z) = =
(1.05z − 0.95)/1.05z 1 − 0.9048z −1
Y (z) 0.0476 + 0.0476z −1
H(z) = =
X(z) 1 − 0.9048z −1
Y (z)[1 − 0.9048z −1 ] = X(z)[0.0476 + 0.0476z −1 ]
Y (z) − 0.9048z −1 Y (z) = 0.0476X(z) + 0.0476z −1 X(z)
Applying inverse z-transform
y(n) − 0.904y(n − 1) = 0.0476x(n) + 0.0476x(n − 1)
y(n) = 0.0476x(n) + 0.0476x(n − 1) + 0.904y(n − 1)

2
Example 4.5: For the analog transfer function, H(s) = s2 +3s+2
determine H(z) and difference
equation using bilinear transformation if T = 1 second.

 Solution:
2
H(z) = H(s)|s= 2 z−1 =
T z+1 s2 + 3s + 2 s=2 z−1
z+1

2 2(z + 1)2
H(z) =  2 =
4(z − 1)2 + 6(z − 1)(z + 1) + 2(z + 1)2
 
2 z−1
z+1 + 6 z−1
z+1 + 2
2(z + 1)2 2 + 2z −2 + 4z −1
H(z) = =
4(z − 1)2 + 6(z 2 − 1) + 2(z + 1)2 12 − 4z −1
2 + 2z −2 + 4z −1 2/12 + 4/12z −1 + 2/12z −2
H(z) = =
12(1 − 4/12z −1 ) 1 − 0.333z −1
120 Module-4

Y (z) 0.1667 + 0.333z −1 + 0.1667z −2


H(z) = =
X(z) 1 − 0.333z −1
Y (z)[1 − 0.333z −1 ] = X(z)[0.1667 + 0.333z −1 + 0.1667z −2 ]
Y (z) − 0.333z −1 Y (z) = 0.1667X(z) + 0.333z −1 X(z) + 0.1667z −2 X(z)
Applying inverse z-transform
y(n) − 0.333y(n − 1) = 0.1667x(n) + 0.333x(n − 1) + 0.1667x(n − 2)
y(n) = 0.1667x(n) + 0.333x(n − 1) + 0.1667x(n − 2) + 0.333y(n − 1)

4.3.3 Frequency mapping between the s-plane and the z-plane

We know that,
2 z−1
s=
T z+1

Let ωa = analog frequency in Hz, ωd = digital frequency in r/sec. and ωs = sampling frequency
in r/sec. Substitute s = jωa and z = ejωd T into the above equation;

2 ejωd T − 1
jωa =
T ejωd T + 1

2 ωd T
 
∴ ωa = tan
T 2
The above equation explores the relation between the analog frequency on the jω axis and
the corresponding digital frequency ωd on the unit circle. We can also write its inverse as

2 ωa T
 
ωd = tan−1
T 2

4.4 Bilinear Transformation Design Procedure


• Step 1: convert the digital filter specifications
 
to analog filter specifications via the
2 ωd T
pre-warping equations: ωa = T tan 2
 
2 ωd T
– for lowpass filter: ωa = T tan 2
 
2 ωd T
– for highpass filter: ωa = T tan 2
   
2 ωl T 2 ωh T
– for bandpass filter: ωal = T tan 2 , ωah = T tan 2
   
2 ωl T 2 ωh T
– for bandstop filter: ωal = T tan 2 , ωah = T tan 2
Digital Signal Processing 121

where, ω0 = ωal ωah and W = ωah − ωal

• Step 2: perform the prototype transformation using the lowpass prototype HP (s).

– from lowpass to lowpass: H(s) = HP (s)|s= s


ωa

– from lowpass to highpass: H(s) = HP (s)|s= ωa


s

– from lowpass to bandpass: H(s) = HP (s)| s2 +ω 2


s= 0
sW

– from lowpass to bandstop: H(s) = HP (s)|s= sW


s2 +ω 2
0

• Step 3: apply BLT to obtain the corresponding digital filter: H(z) = H(s)|s= 2 z−1
T z+1

1
Example 4.6: Given, HP (s) = s+1 . Design a corresponding digital IIR lowpass filter with a
cutoff frequency of 15 Hz and a sampling rate of 90 Hz using BLT.

 Solution:
ωd = 2πf = 2π15 = 30π r/sec and T = 1/fs = 1/90 sec.

• Step 1: pre-warped analog frequency

2 ωd T 2 30π/90 π
     
ωa = tan = tan = 180 × tan = 103.92 r/sec.
T 2 1/90 2 6

• Step 2: lowpass to lowpass transformation

1 ωa 103.92
H(s) = HP (s)|s= s = s = =
ωa
ωa +1 s + ωa s + 103.92

• Step3: Applying BLT

103.92
H(z) = H(s)|s= 2 z−1 =
T z+1 s + 103.92 2
s= 1/90 z−1
z+1

103.92 103.92
H(z) = = z−1
s + 103.92 s=180 z−1
z+1
180 z+1 + 103.92
103.92/180 0.5773
H(z) = z−1 = z−1
+ 103.92/180
z+1 z+1 + 0.5773
0.5773z + 0.5773 0.5773z + 0.5773
H(z) = =
(z − 1) + 0.5773(z + 1) 1.5773z − 0.4227
(0.5773z + 0.5773)/(1.5773z) 0.3660 + 0.3660z −1
H(z) = =
(1.5773z − 0.4227)/(1.5773z) 1 − 0.2679z −1
122 Module-4

4.5 Digital Butterworth Filter Design using BLT


The signal processing filter which is having a flat frequency response in the passband
can be termed as Butterworth filter and is also called as a maximally flat magnitude filter.
Butterworth poles lie along a circle and are spaced at equal angular distances around a circle.
The magnitude response |HP (v)| versus the normalized frequency v is given by

1
|HP (v)| = √ (4.5)
1 + 2 v 2n

With the given passband ripple AP dB at the normalized passband frequency edge vP = 1,
and the stopband attenuation As dB at the normalized stopband frequency edge vs , the
following two equations must be satisfied to determine the prototype filter order:

1
 
AP = −20 × log10 √ (4.6)
1 + ε2
!
1
As = −20 × log10 p (4.7)
1 + ε2 vs2n
Solving Equations (4.6) and (4.7), we determine the lowpass prototype order as
 
100.1As −1
log10 ε2
N≥ (4.8)
[2 · log10 (vs )]
 
ωas
where, ε is the absolute ripple specification. ε2 = 100.1Ap − 1 and vs = ωap . Table 4.1
shows the 3-dB Butterworth lowpass prototype transfer functions (ε = 1).

Table 4.1: 3-dB Butterworth Lowpass Prototype Transfer Functions.

N HP (s)
1
1 s+1
1
2 s2 +1.4142s+1
1
3 s3 +2s2 +2s+1
1
4 s4 +2·6131s3 +3·4142s2 +2.6131s+1
1
5 s5 +3·2361s4 +5.2361s3 +5·2361s2 +3.2361s+1
1
6 s6 +3.8637s5 +7.4641s4 +9.1416s3 +7.4641s2 +3.8637s+1
Digital Signal Processing 123

Example 4.7: Design a digital lowpasss Butterworth filter with the following specifications:
(i) 3-dB attenuation at the passband frequency of 1.5 kHz (ii) 10-dB stopband attenuation
at the frequency of 3 kHz (iii) Sampling frequency at 8,000 Hz

 Solution:
ωdp = 2πf = 2π × 1500 = 3000π r/sec.
ωds = 2πf = 2π × 3000 = 6000π r/sec.
T = 1/fs = 1/8000 sec.

• Step 1: pre-warped analog frequency

2 ωd T 3000π/8000
   
ωap = tan = 16000 × tan = 1.0691 × 104 r/sec.
T 2 2

2 ωd T 6000π/8000
   
ωas = tan = 16000 × tan = 3.8627 × 104 r/sec.
T 2 2

ωas 3.8627 × 104


vs = = = 3.6130
ωap 1.0691 × 104
   
ε2 = 100.1Ap − 1 = 100.1×3 − 1 = 1
   
100.1As −1 100.1×10 −1
log10 ε2
log10 1
N≥ ≥ = 0.8553
[2 · log10 (vs )] [2 × log10 (3.6130)]

• Step 2: lowpass to lowpass transformation


Rounding N up, we choose N = 1 for the lowpass prototype. From Table 4.1, we have
1
HP (s) = s+1
Applying lowpass to lowpass transformation

1 ωap 1.061 × 104


H(s) = HP (s)|s= s = s = =
ωap
ωap +1 s + ωap s + 1.061 × 104

• Step3: Applying BLT

1.061 × 104 1.061 × 104


H(z) = =
s + 1.061 × 104 s= T2 1−z −1 s + 1.061 × 104 s=16000 z−1
1+z −1 z+1
124 Module-4

1.061 × 104 1.061 × 104 /16000


H(z) = =
16000 z−1
z+1 + 1.061 × 10
4 z−1 4
z+1 + 1.061 × 10 /16000

0.6682 0.6682(z + 1) 0.6682z + 0.6682


H(z) = z−1 = =
z+1 + 0.6682 (z − 1) + 0.6682(z + 1) 1.6682z − 0.3318

(0.6682z + 0.6682)/1.6682z 0.4006 + 0.4006z −1


H(z) = = .
(1.6682z − 0.3318)/1.6682z 1 − 0.1989z −1

Example 4.8: Design a second-order lowpass digital Butterworth filter with a cutoff frequency
of 3.4 kHz at a sampling frequency of 8,000 Hz.

 Solution:
ωd = 2πf = 2π × 3400 = 6800π r/sec.
T = 1/fs = 1/8000 sec. & N = 2

• Step 1: pre-warped analog frequency

2 ωd T 6800π/8000
   
ωa = tan = 16000 × tan = 6.6645 × 104 r/sec.
T 2 2

• Step 2: lowpass to lowpass transformation


Given, N = 2, choose the lowpass prototype. From Table 4.1, we have

1
HP (s) =
s2 + 1.4142s + 1
Applying lowpass to lowpass transformation

1 1
H(s) = HP (s)|s= s = = 2
s2 + 1.4142s + 1
 
ωa s s
6.645×104
+ 1.4142 6.645×104
+1

(6.645 × 104 )2 4.4416 × 109


H(s) = =
s2 + 1.4142 × 6.645 × 104 s + (6.645 × 104 )2 s2 + 9.4249 × 104 s + 4.4416 × 109

• Step3: Applying BLT

4.4416 × 109
H(z) =
s2 + 9.4249 × 104 s + 4.4416 × 109 s= T2 1−z −1
1+z −1
Digital Signal Processing 125

4.4416 × 109
H(z) =
s2 + 9.4249 × 104 s + 4.4416 × 109 s=16000 z−1
z+1

4.4416 × 109
H(z) =  2  
16000 z−1
z+1 + 9.4249 × 104 16000 z−1
z+1 + 4.4416 × 10
9

4.4416 × 109 /160002


H(z) =  2  
z−1 z−1
z+1 + 9.4249 × 104 × 16000/160002 z+1 + 4.4416 × 109 /160002

17.35
H(z) =  2  
z−1 z−1
z+1 + 5.8906 z+1 + 17.35

17.35(z + 1)2
H(z) =
(z − 1)2 + 5.8906(z − 1)(z + 1) + 17.35(z + 1)2
17.35(z 2 + 2z + 1)
H(z) =
(z 2 − 2z + 1) + 5.8906(z 2 − 1) + 17.35(z 2 + 2z + 1)
17.35z 2 + 34.7z + 17.35
H(z) =
24.2406z 2 + 32.7z + 12.4594
17.35z 2 /24.2406z 2 + 34.7z/24.2406z 2 + 17.35/24.2406z 2
H(z) =
1 + 32.7z/24.2406z 2 + 12.4594/24.2406z 2
0.7157 + 1.4314z −1 + 0.7151z −2
H(z) =
1 + 1.3490z −1 + 0.5140z −2

Example 4.9: Design a first-order highpass digital Butterworth filter with a cutoff frequency
of 30Hz at a sampling frequency of 150 Hz.

 Solution:
ωd = 2πf = 2π × 30 = 60π r/sec.
T = 1/fs = 1/150 sec. & N = 1

• Step 1: pre-warped analog frequency

2 ωd T 60π/150
   
ωa = tan = 300 × tan = 217.963 r/sec.
T 2 2

• Step 2: lowpass to highpass transformation


Given, N = 1, choose the lowpass prototype. From Table 4.1, we have
126 Module-4

1
HP (s) =
s+1
Applying lowpass to highpass transformation

1 1
H(s) = HP (s)|s= ωa = = 217.963
s s+1 s= 217.963
s s +1

s
H(s) =
217.963 + s
• Step3: Applying BLT

s s
H(z) = =
217.963 + s −1
s= T2 1−z−1 217.963 + s s=300 z−1
z+1
1+z

300 z−1
z+1 300(z − 1)
H(z) = =
217.963 + 300 z−1
z+1
217.963(z + 1) + 300(z − 1)

300z − 300 300z/517.963z − 300/517.963z


H(z) = =
517.963z − 82.037 1 − 82.037/517.963z
0.5792 − 0.5792z −1
H(z) =
1 − 0.1583z −1

Example 4.10: Design a second-order digital bandpass Butterworth filter with the following
specifications:
(i) upper cutoff frequency of 2.6 kHz (ii) lower cutoff frequency of 2.4 kHz (iii) sampling
frequency of 8,000 Hz

 Solution:
ωh = 2πf = 2π × 2600 = 5200π r/sec.
ωl = 2πf = 2π × 2400 = 4800π r/sec.
T = 1/fs = 1/8000 sec. & N = 2
• Step 1: pre-warped analog frequency

2 ωh T 5200π/8000
   
ωah = tan = 16000 × tan = 2.6110 × 104 r/sec.
T 2 2
ωl T
 
ωal = 16000 × tan = 16000 × tan(0.3π) = 2.2022 × 104 r/sec.
2
W = ωah − ωal = 26, 110 − 22, 022 = 4, 088 r/sec.
Digital Signal Processing 127

ω02 = ωah × ωal = 5.7499 × 108

• Step 2: lowpass to bandpass transformation


Given, N = 2, choose the lowpass prototype. From Table 4.1, we choose the lowpass
prototype with order 1 to produce the bandpass filter with order 2:

1
HP (s) =
s+1
Applying lowpass to bandpass transformation

1 sW
H(s) = HP (s)| s2 +ω 2 = =
s= sW 0 s2 +ω02
+1 s2 + ω02 + sW
sW

4088s
H(s) =
s2 + 5.7499 × 108 + 4088s
• Step3: Applying BLT

4088s
H(z) =
s2 + +4088s + 5.7499 × 108 s= T2 1−z −1
1+z −1

4088s
H(z) =
s2 + 4088s + 5.7499 × 108 s=16000 z−1
z+1

4088s
H(z) =  2  
16000 z−1
z+1 + 4088 16000 z−1
z+1 + 5.7499 × 10
8

4088s/160002
H(z) =  2  
z−1 z−1
z+1 + 4088 × 16000/160002 z+1 + 5.7499 × 108 /160002

0.0730 − 0.0730z −2
H(z) =
1 + 0.7117z −1 + 0.8541z −2

4.6 Realization of IIR Filters in Direct-Form I and Direct-Form II


Computations of y(n) can be arranged in different ways to give the same difference equa-
tion, which leads to different structures for realization of discrete-time LTI systems. Basic
forms of implementations, namely, direct-form I and direct-form II will be described in this
section.
128 Module-4

4.6.1 Direct-Form I Realization

We know that

Y (z) b0 + b1 z −1 + · · · + bM z −M
H(z) = = (4.9)
X(z) 1 + a1 z −1 + a2 z −2 + · · · + aN z −N

∴ Y (z) = H(z) × X(z) (4.10)

where X(z) and Y (z) are the z-transforms of input x(n) and the output y(n), respectively.
Substituting eqn. (4.9) in eqn. (4.10), we have
!
b0 + b1 z −1 + · · · + bM z −M
Y (z) = X(z) (4.11)
1 + a1 z −1 + a2 z −2 + · · · + aN z −N

Y (z)[1 + a1 z −1 + a2 z −2 + · · · + aN z −N ] = X(z)[b0 + b1 z −1 + · · · + bM z −M ]

Taking the inverse z-transform

y(n) = b0 x(n) + b1 x(n − 1) + · · · + bM x(n − M ) − a1 y(n − 1) − a2 y(n − 2) − · · · − aN y(n − N )

This difference equation thus can be implemented by the direct-form I realization shown in
Fig. 4.4. Fig. 4.5 illustrates the realization of the second-order IIR filter (M = N = 2).

b0
x(n) + y(n)

Z-1 Z-1
b1 -a1
x(n-1) y(n-1)

Z-1 Z-1

x(n-2) y(n-2)

Z-1 Z-1

x(n-M) y(n-N)
bM -aN

Fig. 4.4. Direct-form I realization.


Digital Signal Processing 129

b0
x(n) + y(n)

Z-1 Z-1
b1 -a1
x(n-1) y(n-1)

Z-1 Z-1
b2 -a2
x(n-2) y(n-2)

Fig. 4.5. Direct-form I realization for M=N=2.

4.6.2 Direct-Form II Realization

with N = M , we can express the eqn. (4.10) as

B(z) X(z)
 
Y (z) = H(z)X(z) = X(z) = B(z)
A(z) A(z)
where, B(z) = b0 + b1 z −1 + · · · + bM z −M and A(z) = 1 + a1 z −1 + a2 z −2 + · · · + aN z −N
 X(z)
 
−1 −M
Y (z) = b0 + b1 z + · · · + bM z
1 + a1 z + a2 z −2 + · · · + aN z −M
−1

Also, if we define a new z-transform function as


X(z)
W (z) =
1 + a1 z −1 + a2 z −2 + · · · + aM z −M
 
∴ Y (z) = b0 + b1 z −1 + · · · + bM z −M W (z)
The corresponding difference equations are
w(n) = x(n) − a1 w(n − 1) − a2 w(n − 2) − · · · − aM w(n − M )
y(n) = b0 w(n) + b1 w(n − 1) + . . . + bM w(n − M )

Fig. 4.6 shows the realization of IIR filter using direct-form II method and second order
IIR filter realization using direct-form II is depicted in Fig. 4.7.
130 Module-4

w(n)
x(n) + + y(n)
b0

Z-1

-a1 b1
Z-1

Z-1

-aM w(n-M) bM

Fig. 4.6. Direct-form II realization.

w(n)
x(n) + + y(n)
b0

Z-1

-a1 b1
Z-1

-a2 w(n-2) b2

Fig. 4.7. Direct-form II realization for M=N=2.

Example 4.11: Realize the first-order digital highpass Butterworth filter using a direct-form
Digital Signal Processing 131

I realization.
0.1936 − 0.1936z −1
H(z) =
1 + 0.6128z −1

0.1936−0.1936z −1
 Solution: Given, H(z) = 1+0.6128z −1
Comparing with the general difference equation,

Y (z) b0 + b1 z −1 + · · · + bM z −M
=
X(z) 1 + a1 z −1 + a2 z −2 + · · · + aN z −N
coefficients b0 = 0.1936; b1 = −0.1936 & a1 = 0.6128.
Y (z) 0.1936 − 0.1936z −1
=
X(z) 1 + 0.6128z −1
Y (z)[1 + 0.6128z −1 ] = X(z)[0.1936 − 0.1936z −1 ]
Applying inverse z-transform
y(n) = 0.1936x(n) − 0.1936x(n − 1) − 0.6128y(n − 1)

x(n) + y(n)
0.1936

Z-1 Z-1

x(n-1) y(n-1)
-0.1936 -0.6128

0.7157+1.4314z −1 +0.7151z −2
Example 4.12: Given, H(z) = 1+1.3490z −1 +0.5140z −2
. Realize the following digital filter
using a direct-form II realization.

 Solution:
Comparing with the general difference equation,

Y (z) b0 + b1 z −1 + · · · + bM z −M
H(z) = =
X(z) 1 + a1 z −1 + a2 z −2 + · · · + aN z −N
132 Module-4

coefficients b0 = 0.7157; b1 = 1.4314; b2 = 0.7151 & a1 = 1.3490; a2 = 0.5140.

B(z) X(z)
 
Y (z) = H(z)X(z) = X(z) = B(z)
A(z) A(z)
where, B(z) = 0.7157 + 1.4314z −1 + 0.7151z −2 and A(z) = 1 + 1.3490z −1 + 0.5140z −2
X(z) X(z)
W (z) = =
1 + a1 z −1 −2
+ a2 z + · · · + aM z −M 1 + 1.3490z −1 + 0.5140z −2
W (z) + 1.3490z −1 W (z) + 0.5140z −2 W (z) = X(z)
Applying inverse z-transform
w(n) + 1.3490w(n − 1) + 0.5140w(n − 2) = x(n)
∴ w(n) = x(n) − 1.3490w(n − 1) − 0.5140w(n − 2)
   
Y (z) = b0 + b1 z −1 + · · · + bM z −M W (z) = 0.7157 + 1.4314z −1 + 0.7151z −2 W (z)
Applying inverse z-transform
y(n) = 0.7157w(n) + 1.4314w(n − 1) + 0.7157w(n − 2)

w(n)
x(n) + + y(n)
0.7157

Z-1

-1.349 1.4314
Z-1

-0.514 w(n-2) 0.7157

1−3z −1 +2z −2
Example 4.13: Given, H(z) = 1+0.3z −1 −0.1z −2
. Realize the following digital filter using a
direct-form II realization.

 Solution:
Comparing with the general difference equation,
Digital Signal Processing 133

Y (z) b0 + b1 z −1 + · · · + bM z −M
H(z) = =
X(z) 1 + a1 z −1 + a2 z −2 + · · · + aN z −N
coefficients b0 = 1; b1 = −3; b2 = 2 & a1 = 0.3; a2 = −0.1.

B(z) X(z)
 
Y (z) = H(z)X(z) = X(z) = B(z)
A(z) A(z)
where, A(z) = 1 + 0.3z −1 − 0.1z −2 and B(z) = 1 − 3z −1 + 2z −2
X(z) X(z)
W (z) = =
1 + a1 z −1 −2
+ a2 z + · · · + aM z −M 1 + 0.3z −1 − 0.1z −2
W (z) + 0.3z −1 W (z) − 0.1z −2 W (z) = X(z)
Applying inverse z-transform
w(n) + 0.3w(n − 1) − 0.1w(n − 2) = x(n)
∴ w(n) = x(n) − 0.3w(n − 1) + 0.1w(n − 2)
   
Y (z) = b0 + b1 z −1 + · · · + bM z −M W (z) = 1 − 3z −1 + 2z −2 W (z)
Applying inverse z-transform
y(n) = w(n) − 3w(n − 1) + 2w(n − 2)

w(n)
x(n) + + y(n)
1

Z-1

-0.3 -3
Z-1

0.1 w(n-2) 2

 
4z 2
Example 4.14: Given, H(z) = 3 + z−0.5 − z−0.25 . Realize the following digital filter using
direct-form I and direct-form II realizations.
134 Module-4

 Solution:
Given,
4z 2
 
H(z) = 3 + −
z − 0.5 z − 0.25

3(z − 0.5)(z − 0.25) + 4z(z − 0.25) − 2(z − 0.5)


H(z) =
(z − 0.5)(z − 0.25)
7z 2 − 5.25z + 1.375 7 − 5.25z −1 + 1.375z −2
H(z) = =
z 2 − 0.75z + 0.125 1 − 0.75z −1 + 0.125z −2
Comparing with the general difference equation,

Y (z) b0 + b1 z −1 + · · · + bM z −M
H(z) = =
X(z) 1 + a1 z −1 + a2 z −2 + · · · + aN z −N
coefficients b0 = 7; b1 = −5.25; b2 = 1.375 & a1 = −0.75; a2 = 0.125.

Y (z) 7 − 5.25z −1 + 1.375z −2


H(z) = =
X(z) 1 − 0.75z −1 + 0.125z −2
Y (z)[1 − 0.75z −1 + 0.125z −2 ] = X(z)[7 − 5.25z −1 + 1.375z −2 ]
Applying inverse z-transform
y(n) = 7x(n) − 5.25x(n − 1) + 1.375x(n − 2) + 0.75y(n − 1) − 0.125y(n − 2)

7
x(n) + y(n)

Z-1 Z-1
-5.25 0.75
x(n-1) y(n-1)

Z-1 Z-1

x(n-2) y(n-2)
1.375 -0.125
Digital Signal Processing 135

B(z) X(z)
 
Y (z) = H(z)X(z) = X(z) = B(z)
A(z) A(z)
where, A(z) = 1 − 0.75z −1 + 0.125z −2 and B(z) = 7 − 5.25z −1 + 1.375z −2
X(z) X(z)
W (z) = =
1 + a1 z −1 −2
+ a2 z + · · · + aM z −M 1 − 0.75z −1 + 0.125z −2
W (z) − 0.75z −1 W (z) + 0.125z −2 W (z) = X(z)
Applying inverse z-transform
w(n) − 0.75w(n − 1) + 0.125w(n − 2) = x(n)
∴ w(n) = x(n) + 0.75w(n − 1) − 0.125w(n − 2)
   
Y (z) = b0 + b1 z −1 + · · · + bM z −M W (z) = 7 − 5.25z −1 + 1.375z −2 W (z)
Applying inverse z-transform
y(n) = 7w(n) − 5.25w(n − 1) + 1.375w(n − 2)

w(n)
x(n) + + y(n)
7

Z-1

0.75 -5.25
Z-1

-0.125 w(n-2) 1.375

Example 4.15: Bring out differences between FIR and IIR filters.

 Solution:
136 Module-4

FIR filters IIR filters


(i) Linear phase characteristics Non-linear phase characteristics
(ii) More stable as they have no feedback Less stable as they have feedback
(iii) Impulse response is finite Impulse response is infinite
(iv) High implementation cost Low implementation cost
(v) More memory requirement Less memory requirement
(vi) All-zero structure Pole-zero structure

You might also like