Anda di halaman 1dari 34

Dr. M. Venu Gopala Rao, Professor, Dept.

of ECE

KL University, Vaddeswaram,
Dept. of ECE,
Signal Processing (B. Tech all branches) 13-ES205
Lesson-17: IIR-Digital Filters
A digital filter is a Linear Time Invariant System. The input
sequence is modified according to the characteristics of the
system and gives some output. Hence the system is acting
some kind of filtering operation. In time domain the input and
outputs are related by y[n] h[n] x[n] , where x[n] , y[n] and

h[n] are the input sequence, output

sequence and impulse response of the system respectively. In frequency domain, they are related as

Y [ z] H [ z] X [ z] , where H [ z ]

Y [ z]
is referred to as System Function or Transfer Function or
X [ z]

Frequency Response of the system. Hence any filter can be characterized by either impulse response

h[n] or system function H [ z ] .


1. Conditions on Digital Filter:
a) Realizable filter condition: The impulse response of the system must be causal sequence.

h[n] 0, for n 0 .

b) Stable Condition: Absolutely summable. | h[n] |


n0

2. Classification of Digital Filters: Digital filters are categorized into two types.
(a) IIR Filter: Infinite duration Impulse Response. Recursive type. The present output sample
depends on the present input sample, past input samples and output samples.
(b) FIR Filter: Finite duration Impulse Response. Non-recursive type. The present output sample
depends on the present input sample and past input samples.
Frequency Selective Filters: A filter is one which rejects un-wanted frequencies from the input signal
and allow the desired frequencies to obtain the required shape of the output signal. The filters are
categorized into four types as described below:

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


Ideal Filters: The ideal digital filter transfer functions are illustrated below

1, for 0 || c
0, for c ||

1. Low Pass filter H [e j ]

0, for 0 || c
1, for c ||

2. High Pass Filter H [e j ]

0, for 0 || c
1

3. Band Pass Filter H [e j ] 1, for c || c


1
2

0, for c2 ||
1, for 0 || c
1

4. Band Stop Filter H [e j ] 0, for c || c


1
2

1, for c2 ||

Practical Filters

3. IIR Digital Filters: The input output relation of a IIR digital filter is described by a difference
equation:
N

k 1

k 0

y[n] ak y[n k ] bk x[n k ]


where ak and bk are filter coefficients, N is the order of the filter, N > M. The transfer function of the
digital filter is represented by
M

H [ z]

k
bk z

k 0
N

1 ak z k
k 10

The design of an IIR filter for the given specifications is determining filter co-efficients ak and bk of the
filter.
2

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


3(a) Design of Digital Filters from Analog Filters:
The most common technique used for designing IIR digital filters involves first designing an analog
prototype filter and then transforming the prototype to digital filter. For a given specifications of a digital
filter, the derivation of digital filter transfer function requires the following steps.
1. Map the desired digital filter specifications into those for an equivalent analog filter.
2. Derive the analog filter transfer function for analog prototype.
3. Transform the transfer function of the analog prototype into an equivalent digital filter transfer
function.

3(b) Magnitude response of the Filter:

p : Pass band frequency (digital) in radians

p : Pass band frequency (Analog) in radians

c : Cut off frequency (digital) in radians

c : Cut off frequency (Analog) in radians

s : Stopband frequency (digital) in radians

s : Stopband frequency (Analog) in radians

: Parameter specifying allowable pass band

: Parameter specifying allowable stop band

p : Passband error tolerance.

s : Max allowable magnitude on the stop band.

4 Analog Lowpass Filter Design: The most general form of analog filter transfer function is described
M

bk s k
N (s)
by H [ s ]
, where H [ s] is L.T. of h(t ) , ak and bk are filter coefficients, N is the
k 0
D( s) 1 N a s k
k
k 1

order of the filter, N > M. For stable filter, the poles of H [ s] must lie in the left half of s-plane.
3

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

5. Analog Lowpass Butterworth Filter: All pole filter. The magnitude function of the Butterworth
LPF

| H ( j) |

2N

, N = 1, 2, . .

where N is the order of the filter and c is cutoff frequency.


Properties:
(a) Monotonically decreasing function
(b) Smoothing at both passband and stopband.
(c) Max response at 0 .
(d) For c , | H ( j) | 1
(e) For c , | H ( j) | 1 or 3-dB

frequency or Half power frequency


(f) For c , | H ( j) | decreases rapidly.
The normalized Butterworth Lowpass Filter (i.e., c 1 rad/sec) is given by

| H ( j) |2

1
, N = 1, 2, . . .
1 () 2 N

1
1

As we know that s j or sj , we simplified as | H ( j) |2 | H (s 2 ) |


.
s
2
N
1 ( j )
1 ( s 2 ) N
Then the roots of the denominator is 1 (s 2 ) N 0 .
Case1: For N-odd: s 2 N 1 e j 2 k , k 1, 2,... , 2 N . sk e j k / N , k 1, 2,. . . , 2N .
Case2: For N-even:

s 2 N 1 e j (2k 1) , k 1, 2,... , 2 N . sk e j (2k 1) /2 N , k 1, 2,. . . , 2N .

For stable filter the poles must lie on the left half of s-plane. Therefore the stable files are derived from
the following equation:

sk e jk ,

where k
2

(2k 1)
,
2N

k 1, 2,. . . , N .

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


List of Butterworth polynomial

Denominator of H ( s)

(s 1)

(s 2 2s 1)

(s 1)(s 2 s 1)

(s 2 0.765s 1)(s 2 1.848s 1)

Determining the order of the filter:


From the given specifications determine the order of the filter
using the following formulas:
p : Pass band frequency (Analog) in radians.

p : Pass band attenuation


