You are on page 1of 48

BioMedSigProcAna

An Iir-Filter Example:
A Butterworth Filter
Josef Goette
Bern University of Applied Sciences, Biel
Institute of Human Centered Engineering - microLab
Josef.Goette@bfh.ch

February 18, 2013

Contents
1 Introduction

2 Analog Butterworth Lowpass-Filters

3 Continuous-to-Discrete Transformations
3.1 Impulse Invariance Transformation . . . . . . . .
3.2 Bilinear Transformation . . . . . . . . . . . . . .

10
12
23

4 Discrete-Time Butterworth Filter Example


4.1 Design Using Impulse-Invariance Transformation
4.2 Design Using Bilinear Transformation . . . . . .

29
31
39

References

33 Iir Butterworth

46

2013

BioMedSigProcAna

c
Josef
Goette, 20072013
All rights reserved. This work may not be translated or copied in
whole or in part without the written permission by the author, except
for brief excerpts in connection with reviews or scholarly analysis.
Use in connection with any form of information storage and retrieval,
electronic adaptation, computer software is forbidden.

33 Iir Butterworth

ii

2013

BioMedSigProcAna

Introduction

In the present document, we use, as usual, the following notation: Continuous-time signal frequencies come in standard
characters such as f for the frequency in Hertz ([Hz]), and for
the radian frequency in [rad/sec], = 2f . The corresponding
discrete-time signal frequencies use the corresponding symbols
with hats: f =
f /fs = f Ts and
= Ts = /fs with fs being the sampling frequency in [Hz] and Ts the corresponding
sampling interval Ts = 1/fs in [sec].
We abbreviate continuous-time by Ct and discrete-time
by Dt. Further abbreviations are C2d for continuous-to-discrete, Tf for transfer function, and Lhp for left-half plane.
We very closely follow [OS75] for the developments in the
present document; see our additional remarks on details, which
appear after the bibliography at the very end of the document
on page 46.

33 Iir Butterworth

2013

BioMedSigProcAna

An Iir-Filter Design Approach


Iir (recursive) filters are often design by what might be called
analog prototyping
design a normalized Ct lowpass prototype filter
then: apply frequency-band transformations such as

lowpass
lowpass
lowpass
lowpass

to
to
to
to

lowpass
highpass
bandpass
bandstop

then: apply a continuous-to-discrete transformation


here: we work-out a Butterworth-filter example
The acronym Iir stands for infinite impulse response; theoretically, the impulse response of this kind of filters never completely dies out. Of course, stable Iir filters have an impulse
response that approaches more and more the zero line as time
passes by; if the filter runs on a digital computer with floatingpoint arithmetic, then the impulse response will eventually become smaller than the smallest positive representable number;
if it runs on a digital computer with fixed-point arithmetic, then
the impulse response might begin to oscillate without endsee
the discussion to the keyword limit cycles in our document
[Goe13].
Recall that the acronym Ct means continuous time.
Matlab supplies the following commands for frequencyband transformations: lp2lp() for the lowpass-to-lowpass transformation; lp2hp() for the lowpass-to-highpass transformation;
33 Iir Butterworth

2013

BioMedSigProcAna
lp2bp() for the lowpass-to-bandpass transformation; and the
command lp2bs() for the lowpass-to-bandstop transformation,
respectively.
Matlab has also commands for the continuous-to-discrete
transformations, some of which stem from the Control System
Toolbox (use help c2d), and some others from the Signal Processing Toolbox (use help impinvar and use help bilinear).1
As the table of contents reveals, we discuss in the present document the design based on the impulse-invariance transformation
and the design based on the bilinear transformation.
But also note that Matlab supplies higher level commands that integrate the mentioned lower level commands
and thus considerably simplify the design of discrete-time and
even digital filters from an user perspective; you might also want
to try out the graphical filter design tool fdatool (use help
fdatool to obtain a short description, and type fdatool in the
Matlab command window to run the Gui).

1 The mentioned toolboxes just have different names for the commands;
the algorithms behind these names are, however, very similar or even identical.

33 Iir Butterworth

2013

BioMedSigProcAna

Analog Butterworth Lowpass-Filters

Butterworth Filter Properties


magnitude response is maximally flat in passband ; for
a N -th order lowpass, the first (2N 1) derivatives of the
squared magnitude function are zero at = 0
the approximation to the ideal rectangular lowpass characteristic (brick-wall) is monotonic in passband as well as
in stopband
squared magnitude function
|HCt (j)|2 =

1
1+

j
jc

2N

specified by just 2 parameters


the filter order N
the 3 dB cutoff-frequency c

We also often call these analog filters continuous-time (Ct)


filters.

33 Iir Butterworth

2013

BioMedSigProcAna

Magnitude-Squared and Magnitude Responses


.

|HCt (j)|2
1

1/2

.............................................................................
........ ........ ..... ...
....... ..... .... ..
....... ..... .. ... N = 1, 2, 4, 8
........ .........
..................
...........
.......................
...................................
........ .......... ...........................
.........
... ....... ..................
...... ............ ...........................................................................................
.........................................................................................................................................

.
|HCt (j)|
1

1/ 2

...................................................................................
............. ..................
......................... N = 1, 2, 4, 8
....................
.........................
........................................
........ .......... ...........................
...............................
... ...... .............
..........................
......
... ........
.... ......... ......................................
.......................................
...... ................
............... .........................................
................................................................................................

Recall that the


