Signals and Systems 講義 國立交通大學 電機系 陳永平 編 23. IIR Design A digital filter is an algorithm to convert a sequence of numbers representing an input signal into another sequence of numbers which changes the character of the input signal in some prescribed feature. Here, we will focus on the design of LTI digital filter to behave closely with a reference analog filter, especilly a lowpass filter.

An nth-order discretized LTI filter can be described by the following difference equation

yk an1 yk 1 a1 yk  n 1 a0 yk  n (1)

 bnuk bn1uk 1 b1uk  n 1 b0uk  n whose impulse response is h[k] and is given as  Yz b z n  b z n1  b z  b k n n1 1 0 (2) Hz  hkz   n n1 k0 Uz z  an1z  a1z  a0

The problem in digital filter design is to determine the set of coefficients ai and bi so that the filter performs the desired behavior.

Based on the duration of impulse response h[k], the digital filters can be classified into two types, the infinite impulse response (IIR) and the finite impulse response (FIR). The impulse response h[k] of an IIR filter contains an infinite number of samples and the filter is often realized in a recursive structure. Below shows the structure of an 3-rd order IIR filter.

b0

b1

b2

u[k] y[k] 1 1 1 + z z z b3 +    a2

a1

a0

From (1), the example of 3-rd order IIR filter can be expressed as the following difference equation

yk a2 yk 1 a1 yk  n 1 a0 yk  n (3)

1/5 Signals and Systems 講義 國立交通大學 電機系 陳永平 編

 b3uk b2uk 1 b1uk  2 b0uk  3 Its transfer function is

3 2 b3 z  b2 z  b1z  b0 Hz  3 2 z  a2 z  a1z  a0

  hkz k  h0 h1z 1  hnz n  (4) k0 and clearly h 0, i.e., the impulse response indeed consists of an infinite number of samples.

The impulse response h[k] of an FIR filter contains a finite number of samples and the filter is often realized in a nonrecursive structure. Below shows the structure of an 3-rd order FIR filter.

b0

b1

b2

u[k] y[k] 1 1 1 z z z b3 +

From (1), the example of 3-rd order FIR filter can be expressed as the following difference equation

yk b3ukb2uk 1b1uk  2b0uk 3 (5) Its transfer function is

1 2 3 Hz b3 b2 z b1z b0 z (6)  h0z0  h1z1  h2z2  h3z3 and clearly hk  0 for k>3, i.e., the impulse response only consists of a finite number of samples.

Next, we will discuss the design of the IIR digital lowpass filter based on the bilinear transform method. It is known that the z-transform H(z) and H(s) are related by the condition: z  esT (7) which is not an easy work to implement the relation. Instead, the so-called bilinear transform H(p) is employed by introducing a variable p which is defined as

2/5 Signals and Systems 講義 國立交通大學 電機系 陳永平 編 sT sT  1 z 1 1 esT e 2  e 2 sT p  C 1  C sT  C sT sT  Ctanh (8) 1 z 1 e  2 e 2  e 2 In , let s=j then jT T f   p  Ctanh  jC tan  jC tan  jC tan v (9) 2 2 2 f0  2  1 f where   2f , f0  and v  . Let the imaginary part of p be , then (9) can 2T f0 be written as   p  jC tan v  j (10)  2  i.e.,     Ctan v (11)  2  which is periodic and implies only the frequency response in the range of 0ff0 or 0v1 is required for filter design. The relationship p,z and s-planes are illustrated in the following figure.

A C  z-plane s-plane D p-plane j B C B B 1 1 A A C A 0 0 D C D D j B A C 

   From (11), if v is small or f  f0 we have tan v  v . That means (11)  2  2 can be approximate as  f T   C v  C  C (12) 2 2 f0 2 Then, the constant C can be chosen to satisfy    and obttained as

3/5 Signals and Systems 講義 國立交通大學 電機系 陳永平 編 2 C   4 f (13) T 0 for small v. In addition, we can also choose C such that =p is a particular frequency of a prototype analog filter and =c is the desired cutoff frequency. Hence,

cT  C   p cot  (14)  2  Now, let’s use some examples of lowpass filter design for demonstration.

Example

Under sampling rate 2kHz and based on the bilinear transformation, derive a 1st order lowpass digital with cutoff frequency 200Hz and it is required that its low frequency response is closed to the analog filter.

Sol:

Choose the digital filter as below: 1 1 400 Hp    p p 1 1 p  400 c 400 where the desired cutoff frequency is 200Hz or c=400 rad. To fit the requirement, we choose C based on (13) for low frequency response, i.e., 2 C   2 2000  4000 T From (8), we have 1 z 1 1 z 1 p  C  4000 1 z 1 1 z 1 Hence, the digital filter is designed as 400 400  Hp    p  400  1 z 1   1 z 1  4000   400 10    1   1   1 z   1 z  3.1416 1 z 1 0.23911 z 1       101 z 1  3.14161 z 1  1 0.5219z 1

4/5 Signals and Systems 講義 國立交通大學 電機系 陳永平 編 Example

Under sampling rate 1kHz and based on the bilinear transformation, derive a lowpass digital filter from the 2nd order with cutoff frequency 100 Hz.

Sol:

Choose the prototype 2nd order butterworth filter below: 1 Hp  11.414 p  p2 where p=1 is the normalized cutoff frequency. Since the desired cutoff frequency is

100Hz or c=200 rad. According to (14), we have

cT   200     C  p cot   cot   cot   3.0777  2   2000  10  which from (8) yields 1 z 1 1 z 1 p  C  3.0777 1 z 1 1 z 1 Hence, the digital filter is designed as 1 1 Hp  2  2 11.414 p  p  1 z 1   1 z 1  11.4143.0777   3.0777   1   1   1 z   1 z  0.0675 z 2  2z 1    z 2 1.143z  0.413

5/5