s : Stopband frequency (Analog) in radians.

s : Stop band attenuation


Case1: If p and s are given

Case2: If 1 and 2 are given

100.1 s 1
log

100.1 p 1

N

log s
p

log 2
1

2 1
1

N

log s
p

Case3: If and are given

log

N

log s
p

Round to the next higher integer.

Ex1: Determine the order of LPF if it has pass band attenuation of - 3dB at 500 Hz and stop
band attenuation of - 40dB at 1000 Hz.
Ans: The pass band attenuation is -3 dB.
The stop band attenuation is 40 dB.
The pass band cut off frequency in radian is p = 500 2 1000 rad / sec
5

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

The stop band cut off frequency in radian is s 1000 2 2000 rad / sec

p 3 dB; s 40 dB; p 1000 rad / sec; s 2000 rad / sec;


100.1 s 1
99.995
log

100.1 p 1 log

2
0.9976

The order of low pass filter is, N

6.64
s
2000 0.3
log

log
p
1000

Therefore the order of filter, N 6.64 7 .


% IIR1.m
clear all; close all; clc;
Op = 2*pi*500; Os = 2*pi*1000; rp = 3; rs = 40; T = 1;
N = ceil((log10((10.^(0.1*abs(rs))-1)./(10.^(0.1*abs(rp))-1)))/(2*log10(Os/Op)));
% N = 7

Ex2: Determine the order of LPF if it has pass band attenuation of - 1dB at 4 KHz and stop

band attenuation of - 40dB at 6 KHz.


Ans: The pass band attenuation is -1 dB.
The stop band attenuation is 40 dB.
The pass band cut off frequency in radian is p 4000 2 8000 rad / sec
The stop band cut off frequency in radian is s 6000 2 12000 rad / sec

p 1dB; s 40 dB; p 8000 rad / sec; s 12000 rad / sec;

The order of low pass filter is,

100.1 s 1
log

100.1 p 1

13.0239
N
s
log
p

% IIR2.m
clear all; close all; clc;

Op = 2*pi*4000; Os = 2*pi*6000; rp = 1; rs = 40;

% N = ((log10((10.^(0.1*abs(rs))-1)./(10.^(0.1*abs(rp))-1)))/(2*log10(Os/Op)))
N = ceil((log10((10.^(0.1*abs(rs))-1)./(10.^(0.1*abs(rp))-1)))/(2*log10(Os/Op)));
N

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

7. IIR Digital Filter Design:


7.1 Impulse Invariance Technique:
Mapping from s-plane poles to z-plane poles:
Let us consider the mapping of points from the s-plane to z-plane implied by the relation

z e sT , where s j and T is sampling interval. By substituting in z , we get

z e sT e( j)T e T e jT
And also we know that z re

. Therefore re

jT
.
e T e

r e T which is magnitude and T which is angular position.


Therefore the analog pole is mapped to a place in the z-plane of magnitude e T and angle T .
The real part of analog pole determines the radius of the z-plane pole and the imaginary part of analog
pole dictates the angle of the digital pole. The mapping of various positions s-plane poles into z-plane
are illustrated in the following figures.
Fig(a): Poles on j axis mapping onto the unit circle. (Marginally stable system).
Fig(b): Poles on left half of s-plane are mapping into inside the unit circle. (Stable system).
Fig(c): Poles on right half of s-plane are mapping into outside the unit circle. (Unstable system).

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

Design Procedure:
In impulse invariance method, the IIR filter is designed such that the Unit Impulse Response

h[n] of

digital filter is the sampled version of the Unit Impulse Response of analog filter ha (t ) .
The Analog Filter transfer function is described by

H a ( s)

Ai

i 1 s pi

A1

s p1

A2

s p2

..

where Ai are the coefficients of partial fraction expansion, and

pi p1, p2 ,..., pN are the poles.


Then the impulse response ha (t ) = Inverse L.T. of H a ( s) . That is ha (t )
The Impulse Response

Ai e

pit

i 1

h[n] of digital filter is obtained by sampling the Impulse Response of analog

filter ha (t ) . Thus h[n] ha (t ) |t nT

Ai e

i 1

pi nT

, where T is sampling time.

Then the transfer function of digital filter is given by

H [ z]

n0

n0 i 1

h[n] z n Ai e

pi nT n
z

By interchanging the order of summation, we get


n
N p nT
N

piT 1

n
i
H [ z ] Ai
e
z Ai
e
z

i 1 n0
i 1 n0

N
Ai

pT
i 1 1 e i z 1

Limitations:
(a) Analog filters are band limited, so there will be aliasing due to sampling process. Because of
this aliasing, the frequency response of resulting digital filter will not be identical to the original
frequency response of analog filter.
(b) The change in the value of sampling time has no effect on the amount of aliasing.
(c) The analog frequency is in the range to , which maps into digital frequency

range of

in the

to . For a general range (i 1) T to (i 1) T , (where i is an integer) also

maps in the range of

to . Hence mapping from analog frequency to digital frequency is


8

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


termed as many to one. This mapping is not one to one.
Design Steps:
Step1: For the given specifications, determine the analog filter transfer function H a ( s) .
Step2: Select the sampling rate of the digital filter T sec/sample.
Step3: Express the analog filter transfer function as the sum of single pole filters.
N

H a ( s)

Ai

i 1 s pi

A1

s p1

A2

s p2

..

Step4: To convert analog low pass filter to digital low pass filter using impulse-invariant
transformation, substitute,

1
1

pk T 1 .
s pk
1 e z

Compute the Z.T. of the digital filter by using the formula: H [ z ]


Ex3: Consider the analog filter transfer function H a ( s)

Ai
pT
i 1 1 e i z 1

2
s2