linear gain 1/ 2 corresponds to 3 dB; we
have 20 log10 (1/ 2) = 3.0103.
Butterworth filters have a frequency magnitude response with
no ripple, neither in the passband nor in the stopband. As the
parameter N in the squared magnitude function on page 4 increases, the filter characteristics become sharper, meaning that
if N increases, the characteristic in the passband stays closer to
unity whereas the characteristic in the stopband comes close to
zero more rapidly.
Other well known analog filters are the Chebyshev filters, the
inverse Chebyshev filters, and the Cauer filters. The Chebyshev
33 Iir Butterworth

2013

BioMedSigProcAna
filters have a frequency magnitude response with a ripple in
the passband but no ripple in the stopband; inverse Chebyshev
filters have a dual characteristic to that of the Chebyshev filters:
they have no ripple in the passband but a ripple in the stopband;
Cauer filtersalso called elliptic filtershave a ripple in both,
in the passband as well as in the stopband.
Chebyshev filters are often also called Chebyshev type I filters, whereas inverse Chebyshev filters are then called Chebyshev
type II filters.
For a comparable frequency filtering performance, Butterworth filters need the highest order, Chebyshev type I and Chebyshev type II filters need medium orders, and Cauer filters need
the lowest order. A higher order means a higher number of operations needed to compute an output sample, and the need of
a higher number of storage cells.

33 Iir Butterworth

2013

BioMedSigProcAna

Transfer Function Poles


denote by HCt (s) the transfer function of the Butterworth
filter
from squared magnitude function we see that (j s)
1

HCt (s)HCt (s) =


1+

s
jc

2N

poles of squared magnitude function are


spk = (1)1/(2N ) (jc )
 

1 1 + 2k
= c exp j
, k = 0, 1, . . . , (2N 1)
+
2
2N

33 Iir Butterworth

2013

BioMedSigProcAna

Transfer Function Poles: N = 3 Example


for N = 3 ; 2N = 6:

1/6

spk = (1) j c

1/6
ej/2 c
= ej(+k2)
j/2
= ej/6 |ejk2/6
{z } |e {z } c
60
90
spacing rotation

...................................
............
........
........
.......
......
......
.....
.
.....
.
.
.
...
....
.
.
....
..
.
...
.
...
...
.
...
.
.
.
...
...
.
...
..
....
..
....
..
...
..
..
...
..
.
...
...
...
..
.
...
..
.
...
...
...
...
...
..
...
...
...
.
.
...
..
....
...
.....
....
......
......
.......
......
.
.
.
........
.
.
.
.............
.....
...............................

..............................
............
.......
.......
......
......
.....
.....
....
.
.
.
....
...
.
.
...
...
...
.
...
..
.
...
....
...
...
...
...
..
..
..
...
..
...
...
...
..
.
...
.
.
.
...
...
...
...
...
...
...
....
...
.
.
.....
.
....
......
......
.......
.......
.........
......................................

2N = 6-th roots of (-1)

corresponding Butterworth poles

We see then that the poles of the Butterworth squared magnitude function have an angular spacing of 2/(2N ) = /N for
an N -th order Butterworth filter. We further have for these
poles
that they are distributed around a circle with radius c ;
that they are distributed symmetrically on either side of
the imaginary axis;
that there are no poles on the imaginary axis itself;
and that there are poles on the real axis if N is odd, but
not if N is even.
33 Iir Butterworth

2013

BioMedSigProcAna

Transfer Function
to determine the Tf HCt (s) from the Butterworth squaredmagnitude function: perform factorization HCt (s)HCt (s)
observe that poles in squared magnitude function appear
in pairs
if s = sp is a pole
then s = sp is also a pole
to construct HCt (s) from squared magnitude function
choose one pole of each pair
choose stable pole (in Lhp) of each pair
.......................................
..........
........
.......
......
......
......
......
.....
.
.
.
1
...
...
.
...
.
..
...
.
.
...
...
...
.
..
...
.
...
..
.
...
.....
..
...
..
...
...
...
..
...
...
..
... 0
.
c
...
..
.
...
...
...
...
...
..
...
..
.
...
.
..
...
...
....
....
...

.....
....
...... 1
.....
.
.
.
.
.
......
......
........
............
........
..................................

poles of N = 3-rd order


Butterworth transfer-function:
HCt (s) =

p =

p0 p1 p1
(s p0 )(s p1 )(s p1 )

33 Iir Butterworth

2013

BioMedSigProcAna

Continuous-to-Discrete Transformations

C2d-Transformation Procedures
there are various procedures to transform an analog prototypefilter design into a discrete-time filter:
impulse-invariance transformation
procedures based on numerical solution of differential equations
first forward-difference (forward Euler)
first backward-difference (backward Euler)
bilinear transformation

We discuss in more detail the impulse-invariance transformation in Subsection 3.1 below.


For the procedures based on numerical solution of differential equations we note that the forward Euler transformation
is the most simple transformation that has, however, the drawback that an unstable discrete-time system might result from a
stable continuous-time (analog) prototype system. The transfer
function H(z) of the discrete-time filter is obtained here by replacing the variable s in the continuous-time prototype transfer

33 Iir Butterworth

10

2013

BioMedSigProcAna
function HCt (s) by (z 1)/Ts , where Ts denotes the sampling
interval, Ts = 1/fs with fs being the sampling frequency:
forward Euler:

s=


1
1 1 z 1
z1 =
.
Ts
Ts z 1