Design digital filter using Impulse Invariance Method. Assume suitable data.
Ans: The sampling period is assumed to be T = 1 sec.
For the given analog filter transfer function the pole is p = -2.
To convert analog low pass filter to digital low pass filter using impulse-invariant transformation,
substitute,

1
1

pk T 1 .
s pk
1 e z

Therefore

H [ z]

1
p T
1 e k z 1

2
1 0.1353z 1

% IIR3.m.
clear all; close all; clc;
% Analog poles and zeros
b = [2]; a = [1 2];
T = 1; fs = 1/T;

% Assume sampling frequency = 1 Hz.

% Transformation from analog to digital using impulse invariance method.


[bz,az] = impinvar(b,a,fs);
bz
az
% Normalized TF coefficients H[e^jw] = H[e^jw]/(H[e^j0]);
H0 = 2/(1-0.1353) ;
bz = bz/H0;
freqz(bz,az,512,fs);

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

Magnitude (dB)

1
0
-1
-2
-3

0.05

0.1

0.15

0.2
0.25
0.3
Frequency (Hz)

0.35

0.4

0.45

0.5

0.05

0.1

0.15

0.2
0.25
0.3
Frequency (Hz)

0.35

0.4

0.45

0.5

Phase (degrees)

0
-2
-4
-6
-8

7.2 Bilinear Transformation:


The limitations observed in Impulse Invariance method are overcome by using Bilinear Transformation.
The Bilinear Transformation is one to one mapping.
Let us consider an analog linear filter with system function

H a ( s)

b
sa

Then the corresponding digital filter transfer function is defined as H [ z ]

where s

b
2 1 z 1
T 1 z 1 a

2 1 z 1
1 sT / 2
.

or z

1
1 sT / 2
T 1 z

This relationship is known as Bilinear Transformation. The corresponding frequency transformations


are given as

T
.
tan or 2 tan 1
T
2
2

Warping Effect:
(a) At low frequencies

2
or = T , i.e., the digital
.
T 2 T

frequency follows analog frequency linearly.


(b) At high frequencies, the transformation is non-linear and distortion is introduced in the frequency
scale of the digital filter to that of analog filter as shown in the figure. This distortion is known as
warping effect . The warping effect on magnitude response and phase responses are shown
below.
10

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

Fig (a) Warping effect on magnitude

(b) Warping effect on phase angle

Pre-warping: This warping effect can be eliminated by pre-warping the analog frequencies as below:

p
2
2

and s tan s .
tan . Therefore p tan
T
2
T
2
T
2

Design Steps:
Step1: From the given specifications, find the prewarping analog frequencies using the formulas:

p
2
2

and s tan s .
tan
T
2
T
2

Step2: Using the analog frequencies determine the analog filter transfer function H a ( s) .
Step3: Select the sampling rate of the digital filter T sec/sample.
Step4: Determine the digital filter transfer function by substituting s

2 1 z 1

into the analog filter


T 1 z 1

transfer function.

11

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

Ex4: Design a digital low pass filter using bi-linear transformation for the following analog filter transfer
function.

H a ( s)

0.4225
s 2 0.9192s 0.4225

Ans: The digital filter transfer function is obtained as below:


By assuming T = 1 sec and by substituting s

H [ z ] H a ( s) |

s 2 1 z 1
T 1 z

2 1 z 1

T 1 z 1

0.4225
2

2 1 z 1
2 1 z 1

0.9192
0.4225


1
1

T
T
1

z
1

On simplification, we get

H [ z ] 0.0675

1 2 z 1 z 2
1 1.1428z 1 0.4127z 2

% IIR3.m.
clear all; close all; clc;
b = [0.4225]; a = [1 0.9192 0.4225]; fs =1;
[bz,az] = bilinear(b,a,fs);
%bz = 0.0675
%az = 1.0000

0.1350
-1.1428

0.0675
0.4127

freqz(bz,az,512,fs);

Magnitude (dB)

50
0
-50
-100
-150

0.05

0.1

0.15

0.2
0.25
0.3
Frequency (Hz)

0.35

0.4

0.45

0.5

0.05

0.1

0.15

0.2
0.25
0.3
Frequency (Hz)

0.35

0.4

0.45

0.5

Phase (degrees)

0
-50
-100
-150
-200

12

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

---------------------------------------------------------------------------------------------------------------------------------------

Algorithm for Design of Digital Butterworth Filter:


-------------------------------------------------------------------------------------------------------------------------The most common technique used for designing IIR digital filters involves first designing an analog
prototype filter and then transforming the prototype to digital filter. For a given specifications of a digital
filter, the derivation of digital filter transfer function requires the following steps.
1. Map the desired digital filter specifications into those for an equivalent analog filter.
2. Derive the analog filter transfer function for analog prototype.
3. Transform the transfer function of the analog prototype into an equivalent digital filter transfer
function.

Step1: Conversion of digital frequencies into analog frequencies.


Obtain the following digital filter parameters for the given problem.

p : Pass band frequency (digital) in radians.

p : Pass band attenuation

s : Stop band frequency (digital) in radians.

s : Stop band attenuation

Convert these digital filter parameters into corresponding analog filter parameters according to the filter
type.
(a) Impulse Invariance Method:
Substitute for analog frequency

. That is p
and s s , where T is sampling
T
T
T

period. If the value of T is not explicitly given assume to be 1 sec.


(b) Bilinear Transformation Method:
Pre-warping the analog frequencies:
Therefore p

tan .
T
2

p
2
2

and s tan s .
tan
T
2
T
2

If the value of T is not explicitly given assume to be 1 sec or an appropriate value.

Step2: Determining the order of the analog low pass filter:


From the given specifications determine the order of the filter using the following formulas:
13

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

p : Pass band attenuation

p : Pass band frequency (Analog) in radians.

s : Stopband frequency (Analog) in radians.

s : Stop band attenuation s , p , rs , rp

Case1: If p and s are given

Case2: If 1 and 2 are given

Case3: If and are given

100.1 s 1
log

100.1 p 1

N

log s
p

22

log
1

2 1
1

N
s
log

log

N

log s
p

Round to the next higher integer.

Step3: Formulate the normalized analog low pass Butterworth filter transfer function as
1
H ( s)
Polynomial
where polynomial for various values of N is given below
List of Butterworth polynomial

Denominator of H ( s)

(s 1)

(s 2 2s 1)

(s 1)(s 2 s 1)

(s 2 0.765s 1)(s 2 1.848s 1)

Transfer Function

H ( s)

H ( s)
H ( s)

H ( s)

(s 1)
1

(s 2s 1)
1

(s 1)(s 2 s 1)
1

(s 0.765s 1)(s 2 1.848s 1)


14

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

Step4: Determine the cut off frequency using the formula c

Note: If

10

p
0.1 p

1
2N

p 3dB , c p

Step5: Determine the analog transfer function H a ( s) using the following:

s s
c

Low pass to high pass filter, substitute s c

(a) Low pass to low pass filter, substitute


(b)

Step6: Apply transformation technique to convert analog filter into respective digital filter.
(a) Impulse Invariance Technique: Substitute

1
s Pk

(b) Bilinear Transformation Technique: Substitute s

1
PT
1 e k z 1

2 1 z 1
T 1 z 1

Step7: The final digital filter transfer function must be presented in the following format.

b b z 1 b2 z 2 ....
H [ z ] 0 1 1
1 a1z a2 z 2 ....

15

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

Ex5: Design a digital low pass filter Butterworth filter using bilinear transformation with pass

band and stop band cut-off frequencies 800 rad/sec and 1800 rad/sec respectively. The pass
band attenuation is -3 dB and stop band attenuation is -10dB.
Ans: The given filter specification are:

p 3dB; s 10dB; p 800 rad / sec; s 1800 rad / sec


Apply the bilinear transformation technique for prewarping , i.e.

2

tan .
T
2
16

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


The value of T is not explicitly given in the problem; hence we assume T=1sec.

800
3.23 rad / sec
2

Therefore, p 2 tan

1800
s 2 tan
30.12 rad / sec
2
% IIR4.m.
clear all; close all; clc;
% Bilinear transformation
wp = 800; ws = 1800; rp = 3; rs = 10; T = 1;
% Prewarping analog frequencies
Op = (2/T)*tan(wp/2);

Os = (2/T)*tan(ws/2);

Op
Os

100.1 s 1
3
log

100.1 p 1 log

0.997

The order of low pass filter is N

0.4913 1
s
30.12
log
log

3.23

N = ceil((log10((10.^(0.1*abs(rs))-1)./(10.^(0.1*abs(rp))-1)))/(2*log10(Os/Op)));
N

The transfer function for 1 order normalized low pass filter is given by, H ( s)
The cut-off frequency, c

10

p
0.1 p

1
2N

1
s 1

3.23
3.24 rad / sec
(0.997)

Oc = Op / ((10^(0.1*abs(rp))-1)^(1/(2*N)));
Oc

The desired analog filter transfer function Replace, s

H a ( s)
b = [1]; a = [1

1
s
1
3.24

s
,
3.24

3.24
s 3.24

1]; % 1/(s+1); Normalized analog filter transfer function

[B A]=lp2lp(b,a, Oc); % Desired Analog filter transfer function with cut off
% frequency Oc

17

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


B
A

2 1 Z 1
To convert low pass filter to digital low pass filter using bilinear transformation, s

T 1 Z 1
in the magnitude response H ( s) .
Then the required digital filter transfer function H ( Z )

3.24
0.62(1 Z 1)

1 0.24Z 1
1 Z 1
2

3.24
1
1 Z

% Transformation from analog filter to digital filter


fs = 1/T;
[b1 a1] = bilinear(B,A, fs);
b1
a1
freqz(b1,a1,512,fs);
axis([0 fs/2 -20 1])
% --------------------------------------------------------------------------------

Magnitude (dB)

0
-5
-10
-15
-20

0.05

0.1

0.15

0.2
0.25
0.3
Frequency (Hz)

0.35

0.4

0.45

0.5

0.05

0.1

0.15

0.2
0.25
0.3
Frequency (Hz)

0.35

0.4

0.45

0.5

Phase (degrees)

-50

-100

Ex6: Design a digital low pass Butterworth filter using impulse-invariant transformation with pass band
and stop band cut off frequencies 200 Hz and 500 Hz respectively. The pass band and stop band cut
off frequencies 200 Hz and 500 Hz respectively. The pass band and stop band attenuation are -5 dB
and -12 dB respectively. The sampling frequency is 5000 Hz.
Ans: The given specifications of digital filter are:

p 5dB; s 12dB; Fpass 200 Hz; Fstop 500 Hz; Fs 5000Hz .


18

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


The corresponding digital frequencies are:

2 Fstop 2 500
2 Fpass 2 200

0.2 rad / sec

0.08 rad / sec and s


Fs
5000
Fs
5000

% IIR6.m:
clear all; close all; clc;
% wp = 2*pi*(200/5000); ws = 2*pi*(500/5000); rp = 5; rs = 12; T = 1;
wp = 0.08*pi; ws = 0.2*pi; rp = 5; rs = 12; T = 1; fs=1/T;

Apply impulse-invariant transformation, T

so

.
T

Then the analog frequencies are given by

0.08 rad / sec and s s 0.2 rad / sec