The backward Euler transformation has the advantage over


the forward Euler transformation that stable continuous-time
designs are transformed into stable discrete-time designs. The
transformation is given by
backward Euler:

s=


1 z1
1
1 z 1 .
=
Ts z
Ts

The bilinear transformation is the most often used transformation in the design of discrete-time filters;2 therefore, we
discuss it in more detail below in Subsection 3.2. For the interested reader we mention that the bilinear transformation is a
member of the larger family of Moebius transformations, which
are conformal mappings from complex plane to complex plane;
a reference is [Hen74, Chapter 5].

2 In the design of simple discrete-time control algorithms, the Euler approximations are likewise very often used.

33 Iir Butterworth

11

2013

BioMedSigProcAna

3.1

Impulse Invariance Transformation

The Impulse Invariance Transformation


given: continuous-time (Ct) prototype (analog prototype)
HCt (s) hCt (t) =
impulse response of Ct filter
find: for the discrete-time filter
H(z) h[n] =
impulse response of Dt filter
solution: sample the continuous-time impulse response
h[n] =
hCt (t = nTs )
where

Ts =
sampling time interval

The above formulae state, reformulated in words, that the


impulse response of the discrete-time filter is obtained from the
impulse response of the continuous-time (analog) prototype filter through sampling of the latter.

33 Iir Butterworth

12

2013

BioMedSigProcAna

Impulse Invariance: Transfer Functions


it can be shownsee the sampling processthat
the z-transformation of h[n] H(z)
is related to

the Laplace transformation of hCt (t) HCt (s)


by



H(z)

z=esTs




2
1 X
HCt s + j k
=
Ts
Ts
k=

from z = esTs :
strips of width 2/Ts is s-plane
map onto entire z-plane

33 Iir Butterworth

13

2013

BioMedSigProcAna

Impulse Invariance: Mapping of Planes


s-plane
..(s)

..
..
..
..
.
. . . . . . . . . . . . . . . . . . . . . . . . . ..
.
. . . . . . . . . . . . . . . . . . . . . . . . . ..
.
. . . . . . . . . . . . . . . . . . . . . . . . . ..
.
. . . . . . . . . . . . . . . . . . . . . . . . . ..
.
.
. . . . . . . . . . . . . . . . . . . . . . . . . ..
.
. . . . . . . . . . . . . . . . . . . . . . . . . ..
. . . . . . . . . . . . ..
...
...
..
..
..
..
..
.

z-plane

3
Ts

Ts

Ts

(s)

j
................................................................
.
.
.
..................................................
......................................................................
.........................................
................................................. 1
...................................
...................

3
Ts

strips of width 2/Ts is s-plane map onto entire z-plane


Lhp-part of each strip maps into unit circle

; stable poles of Ct filter go to stable poles of Dt filter

imaginary axis in s-plane maps onto unit circle such that


each segment of length 2/Ts is mapped once around the
circle

We should mention here that the mapping from the s-plane


to the z-plane induced by the impulse-invariance procedure is
no simple algebraic mapping, as are the mappings that result
from the procedures based on numerical solutions of differential
equations, an example of whichthe bilinear transformation
we discuss in Subsection 3.2.

33 Iir Butterworth

14

2013

BioMedSigProcAna

Impulse Invariance: Frequency Responses


the Dt frequency response is expressed in terms of the Ct
prototype frequency response as
H z=e




1 X
+j k
HCt j
=
Ts
Ts
Ts
k=

note:
if and only if
HCt (j) 0 ,

for ||

Ts

then




1
HCt j
H z = ej =
Ts
Ts
else aliasing

33 Iir Butterworth

15

2013

BioMedSigProcAna

Impulse Invariance: Aliasing


HCt (j)
1............
.. .....
.
.
.
.
.
.....
..
.......
.....
.
.
.
.
.........
.
.
.
.
.
.
.
.
................
....
.
.
.
.
.
.
.
.
.
.
.
.
.............................................
.
.
.
.
.
.
.
.
.
......................................
2fs
c

1 ........
. ..
Ts........ .......

H(e )

..........
.................
.... .......
....
...
...
....
...
...
.
...
...
...
...
...
...
...
...
...
...
...
...
...
.
.
.
.
...
.
.
.
...
...
.
.
....
..
.
.
.
.
.
.
.
.
.
.
.
....
....
....
..
..
...
.
.
.
.
.
.
.
.
.
.....
.
.
.....
.....
..
...
...
.
.
.
.
.
.
......
.
.
.
.
.
.
.
.
.
.
.
......
......
...
...
...
......
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
....... ......
....... .......
.......
.....
.
.
.
.
.
.
........
.
.
.
.
.
.
.
.
.
.
.
.
.
.....
..... ..............
..... ..............
.
.
.
.
.
.
.
.
.........
.
.
.
.
.
.
.
.
.
.
.............
.............
.......
.......
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
......................
..................................
..............
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
................................
.....................................................
.......................................................................................................................................................
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
..........................
..............

0
c

The above figure graphically shows the effects of aliasing: In


the upper panel we show the frequency response of a continuoustime filter prototype which is not bandlimited; in the lower
panel we show the first three aliasing parts giving, in sum together with all other aliasing parts, the discrete-time frequency
response.

33 Iir Butterworth

16

2013

BioMedSigProcAna

Impulse Invariance: Interpretation of Mapping


Ct transfer function: partial fraction decomposition
HCt (s) =

N
X

Ak
,
s sk