T
T

% Impulse Invariance: Conversion of digital to analog frequencies


Op = 0.08*pi ; Os = 0.2*pi;

100.1 s 1
log

100.1 p 1

1.05 2
The order of low pass filter is, N

log s
p
N = ceil((log10((10.^(0.1*abs(rs))-1)./(10.^(0.1*abs(rp))-1)))/(2*log10(Os/Op)));
N

The order of low pass filter for the given magnitude response is 2. The transfer function for II order
normalized low pass filter is given by,

H ( s)
The cut off frequency is given by c

1
s 2s 1
2

p
10

0.1 p

1
2N

0.2073 rad / sec

Oc = Op / ((10^(.1*abs(rp))-1)^(1/(2*N)));
Oc

The desired analog filter transfer function of low pass filter can be obtained by replacing, s
That is s

s
.
c

s
s
.

c 0.2073

Therefore the analog filter transfer function is computed as


19

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

H a ( s)

1
2

s
s

2
1
0.2073
0.2073

0.0430
s 2 0.2932s 0.0430

% Lowpass to low pass filter transformation


b = [1]; a = [1 sqrt(2) 1];
[B A]=lp2lp(b,a, Oc);
B
A

Impulse-Invariant Transformation:
By converting single pole filters as

0.1466j
0.1466j
H a ( s)

s (0.1466 j 0.1466) s (0.1466 j 0.1466)


To convert analog low pass filter to digital low pass filter using impulse-invariant transformation,

1
1

pk T 1 in the above equation.


s pk
1 e z

substitute,

The poles are given by p1 0.1466 j 0.1466, and p2 0.1466 j 0.1466 .


Then the digital filter transfer function is

H [ z]

0.0370z 1
1.0000 -1.7088z 1 0.7459z 2

[bz,az] = impinvar(B,A,fs);
bz
az
freqz(bz,az,512,fs);

Magnitude (dB)

0
-10
-20
-30
-40

0.05

0.1

0.15

0.2
0.25
0.3
Frequency (Hz)

0.35

0.4

0.45

0.5

0.05

0.1

0.15

0.2
0.25
0.3
Frequency (Hz)

0.35

0.4

0.45

0.5

Phase (degrees)

0
-50
-100
-150
-200

20

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


Ex7: Design a Butterworth digital high pass filter with the following specifications

H (e j ) 0.2

0 0.2

0.8 H (e j ) 1

0.6

Using (i) Impulse-invariant transformation (ii) Bilinear transformation


Ans:

To design high pass filter, it is desired first to design LPF and transform into HPF. This is

illustrated as below.
The given specifications for high pass filter are:

1
1

0.2; 1

1
1

0.8; ph 0.6 ; sh 0.2

and s 20 log10 (0.2) 14dB

Then p 20 log10 (0.8) 1.9382 dB


The corresponding LPF specifications are

p 1.9382 dB, s 14dB, pl 0.2 and sl 0.6

(i) Impulseinvariant
transformation:
Apply impulse-invariant transformation, T
Since sampling period T is not given, assume T=1 second.
Therefore, p pT 0.2 rad / sec, and s sT 0.6 rad / sec

100.1 s 1

log

log
100.1 p 1

1.706
The order of the low pass filter is, N


log s
log s

p
p

The transfer function for second order normalized low pass filter is given by, H ( s)
The cut off frequency is c

10

p
0.1 p

1
2N

1
s 2 2s 1

0.7504 rad / sec

21

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

s sc

The denormalized high pass filter transfer function can be obtained by replacing s by

Then the analog filter transfer function

H a ( s)

1
2

0.7504
0.7504

2
1
s
s

s2
s 2 1.602s 0.5631

By converting into single pole filters

0.5129
0.5129
H a ( s) 1 2
2

s 0.5131 j 0.5131 s 0.5131 j 0.5131


Then the poles are p1 0.5131 j 0.5131, and p2 0.5131 j 0.5131
To convert analog high pass filter to digital high pass filter using impulse invariant transformation

1
1

pk T 1
s pk
1 e Z

Therefore, H ( z ) 1

0.5129

1 e

0.5129

(0.5131 j 0.5131)T 1
z
1 e

( 0.5131 j 0.5131)T 1

On simplification we get

H ( z)

0.025 0.508 z 1 0.3583z 2


1 1.043z 1 0.3583z 2

(ii) Bilinear Transformation:


Pre-warping in bilinear transformation

2

tan
T
2

0.2
0.6
p 2 tan
0.6498 rad / sec , and s 2 tan
2.7528 rad / sec
2
2
The order of low pass filter is

4.89
log
log


0.75 1.2986 2
N

2.7529
log s log

00.6498
p
The transfer function for second order normalized low pass filter is given by, H ( s)

The cut off frequency c

10

p
0.1 p

1
2N

s 2 2s 1

0.6498
0.7503 rad / sec
(0.75)1/2
22

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


The denormalized high pass filter transfer function can be obtained by
transformation s

c .

H a ( s)

1
2

0.7503
0.7503

2
1
s
s

s2
s 2 1.061s 0.562

To convert analog high pass filter to digital high pass filter using bilinear transformation

2 1 z 1
, we get the digital HPF transfer function as
T 1 z 1

H [ z]

1 z 1
4

1 z 1

1 z 1
1 z 1
4
1.061z 1 24

0.562
1 z 1
1 z 1

0.598 1.196 z 1 0.598 z 2


1 1.028 z 1 0.365 z 2

-------------------------------------------------------------------------------------------------------------------------------------

Design of Band Pass Filter


------------------------------------------------------------------------------------------------------------------------------------Formulate the BPF specifications into LPF specifications as shown in figure.

Find r min A , B , where A

12 l u

1(u l )

and B

22 l u

2 (u l )

log
.
Calculate the order of the filter. N
log r
Find the normalized LPF transfer function
The denormalized band pass filter transfer function H a ( s) can be obtained by replacing

s 2 l u

s(u l )

------------------------------------------------------------------------------------------------------------------------------------23

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


Ex6: Design a Butterworth band pass filter with the following specifications:

1 0.1 rad / sec; 2 0.7 rad / sec; l 0.25 rad / sec , u 0.35 rad / sec; p 3 dB and

s 30 dB . Using (i) Bilinear Transformation, and (ii) Impulse-invariant transformation

(i) Bilinear transformation:


The specifications for band pass filter are p 3 dB and s 30 dB

2 0.7 rad / sec; l 0.25 rad / sec u 0.35 rad / sec; T 1 sample / sec
Apply bilinear transformation,

2

tan
T
2

0.1
0.7
1 2 tan
0.31676 rad / sec; 2 2 tan
3.925 rad / sec
2
2
0.25
0.35
l 2 tan
0.8284 rad / sec; u 2 tan
1.225 rad / sec
2
2

12 l u

(0.3167)2 0.8284 1.225


7.279
1 (u l )
0.3167(1.225 0.8284)
22 l u (3.925)2 1.225 0.8284
B

9.244
2 (u l )
3.925(1.225 0.8284)
r min A , B 7.28 rad / sec
A

The order of the low pass filter is given by,

5.5338
log log


0.9976 0.863 1
N
log r
log 7.28
The transfer function for first order normalized low pass filter is given by, H ( s ) 1

s 1

Denormalized band pass filter can be obtained by replacing s

s 2 l u

s(u l )

24

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

s 2 l u s 2 0.8284 1.225

s( u l ) s(1.225 0.8284)
2
s s 1.048
0.3966s

Therefore, H ( s)

1
0.3966s
2
s 0.3966s 1.0148
s 1.0148

1
0.3966s
2

To convert analog low pass filter to digital band pass filter using bilinear transformation, substitute

2 1 Z 1

,
T 1 Z 1
1 Z 1
0.3966 2
1
1 Z
H (s)
2
1 Z 1
1 Z 1
4

0.3966

2
1.0148

1
1
1 Z
1 Z

On simplification, H ( z )

0.316(1 Z 2 )
1 1.027 Z 1 0.726Z 2

(ii)Impulse-invariant transformation:
Apply impulse-invariant transformation, T . Since sampling period T=1 sec

1 1 0.3141rad / sec; 2 2 2.199 rad / sec


l l 0.7854 rad / sec; u u 1.099 rad / sec

1 2 l u (0.3141) 2 0.7854 1.099

10.8852
1 ( u l )
0.3141(1.009 0.7854)

2 2 l u (2.199) 2 0.7854 1.099

8.079
2 ( u l )
2.199(1.099 0.7854)

r min A , B 8.079 rad / sec


The order of low pass filter is given as,

5.5338
log log


0.9976 0.82 1
N
log r
log 8.079
The transfer function for I order normalized low pass filter is given by H ( s)

1
.
s 1

25

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


Denormalized band pass filter can be obtained by replacing, s

s 2 lu
s ( u l )

s 2 l u s 2 0.7854 1.099

s( u l ) s(1.099 0.7854)
2
s s 0.863
0.3137 s

H ( s)

1
0.3137 s
2
s 0.3137 s 0.863
s 0.863

1
0.3137 s
2

On factorization, we get first order poles as

H a ( s)

0.1568 j 0.02686
0.1568 j 0.02686

s (0.1568 j 0.9156) s (0.1568 j 0.9156)

To convert analog band pass filter to digital band pass filter in impulse-invariant transformation.

1
1

pk T 1
s pk
1 e Z
The poles of equation (1) are p1 0.1568 j 0.9156; p2 0.1568 j 0.9156

0.1568 j 0.02686
0.1568 j 0.02686

0.1568

j
0.9156)

1
1 e
z
1 e( 0.1568 j 0.9156) z 1
0.1568 j 0.02686
0.1568 j 0.02686

j
0.9156

1
1 0.8549e
z
1 0.8549e j 0.9156 z 1
0.3136 0.1996 z 1

1 1.0416 z 1 0.7292 z 2

H ( z)

-------------------------------------------------------------------------------------------------------------------------------------

Design of Band Stop Filter


------------------------------------------------------------------------------------------------------------------------------------Formulate the BPF specifications into LPF specifications.

Find r min A , B , where A

1 (u l )
12 u l

and B

2 (u l )
22 u l

log
. Find the normalized LPF transfer function
Calculate the order of the filter. N
log r
The denormalized band stop filter transfer function H a ( s) can be obtained by replacing

s(u l )
s 2 l u

------------------------------------------------------------------------------------------------------------------------------------26

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


Ex7: Design a Butterworth band elimination filter with the following specifications:

p 2dB, s 10dB, and T 1sec .The pass band frequencies are 0.07 and 0.8 and stop band
frequencies are 0.2 and 0.3 .
Use (i) Impulsive-invariant transformation, and (ii) Bilinear transformation
Ans: Given specification for band elimination filter are,

p 2dB, s 10dB,0.07 p 0.8 , 0.3 s 0.2


(i) Impulsive-invariant transformation
Apply Impulse-invariant transformation,

since T=1 sec

T
1 0.2 rad / sec; 2 0.3 rad / sec; l 0.07 rad / sec; u 0.8 rad / sec
A

1 (u l )
0.2 (0.8 0.07 )

9.125
12 u l (0.2 )2 0.8 0.07

2 (u l )
0.3 (0.8 0.07 )

6.441
2 2 u l
(0.3 )2 0.8 0.07