N
X

Ak esk t u(t)

k=1

hCt (t) =

sk =
poles

k=1

Dt impulse response and corresponding transfer function


h[n] = hCt (nTs ) =

N
X

Ak esk nTs u[n] =

k=1

k=1

H(z) =

N
X

k=1

N
X

Ak eskTs

n

u[n]

Ak
1 (eskTs ) z 1

We denote by u(t) the continuous-time unit-step function


and, correspondingly, by u[n] the discrete-time unit-step function.
Note that the above development is true if all poles have
multiplicity 1; for poles with higher multiplicities we must use
the corresponding partial fraction decompositions.

33 Iir Butterworth

17

2013

BioMedSigProcAna

Impulse Invariance: Interpretation of Mapping (2)


s-plane poles sk
transformation of poles:

transform to
z-plane poles zk = esk Ts

coefficients Ak are equal for Ct and Dt


if Ct filter is stable, then Dt filter is also stable
we note however that
although poles are mapped by zk = esk Ts
the complete planes are not mapped by that relation
for example: zeros of Dt transfer function are functions of the coefficients Ak and of the poles sk

Concerning the stability of the filters we know that the continuous-time filter is stable if and only if all of its poles are in the
left-half complex s-plane, real{sk } < 0. By the given mapping
of the poles
we
then have for the discrete-time poles zk that

|zk | = esk Ts < 1, meaning that the discrete-time poles are
inside of the unit circle, and in turn, that the discrete-time filter
is also stable.
It is important to note for the impulse-invariant transformation that, although the poles are mapped from the s-plane to
the z-plane by the relation zk = esk Ts , the planes themselves are
not mapped by that relation. For example, zeros are not mapped
in that way; the following simple example gives an illustration.

33 Iir Butterworth

18

2013

BioMedSigProcAna
Example. Consider the second-order continuous-time transfer
function
HCt (s) =
=

s+a
(s + a)2 + b2
1/2
1/2
+
,
s + a + jb s + a jb

having one zero at s = a, the second zero at infinity, and a


complex-conjugate pole pair at s = a jb.
The discrete-time transfer function obtained from the impulseinvariance transformation becomes
H(z) =

1/2
1

eaTs ejbTs z 1

1/2
1

eaTs e+jbTs z 1


+ ejbTs /2 z 1
e
1e
=
(1 eaTs ejbTs z 1 ) (1 eaTs e+jbTs z 1 )
aTs

+jbTs

1 eaTs cos(bTs )z 1
1 eaTs (e+jbTs + ejbTs ) z 1 + e2aTs z 2

z z eaTs cos(bTs )
= 2
.
z 2eaTs cos(bTs )z + e2aTs
=

This discrete-time transfer function has one zero at the origin


and the other zero at z = eaTs cos(bTs ). We thus see that,
although the poles are mapped by zk = esk Ts , the zeros are not
mapped according to this formula.

33 Iir Butterworth

19

2013

BioMedSigProcAna

Impulse Invariance: Practical Advice


if Ct prototype is sufficiently bandlimited, then




1
H ej HCt j
Ts
Ts
thus: high sampling rates (small Ts ) will minimize the
aliasing, but the Dt filter may obtain a very high gain
advice:
instead using
H(z) =

N
X

k=1

Ak
1 (eskTs ) z 1

N
X

Ak Ts
1 (eskTs ) z 1

use
H(z) =

k=1

the Dt impulse response then is


h[n] = Ts hCt (t = nTs )

33 Iir Butterworth

20

2013

BioMedSigProcAna

Impulse Invariance: Generalizations


one motivation to use the impulse-invariance procedure
if Ct prototype filter is bandlimited
then Dt filter frequency response closely approximates
the Ct frequency response
another motivation to use the procedure: control some
aspects of the time response of Dt filter
step invariance procedure
waveform invariance: extend the concept to preserve
the output wave-shape for a variety of inputs
final remark: besides aliasing, the impulse-invariance approach transforms the frequency responses linearly

The mentioned step-invariance procedure just obtains the


step response of the discrete-time filter by sampling the step
response of the continuous-time prototype filter. The resulting
discrete-time filter then might have desired step-response characteristics such as small rise time and low peak overshoot.
An important feature of the impulse-invariance procedure is
that, besides aliasing, the frequency responses of the continuoustime prototype filter and its discrete-time counterpart are linearly related, meaning that the shape of continuous-time frequency response is preserved in the discrete-time filter. This
result is in contrast to the procedures which use algebraic transformations, an example of whichthe bilinear transformation
we discuss in Subsection 3.2 below. We recall however, that the
33 Iir Butterworth

21

2013

BioMedSigProcAna
impulse-invariance design technique is only appropriate for essentially bandlimited filters. Thus, the design of highpass or
bandstop filters requires additional bandlimiting to avoid severe
aliasing distortions.

33 Iir Butterworth

22

2013

BioMedSigProcAna

3.2

Bilinear Transformation

Bilinear Transformation Formulae


given: Tf of analog prototype HCt (s)
find: Tf H(z) of corresponding discrete-time filter
solution: replace s in HCt (s) by
s=

2 1 z 1
Ts 1 + z 1

the inverse formula then is


z=

1 + (Ts /2)s
1 (Ts /2)s

You might want to verify the given formulae as follows: Start