Therefore r min A , B 6.441


Then the order of the low pass filter is given by,

3
log log


0.7647 0.7338 1
N
log r
log 6.441
The transfer function for I order normalized low pass filter is given by , H ( s ) 1

s 1

Denormalized band pass filter can be obtained by replacing s

s 2 l u

s(u l )

s(0.8 0.07 )
s 2 0.8 0.07

Therefore, H a ( s)

s 2 l u

s(u l )

2.29s
s 0.552
2

1
s 2 0.552

s 2 2.29s 0.552
2.29s
2
1
s 0.552

By computing single pole filter H a ( s) 1

2.65
0.3598

s 2.0162 s 0.2738

27

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


To convert analog band elimination filter to digital band pass filter in impulse-invariant
transformation substitute

H ( z) 1

1
1

p
s pk
1 e k T z 1

2.65
1 e2.0162T z 1

0.36
1 e0.2735T z 1

2.65
0.36

1
1 0.1332 z
1 0.7605z 1

On simplification, we get the digital filter transfer function as

H ( z)

2 1.6011z 1 0.1z 2
1 0.8938 z 1 0.1z 2

(ii) Bilinear transformation: By applying Bilinear transformation, we get

0.3
0.6495 rad / sec; 2 2 tan
1.018 rad / sec

2
0.07
0.8
l 2 tan
0.2206 rad / sec; u 2 tan
6.142 rad / sec
2
2
(u l )
0.6495(6.142 0.2206)
A 1 2

4.1216
1 u l (0.6495)2 6.142 0.2206

2

0.2
tan 1 2 tan
T
2
2

2 (u l )
22

u l

1.018(6.142 0.2206)
18.926
(1.018)2 6.142 0.2206

r min A , B 4.1216
The order of the low pass filter is given by,

3
log log


0.7647 0.965 1
N
log r log 4.1214
The transfer function for I order normalized low pass filter is given by , H ( s ) 1

s 1

s ( l )
Denormalized band pass filter can be obtained by replacing s 2 u
s lu

s(u l )

s(6.142 0.2206)
5.9214s
s
2
2
s 6.142 0.2206
s 1.3549

s l u
1
s 2 1.3549

Therefore, H ( s)
s 2 5.921s 1.3549
5.9214s
2
1
s 1.3549
2

To convert analog low pass filter to digital band pass filter using bilinear transformation, substitute

2 1 z 1
,
T 1 z 1

28

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


2

H [ z]

On simplification,

1 Z 1
2 1 Z 1 1.3549

1 Z 1
1 Z 1
2

5.9214

1.3549
1 Z 1

1 Z 1

H ( z)

0.3113 0.3076Z 1 0.3113Z 2


1 0.3076Z 1 0.377 Z 2

6. Chebyshev Filters:
Type1: All pole filters. Equi-ripple in the passband
monotonic in the stopband.
Type2: Both poles and zeros. Monotonic in the
passband and equiripple in the stopband.
The magnitude response of N-th order filter is expressed as

| H ( j ) | 2

1
2
1 2C N
p

where is ripple parameter and C N ( x) is the N-th order Chebyshev polynomial defined as

C N ( x) cos( N cos 1 x), | x | 1: Passband , and


C N ( x) cosh( N cosh 1 x), | x | 1: Stopband.
Properties:

C N ( x) C N ( x) , N -odd;
C N ( x) C N ( x) , N -even;
C N (0) 0 , N -odd;
N

C N (0) (1) 2 , N -even;


C N (1) 1 , for all N.
C N (1) 1 , N -even;
C N (1) 1 , N -odd;
C N ( x) oscillates with equal ripple between 1 for | x | 1 .
C N ( x) is monotonically increasing for | x | 1 , for all N.
Comparison with Butterworth Filter:
Chebyshev filter exhibits ripples in the passband or stopband, where as in Butterworth filter
monotonically decreases.
29

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


The transition band is more in Butterworth filter compared to Chebyshev filter.
The poles in Butterworth filter lies on circle and Chebyshev filter lies on ellipse.
The order of the Chebyshev filter is less than that of Butterworth filter. i.e., the number of poles
is more in Butterworth filter when compared to Chebyshev filter.
Chebyshev filter Design:
Step1: From the given specifications, find the order of the filter N,

0.1

p 1
10
100.1 s 1

cosh 1 s
p

cosh 1

log

22

12

1
1

log s
p

cosh 1
cosh 1

s
p

Round to the next higher integer.


Step2: Using the following formulas, find the values of a and b which are minor and major areas of
the ellipse respectively.

N1 N1
a p
2

where

N1 N1
b p
2

1 2 1; 100.1 p 1 .

Step3: Calculate the poles of Chebyshev filter which lies on ellipse by using the formula:

sk a cos k j b sin k , where k

(2k 1)
,
2N

k 1, 2,. . . , N

Step4: To find the transfer function


1. Using above poles, find the denominator polynomial.
2. The numerator of transfer function depends on the value of N

(a) For N-odd, substitute s = 0 in the denominator polynomial and find the value. This value is
equal to the numerator of the transfer function.

(b) For N-even, substitute s = 0 in the denominator polynomial and divide the value by

1 2 .

30

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


Ex8: Design a digital Chebyshev low pass filter with the following specifications:
(a) The Impulse invariance analog prototype low pass filter transfer function

H a ( s)

0.262
s 2 0.512s 0.3277

(b) The Bi-linear transformation analog prototype low pass filter transfer function

H a ( s)

0.2809
s 2 0.53s 0.351

Ans: (a) The single pole filter transfer functions are derived from the given Impulse invariance analog
prototype filter transfer function as below:

H a ( s)

0.256 j
0.256 j