with a first-order continuous-time prototype system and first
specify it by its differential equation; second, express the differential equation by its corresponding integral equation formulated for the n-th sampling time instant and its past neighbor
(n 1); third, approximate the involved integral by the trapezoidal rule; forth, replace the appearing derivatives by the expression given by the differential equation started with; fifth,
rearrange terms to obtain the difference equation of the discretetime system, and from it obtain the transfer function H(z).
Generalize to systems of order higher than one.

33 Iir Butterworth

23

2013

BioMedSigProcAna

Bilinear Transformation: Frequency Mapping


Ct frequencies ; on imaginary axis in s-plane: s = j
Dt frequencies
; on unit circle in z-plane: z = ej
unit circle maps to imaginary axis (and vice versa)

2 1 ej
s z = ej =
Ts 1 + ej
=
2
= j tan (
/2)
Ts
= j
therefore, frequency mapping is
=

2
tan (
/2)
Ts

= 2 arctan (Ts /2)

To fill-in the dots in the above derivation, first use





1ej = ej 2 ej 2 ej 2 ,




1+ej = ej 2 ej 2 + ej 2 ;

next use Eulers formulae

ej 2 ej 2
sin(
/2) =
,
2j

ej 2 + ej 2
cos(
/2) =
,
2

to obtain j sin(
/2)/ cos(
/2) which is equal to j tan(
/2).
33 Iir Butterworth

24

2013

BioMedSigProcAna

Bilinear Transformation: Frequency Mapping



=
Dt frequency

=
Ct frequency

the frequency mapping is

= 2 arctan (Ts /2)

.......................................
...........................
.
.
.
.
.
.
.
.
.
......
......
..
...

..
.
..
...
.
.
.
.
....
.............
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...............

33 Iir Butterworth

25

2013

BioMedSigProcAna

Bilinear Transformation: Mapping of Planes


the mapping s 7 z is
z=

1 + (Ts /2)s
1 (Ts /2)s

s-plane
.

..
..(s)
..
..
..
..
..
.. (s) =
..
..
..
..
..
..
..
..

. .. . .. . .. . .. . .. . .. . .. . .. . .. . .. . .. . .. . .. .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. .. . . .. . . . .. . . .. . . . .. . . .. . .
. . . . . . . . . . . . . .

33 Iir Butterworth

26

z-plane
image of
s .=
.. j

.
....................... ...
..............................................................
........................................
...................................................................................
......................................1
........................................
..............................
... ................
...j........

image of lefthalf plane

2013

BioMedSigProcAna

Bilinear Transformation: Mapping of Circles


in s-plane: Butterworth poles on a circle with radius c ,
equally spaced in angle
bilinear transformation is conformal mapping: Butterworth
circle in s-plane maps to a circle in z-plane
s-plane
.

...
..
..
..
..
..
..
..
..
..
..
..
..
..
..
.

z-plane

. .. . .. . .. . .. . .. . .. . .. . .. . .. . .. . .. . .. . .. .
. . . .. . . . .. . . .. . . . .. . . .. . . . .
. . . .. . . . .. . . .. . . . .. . . .. . . . .
. . . .. . . . .. . . .. . . . .. . . .. . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .........
. . . . . . . . . . . . . . . . . . ................... . . ..............
......
. . . . . . . . . . . . . . . ............ . . . . . . .
....
. . . . . . . . . . . . . . ...... . . . . . . . . . .
...
. . . . . . . . . . . . ....... . . . . . . . . . . . .
...
. . . . . . . . . . . ..... . . . . . . . . . . . . .
...
. . . . . . . . . . . .... . . . . . . . . . . . . . .
. . . . . . . . . . . .. . . . . . . . . . . . . . . .
..
. . . . . . . . . . ..... . . . . . . . . . . . . . . .
.
..
. . . . . . . . . . . .. . . . . . . . . . . . . . . .
.
.
.
. . . . . . . . . . . .... . . . . . . . . . . . . . .
.
. . . . . . . . . . . . .... . . . . . . . . . . . . .
...
. . . . . . . . . . . . ...... . . . . . . . . . . . .
..
.
.
. . . . . . . . . . . . . . ........ . . . . . . . . . .
.
.
. . . . . . . . . . . . . . . .......... . . . . . . . .
.....
. . . . . . . . . . . . . . . . . . ...................... . ..............
. . . . . . . . . . . . . . . . . . . . . . . . . .......
. . . .. . . . .. . . .. . . . .. . . .. . . . .
. . . .. . . . .. . . .. . . . .. . . .. . . . .
. . . .. . . . .. . . .. . . . .. . . .. . . . .
. . . .. . . . .. . . .. . . . .. . . .. . . . .
. . . .. . . . .. . . .. . . . .. . . .. . . . .
. . . . . . . . . . . . . .

c =

Butterworth
N = 3, 2N = 6

j
..
......
.. ......................................................................
.
........................
.
.
.
.
............................................................ .. .............
...
.... . . ...
. . . . . . . . ............
..
. .. . . . ...
...........................................................................

..... . .. . .. . ...
...
........................................................1
...
.
.
..........................................................
...
.....
................................... .........
................... .....................................
1c Ts/2
1+c Ts/2

1+c Ts/2
1c Ts/2

Note, however, that the Butterworth circle in the z-plane is


neither centered at the origin, nor are the poles equally spaced
in angle. But the left-half s-plane poles map into poles inside of
the unit circle; thereforeas is always the case with the bilinear
transformationwe obtain a stable discrete-time Butterworth
filter from a continuous-time Butterworth prototype.

33 Iir Butterworth

27

2013