s (0.256 j 0.512) s (0.256 j 0.512)

The impulse Invariance transformation for converting an analog low pass filter to a digital low pass filter
is derived by substituting

H ( z)

1
1

p
s pk
1 e k T z 1
0.256 j

1 e(0.256 j 0.512)T z 1

On simplification, we get H ( z )

0.256 j
1 e(0.256 j 0.512)T z 1

0.194 z 1
1 1.3495 z 1 0.6 z 2

(b) The Bi-linear transformation for analog prototype low pass filter transfer function is computed by
substituting s

H ( z)

2 1 z 1
0.2809
in H a ( s)
, we get

1
2
T 1 z
s 0.53s 0.3561

0.2809
2

2 1 z 1
2 1 z 1

0.53
0.3561

1
T 1 z 1
T 1 z
1 2 z 1 z 2
0.052
1 1.349 z 1 0.609 z 2

Ex9: Design a digital Chebyshev high pass filter with the following specifications:
The analog prototype low pass filter transfer function

H a ( s)

0.06175
and the cut-off frequency is c 0.01 .
s 0.06175

Ans: Given that analog prototype low pass filter transfer function H a ( s)
The high pass filter transfer function is computed by substituting s

c
.
s

0.06175
s 0.06175

Therefore the high pass filter transfer function

31

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

0.06175
s
.

0.01
s

0.5085
0.06175
s
1
1
For Impulse Invariance transformation,
. Here pole pk 1 .

p
s pk
1 e k T z 1
H HPF ( s)

2 1 z 1

T 1 z 1
0.7973(1 z 1 )

H [ z]

1 0.596 z 1
2 1 z 1

0.5085

T 1 z 1

32

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE

Exercise-14
1. Define the ideal digital filters both in mathematical expressions and graphical representations.
Compare the practical filters and with ideal filters.
2. Explain the magnitude response of a digital filter. Illustrate all the filter parameters.
3. Illustrate the steps involved in designing IIR digital high pass filters using Impulse Invariance
transformation.
4. Illustrate the steps involved in designing IIR digital low pass filters using Bi-linear transformation.
5. Design a digital low pass filter Butterworth filter with pass band and stop band cut-off frequencies
200 Hz and 500 Hz respectively. The pass band attenuation is -5 dB and stop band attenuation is 12 dB. The sampling frequency is 5 KHz.
Use (i) Impulse Invariance Method, and (ii) Bilinear transformation.
Hint: First convert analog frequencies into digital frequencies using formula 2

The digital pass band frequency p 2

The digital stop band frequency p 2

Fp
Fsam

F
Fsam

200
0.08 rad/sec and
5000

Fs
500
2
0.2 rad/sec.
Fsam
5000

Then Design the digital filter using the procedure given.


6. Design a digital Butterworth low pass filter with the following specifications:

0.7 | H [e j ] | 1,

0 0.2

| H [e j ] | 0.3,

0.2 0.6

Use (i) Impulse Invariance Method, and (ii) Bilinear transformation.


7. The pass band and stop band cut-off frequencies are 350 Hz and 1000 Hz respectively. The
attenuation at pass band and stop band are -3 dB is -10 dB respectively. The sampling frequency is
5 KHz. Design a digital low pass filter Butterworth filter using (i) Impulse Invariance Method, and (ii)
Bilinear transformation.
8. Design a digital Butterworth high pass filter with the following specifications:

| H [e j ] | 0.2,
0.8 | H [e j ] | 1,

0 0.2
0.6
33

Dr. M. Venu Gopala Rao, Professor, Dept. of ECE


Use (i) Impulse Invariance Method, and (ii) Bilinear transformation.
9. The pass band and stop band cut-off frequencies are 350 Hz and 1250 Hz respectively. The
corresponding pass band and stop band attenuation are -3 dB is -10 dB respectively. The sampling
frequency is 5 KHz. Design a digital high pass filter Butterworth filter using (i) Impulse Invariance
Method, and (ii) Bilinear transformation.
10. The specifications for digital band pass filter are as follows:

1 0.2 rad / sec; 2 0.7 rad / sec; l 0.35 rad / sec , u 0.35 rad / sec; p 3 dB
and s 10 dB . Design a digital Butterworth band pass filter Using

(i) Bilinear Transformation,

and (ii) Impulse-invariant transformation


11. Design a digital Butterworth band pass filter with the following specifications. The pass band cut-off
frequencies 600 Hz and 1000 Hz, and stop band frequencies 300 Hz and 1600 Hz respectively. The
pass band attenuation is -3 dB and stop band attenuation is -10 dB. The sampling frequency is 5
KHz. Use (i) Impulse Invariance Method, and (ii) Bilinear transformation.
12. Design a digital Butterworth band stop filter for the pass band attenuation is -3 dB and stop band
attenuation is -10 dB at sampling rate 1 second. The pass band frequencies are 0 0.03 and

0.7 , and the stop band frequencies range is 0.1 0.25 . Use (i) Impulse Invariance
Method, and (ii) Bilinear transformation.
13. Design a digital Chebyshev low pass filter with the following specifications:

0.457

The analog prototype filter transfer function H a ( s)


.
s 2 0.676s 0.571
14. Design a digital Chebyshev high pass filter with the following specifications:
The Impulse invariance analog prototype low pass filter transfer function H a ( s)

0.31416
and
s 0.31416

the cut-off frequency is 0.1 .


15. Compare Chebyshev filter approximations with Butterworth filter approximations.
16. Illustrate briefly how a digital filter is designed?
17. What is warping? Illustrate.
18. Illustrate briefly the designing steps for (a) Impulse Invariance (b) Bi-linear transformation.

34

Anda mungkin juga menyukai