BioMedSigProcAna

.......... 3 dB H(ej )[dB]


...
...
....
....
.....
.....
......
......
......
.....
.....
....
...

3dB

Bilinear Transformation: Frequency Responses

33 Iir Butterworth

.................
........................
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.............
.............
.
.
.
.
.
.
.
....... .....
......
...
.
.
.
.
.
...
.
.
.

= 2 arctan (Ts /2)


...
.
.
.
...
....
....

......... 3 dB
H
Ct (j)[dB]
...
...
....
....
.....
.......
........
.........
...........
...............
..................
....................
...............
3dB

28

2013

BioMedSigProcAna

Discrete-Time Butterworth Lowpass


Filter Example

Frequency-Response Specifications
here: specifications in the Dt frequency domain
requirements:
passband magnitude constant to within 1 dB
passband is 0

p =
0.2
stopband attenuation > 15 dB

stopband is 0.3 =

s

thus, if passband magnitude is normalized to 1


20 log10 H(ej0.2 ) 1


20 log10 H(ej0.3 ) 15

for convenience we may assume that the sampling-time


interval is Ts =
1

Note that we must distinguish between two different application scenarios: The first scenario designs a discrete-time filter
which is specified in the discrete-time frequency domain. This is
the situation we consider here and which allows to set the sampling time equal to one, because there exists no real continuoustime filter.
33 Iir Butterworth

29

2013

BioMedSigProcAna
The second application scenario emulates a continuous-time
filter with a discrete-time filter. Here the specifications are given
in the continuous-time frequency domain, and our design has to
select an appropriate sampling time interval Ts with which we
plan to implement the emulating discrete-time filter. Obviously,
in this scenario the sampling time interval cannot be set to unity.

33 Iir Butterworth

30

2013

BioMedSigProcAna

4.1

Design Using Impulse-Invariance Transformation

Analog Prototype Specifications


transform the Dt frequency specifications to corresponding specifications of a Ct prototype
recall:
impulse invariance design introduces aliasing
beside aliasing it linearly maps Ct to Dt frequencies
convenient procedure:
assume that aliasing is negligible
carry out design
verify performance of resulting filter
thus, mapping of critical frequencies is

p = 0.2

s = 0.3

p =
p /Ts =
p

20 log10 |HCt (jp )| 1

s =
s /Ts =
s

20 log10 |HCt (js )| 15

Recall that we have assumed that the sampling time interval


Ts is unity.
33 Iir Butterworth

31

2013

BioMedSigProcAna

Analog Butterworth Parameters


the Ct Butterworth squared magnitude function is
|HCt (j)|2 =

1
1+

2N

to do: determine the needed two parameters N and c


solving given specification inequalities with equality3
 0.1 
10 1
1 log 101.5 1
 = 5.8858
N=
0.2
2 log 0.3
to meet specifications: select N = 6
inserting N = 6 into passband equation gives c = 0.7032

Note that because we must round up N to the nearest integer, not both specifications, passband and stopband, can be
met exactly. If we insert N = 6 into the passband equation, the
passband specifications are met exactly and the stopband specifications are exceeded for the Ct filter. Such a choice allows
some margin for the aliasing that enters in the Dt filter.
We next supply the detailed steps leading to the above results. We start with the two equations in the two unknowns
3 See

the derivations in the text below.

33 Iir Butterworth

32

2013

BioMedSigProcAna
N and c that we obtain by setting the design specification
inequalities to equality:
|HCt (jp )|2 =

1
1+

p
c

0.1
,
2N = 10

;
|HCt (js )|2 =

1
1+

s
c

1+

p
c

2N

(1a)

= 100.1 . (1b)

1.5
,
2N = 10

1+

s
c

2N

(1c)

= 101.5 . (1d)

Taking in (1b) and (1d) logarithms (to any base) we next obtain

log 100.1 1
=
= log (p ) log (c ) ,
log
2N

 
log 101.5 1
s
log
=
= log (s ) log (c ) .
c
2N


p
c

(2a)
(2b)

Subtracting (2b) from (2a) we obtain




1 
log (p ) log (s ) =
log 100.1 1 log 101.5 1
2N |
|
{z
}
{z
}
 0.1

= log (p /s )
10 1
= log
101.5 1

33 Iir Butterworth

33

2013

BioMedSigProcAna
and in turn

100.1 1
log
1
101.5 1
 
N=
p
2
log
s

(3)

Finally, we insert p =
p = 0.2 and s =
s = 0.3 into (3).
To numerically obtain the second filter parameter, c =
0.7032, via the passband specifications, we use the parameter
N = 6 and p = 0.2 in (2a).

Analog Butterworth Poles


for N = 6 there are 2N = 12 poles of Butterworth squaredmagnitude function
these 12 poles are uniformly distributed in angle on a circle
with radius c = 0.7032
the Butterworth transfer function uses the N = 6 poles in
the Lhp
s-plane

..............................
........
......
......
.....
.....
...
...
...
.
.
...
...
.
...
.
.
.
..
....
..
0.7032
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...
.
.
...........
.......... ...
.
.
.
..
.
.
.
.
.
.
................ .....
..
.
.
.
....... ....
...
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. ....
..
...
.
.....
... .....
...
.
...
...... ....................
....
.....
..... ..
.......
..........
..................................
6 ....

33 Iir Butterworth

34

2013

BioMedSigProcAna

Analog Butterworth Transfer Function


the Lhp poles are
p1 = 0.6792 + j 0.1820

p1 = 0.6792 j 0.1820

p2 = 0.4972 + j 0.4972

p2 = 0.4972 j 0.4972

p3 = 0.1820 + j 0.6792

p3 = 0.1820 j 0.6792

the corresponding transfer function becomes


HCt (s) =
=

p1 p1 p2 p2 p3 p3
(s p1 ) (s p1 ) (s p2 ) (s p2 ) (s p3 ) (s p3 )
0.1209
(s2 + 1.3585s + 0.4945) (s2 + 0.9945s + 0.4945)

(s2

1
+ 0.3640s + 0.4945)

We have normalized the above analog transfer function HCt (s)


such that it has a Dc gain of one.

33 Iir Butterworth

35

2013

BioMedSigProcAna

Discrete-Time Butterworth Transfer Function


express HCt (s) as a partial fraction decomposition ; Ak , sk
apply
H(z) =

N
X

k=1

Ak
1 (eskTs ) z 1

to obtain
H(z) =


1.8557 0.6304z 1
(1.0000 0.9973z 1 + 0.2571z 2)


2.1428 + 1.1454z 1
+
(1.0000 1.0691z 1 + 0.3699z 2)

0.2871 0.4466z 1
+
(1.0000 1.2972z 1 + 0.6949z 2)

We have obtained the above parallel form of second-order


sections by combining the terms of complex-conjugate pole pairs.
Obviously, we might directly use this parallel form that naturally results from the impulse-invariant design procedure. If we
desire a cascade form or a direct form, we must combine the
separate second-order terms in an appropriate way.

33 Iir Butterworth

36

2013

BioMedSigProcAna

Discrete-Time Butterworth Magnitude-Response

1.0

0.5



H(ej )

......................................
...
0.8913 =
1 dB
...
...
...
...
...
...
....
0.1778 =
15 dB
........
............................................................................................................................
0.2 0.3

0
15

80



H(ej )

...................................dB
............
0.8913 =
1 dB
.......
.......
0.1778 =
15 dB
........
........
.........
...........
............
..............
................
.................
........................
0.2 0.3

33 Iir Butterworth

37

2013

BioMedSigProcAna

Discrete-Time Butterworth Phase-Response

arg(H(ej ))

....
... .....
. .
... .....
.. ...
... ......
....
.
....
.....

...
....
.0.2 0.3..............

....
.
............
.... ..
.................
.... ..
........................
... ..
...........................
... .
..................
... ..
...........
....
........
.

Final Remarks to Our Impulse-Invariance Design. We


recall that we have designed the filter to exactly meetwith
the assumption that we have no aliasingthe passband specifications, that is, in the Butterworth case, to have a 1 dB attenuation at the passband edge frequency
p = 0.2; the design
then exceeds the specification at the stopband edge frequency

s = 0.3. As we observe from the magnitude-response plots


on page 37, it is true that at the passband edge the attenuation is slightly below 15 dB, indicating that the aliasing is not
too strong, or, in other words, that the continuous-time filter is
sufficiently bandlimited. In an other design this might not be
true, such that the resulting discrete-time filter does not meet
the specifications. If we have that situation, we may try to differently adjust the filter parameters (holding the order fixed),
or we may try again with a higher-order filter.

33 Iir Butterworth

38

2013

BioMedSigProcAna

4.2

Design Using Bilinear Transformation

Analog Prototype Specifications


Dt frequency specifications must be pre-warped to corresponding analog frequencies, such that critical analog
frequencies map to correct Dt frequencies
the frequency mapping function of the bilinear transformation is
= (2/Ts ) tan (
/2) = 2 tan (
/2)
thus, mapping of critical frequencies is

p = 0.2

s = 0.3

p = 2 tan (
p /2) = 2 tan (0.1)

20 log10 |HCt (jp )| 1

s = 2 tan (
s /2) = 2 tan (0.15)

20 log10 |HCt (js )| 15

Recall that we conveniently have assumed that the sampling


time interval is Ts = 1.

33 Iir Butterworth

39

2013

BioMedSigProcAna

Analog Butterworth Parameters


the Ct Butterworth squared magnitude function is
|HCt (j)|2 =

1
1+

2N

to do: determine the needed two parameters N and c


solving given specification inequalities with equality4
 0.1 
10 1
1 log 101.5 1
 = 5.3044

N=
2 log tan(0.1)
tan(0.15)

to meet specifications: select N = 6


inserting N = 6 into stopband equation gives c = 0.7662

To supply detailed steps leading to the above results we may


start with (3) on page 34. Using for the bilinear transformation p = 2 tan (
p /2) = 2 tan (0.1) and s = 2 tan (
s /2) =
2 tan (0.15), we obtain

N=

4 See

1 log
2

100.1 1
101.5 1

log

p
s

 0.1 
10 1
log
1
101.5 1
 = 5.3044 .

=
tan(0.1)
2 log
tan(0.15)

the derivations in the accompanying text.

33 Iir Butterworth

40

2013

BioMedSigProcAna
Because the order N of the Butterworth filter must be an
integer, we must select N = 6 in order to meet the specifications. If we insert N = 6 into (2b), we can determine c
to c = 0.7662. Note that by using the equation (2b)which
comes from the stopband constraintto determine the c parameter, we meet the stopband specifications exactly and exceed
the passband specifications. Such a choice is reasonable, because
the bilinear transformation has no aliasing effects.

Analog Butterworth Poles


for N = 6 there are 2N = 12 poles of Butterworth squaredmagnitude function
these 12 poles are uniformly distributed in angle on a circle
with radius c = 0.7662
the Butterworth transfer function uses the N = 6 poles in
the Lhp
s-plane

......................................
.......
......
......
....
....
....
.
.
.
...
...
...
..
...
.
...
....
..
....
0.7662
.
.
.
.
.
.
.
.
.
.
...
.
............ ................................................
.
.
.
.
.
.
...
.
.
.
.
...... .....
.
.
.
.
.
.
.
.
.
.
.
.
..
.
.......
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... ....
...
..
.
.....
...
...
..
..
.
..
...
...... .................
.....
..... .. ......
.
.
.
.
.
.
.... .
........
...................................
6 .........

33 Iir Butterworth

41

2013

BioMedSigProcAna

Analog Butterworth Transfer Function


the Lhp poles are
p1 = 0.7401 + j 0.1983

p1 = 0.7401 j 0.1983

p2 = 0.5418 + j 0.5418

p2 = 0.5418 j 0.5418

p3 = 0.1983 + j 0.7401

p3 = 0.1983 j 0.7401

the corresponding transfer function becomes


HCt (s) =
=

p1 p1 p2 p2 p3 p3
(s p1 ) (s p1 ) (s p2 ) (s p2 ) (s p3 ) (s p3 )
0.2023
(s2 + 1.4802s + 0.5871) (s2 + 1.0836s + 0.5871)

(s2

1
+ 0.3966s + 0.5871)

Again, we have normalized the above analog transfer function HCt (s) such that it has a Dc gain of one.

33 Iir Butterworth

42

2013

BioMedSigProcAna

Discrete-Time Butterworth Transfer Function


apply the bilinear transformation
s=

2 1 z 1
Ts 1 + z 1

to the analog Butterworth transfer function HCt (s) to obtain


6
7.3769 104 1 + z 1
H(z) =
(1.0000 0.9044z 1 + 0.2155z 2)

33 Iir Butterworth

1
(1.0000 1.0106z 1 + 0.3583z 2)
1
(1.0000 1.2687z 1 + 0.7051z 2)

43

2013

BioMedSigProcAna

Discrete-Time Butterworth Magnitude-Response

1.0

0.5



H(ej )

........................................
...
0.9372 =
0.5634 dB
...
...
...
...
...
...
....
0.1778 =
15 dB
........
...........................................................................................................................
0.2 0.3

0
15

80



H(ej )

...................................dB
..............
0.9372 =
0.5634 dB
.......
.......
0.1778 =
15 dB
.......
.......
.......
.......
.......
.......
.......
.......
.......
0.2 0.3

33 Iir Butterworth

44

2013

BioMedSigProcAna

Discrete-Time Butterworth Phase-Response

arg(H(ej ))

....
... .....
. .
... .....
.. ...
... ......
....
.
....

.....
...
....
.
0.2
0.3.........

....
.
........
....
.
...........
.... ..
.............
.
.... .
................
... ..
....................
... ..
.......................
....
..........................
......

Final Remarks to Our Bilinear-Transformation Design.


We recall that we have designed the filter to exactly meet the
stopband specifications, that is, in the Butterworth case, to have
a 15 dB attenuation at the stopband-edge frequency
s = 0.3;
the design exceeds the specification at the passband-edge frequency
p = 0.2. As we observe from the magnitude-response
plots on page 43, it is true that at the stopband edge the attenuation is at 15 dB, whereas at the passband edge the attenuation
is only about 0.5634 dB, leaving a certain margin to the 1 dB
required by the specifications.
Comparison of the two Designs. If we compare the bilineartransformation based design on page 43 to the design based
on the impulse-invariance transformation on page 37, we see

33 Iir Butterworth

45

2013

BioMedSigProcAna
that the magnitude function of the bilinear transformation design falls off more rapidly than the magnitude function of the
impulse-invariance transformation design. This is because the
bilinear transformation maps the entire j axis of the s-plane
onto the unit circle, and the continuous-time Butterworth filter
of order 6 has a zero of multiplicity 6 at s ; the resulting
discrete-time filter then has a zero of multiplicity 6 at z = 1.

References
[Goe13] Josef Goette.
Biomedical Signal Processing and
AnalysisOn Fixed-Point Filter Realizations. Bern
University of Applied Sciences, Script at the Bfh-ti
Biel/Bienne, HuCE-microLab, February 2013.
[Hen74] Peter Henrici. Applied and Computational Complex
Analysis, volume 1 of Pure and Applied Mathematics.
John Wiley & Sons, New York, 1974.
[OS75] Alan W. Oppenheim and Ronald W. Schafer. Digital
Signal Processing. Prentice-Hall Inc., Englewood Cliffs,
N.J., 1975.
[Ran02] Rangaraj M. Rangayyan. Biomedical Signal Analysis:
A Case-Study Approach. IEEE Press, New York, 2002.
Bfh-ti Biel/Bienne Library 57.08 RANGA.
In our development, we have mainly followed [OS75, Chapter 5,
Sections 5.1 and 5.2]; there you also find design examples for
Chebyshev and Cauer lowpass filters, as well as examples for
using frequency transformations to design filters with highpass,
bandpass, and bandstop characteristics. On Butterworth filters
you might also want to consult [Ran02, Chapter 3, pp. 118 ff.].
33 Iir Butterworth

46

2013

You might also like