You are on page 1of 152

1 2014/9/14 1 Zhongguo Liu_Biomedical Engineering_Shandong Univ.

Biomedical Signal processing


Chapter 7 Filter Design Techniques
Zhongguo Liu
Biomedical Engineering
School of Control Science and Engineering, Shandong
University
2
Chapter 7 Filter Design Techniques
7.0 Introduction
7.1 Design of Discrete-Time IIR Filters
From Continuous-Time Filters
7.2 Design of FIR Filters by Windowing
7.3 Examples of FIR Filters Design by the
Kaiser Window Method
7.4 Optimum Approximations of FIR Filters
7.5 Examples of FIR Equiripple
Approximation
7.6 Comments on IIR and FIR Discrete-
Time Filters
3
Filter Design Techniques
7.0 Introduction
4
7.0 Introduction
Frequency-selective filters pass only
certain frequencies
Any discrete-time system that modifies
certain frequencies is called a filter.
We concetrate on design of causal
Frequency-selective filters
5
Stages of Filter Design
The specification of the desired
properties of the system.
The approximation of the specifications
using a causal discrete-time system.
The realization of the system.
Our focus is on second step
Specifications are typically given in the
frequency domain.
6
Frequency-Selective Filters
Ideal lowpass filter
( )

< <
<
=
t w w
w w
e H
c
c
jw
lp
, 0
, 1
0
c
w
c
w t t t 2 t 2
( )
jw
e H
1
( ) < < = n
n
n w
n h
c
lp
,
sin
t
7
Frequency-Selective Filters
Ideal highpass filter
( )
0,
1,
c
jw
hp
c
w w
H e
w w t
<

=

< <

0
c
w
c
w t t t 2 t 2
( )
jw
e H
1
( ) | |
sin
,
c
hp
w n
h n n n
n
o
t
= < <
8
Frequency-Selective Filters
Ideal bandpass filter

( )

<
=
others
w w w
e H
c c jw
bp
, 0
, 1
2 1
0
1
c
w
1
c
w t t
( )
jw
e H
1
2
c
w
2
c
w
9
Frequency-Selective Filters
Ideal bandstop filter

( )

<
=
others
w w w
e H
c c jw
bs
, 1
, 0
2 1
0
1
c
w
1
c
w t t
( )
jw
e H
1
2
c
w
2
c
w
10
If input is bandlimited and sampling frequency
is high enough to avoid aliasing, then overall
system behave as a continuous-time system:
( )
( )

> O
< O
= O
O
T
T e H
j H
T j
eff
t
t
, 0
,
Linear time-invariant discrete-time system
( )
,
eff
jw
w
H H j w
T
e t
| |
= <
|
\ .
continuous-time specifications are converted to discrete
time specifications by:
T w O =
11
Example 7.1 Determining Specifications
for a Discrete-Time Filter
Specifications of the continuous-time filter:
1. passband
2. stopband
( ) ( ) 2000 2 0 01 . 0 1 01 . 0 1 t s O s + < O < for j H
eff
( ) ( ) O s < O 3000 2 001 . 0 t for j H
eff
s T
4
10

=
( )
max
1
2 2
2
2 5000
f
T T
t
t t
t
= =
=
( )
( )

> O
< O
= O
O
T
T e H
j H
T j
eff
t
t
, 0
,
12
Example 7.1 Determining Specifications
for a Discrete-Time Filter
Specifications of the continuous-time filter:
1. passband
2. stopband
( ) ( ) 2000 2 0 01 . 0 1 01 . 0 1 t s O s + < O < for j H
eff
( ) ( ) O s < O 3000 2 001 . 0 t for j H
eff
s T
4
10

=
( )
max
1
2 2
2
2 5000
f
T T
t
t t
t
= =
=
1
0.01 o =
2
0.001 o =
2 (2000)
p
t O =
2 (3000)
s
t O =
13
s T
4
10

=
T e =O
Example 7.1 Determining Specifications
for a Discrete-Time Filter
Specifications of the
discrete-time filter in
e
1
0.01 o =
2
0.001 o =
2 (2000)
p
t O =
2 (3000)
s
t O =
0.4
p
e t =
0.6
s
e t =
14
Filter Design Constraints
Designing IIR filters is to find the
approximation by a rational function of z.
The poles of the system function must lie
inside the unit circle(stability, causality).
Designing FIR filters is to find the
polynomial approximation.
FIR filters are often required to be linear-
phase.
15
Filter Design Techniques
7.1 Design of Discrete-Time IIR
Filters From Continuous-Time Filters
16
7.1 Design of Discrete-Time IIR Filters
From Continuous-Time Filters
The traditional approach to the design
of discrete-time IIR filters involves the
transformation of a continuous-time
filter into a discrete filter meeting
prescribed specification.
17
Three Reasons
1. The art of continuous-time IIR filter
design is highly advanced, and since
useful results can be achieved, it is
advantageous to use the design
procedures already developed for
continuous-time filters.
18
Three Reasons
2. Many useful continuous-time IIR
design method have relatively simple
closed form design formulas.
Therefore, discrete-time IIR filter
design methods based on such
standard continuous-time design
formulas are rather simple to carry
out.
19
Three Reasons
3. The standard approximation methods
that work well for continuous-time
IIR filters do not lead to simple
closed-form design formulas when
these methods are applied directly to
the discrete-time IIR case.
20
Steps of DT filter design by transforming a
prototype continuous-time filter
The specifications for the continuous-
time filter are obtained by a
transformation of the specifications for
the desired discrete-time filter.
Find the system function of the
continuous-time filter.
Transform the continuous-time filter
to derive the system function of the
discrete-time filter.
21
Constraints of Transformation
to preserve the essential properties of the
frequency response, the imaginary axis of the
s-plane is mapped onto the unit circle of the
z-plane. jw
e z j s = O =
plane s
plane z
Im Im
Re Re
22
Constraints of Transformation
In order to preserve the property of
stability, If the continuous system has poles
only in the let half of the s-plane, then the
discrete-time filter must have poles only
inside the unit circle.
plane s
Im
Re
plane z Im
Re
23
7.1.1 Filter Design by Impulse
Invariance
The impulse response of discrete-time
system is defined by sampling the impulse
response of a continuous-time system.
| | ( )
d c d
nT h T n h =
( )
d c
T j H if t > O = O , 0 ( ) t s
|
|
.
|

\
|
= w
T
w
j H e H then
d
c
jw
,
t < O = w for T w
d
( )

=
|
|
.
|

\
|
+ =
k
d d
c
jw
k
T
j
T
w
j H e H
t 2
Relationship of
frequencies
24
< O < < < O = , , t e t e
d
T
relation between frequencies
S plane
Z plane



-

3 /
d
T t
jO
/
d
T t
/
d
T t
( )

=
|
|
.
|

\
|
+ =
k
d d
c
jw
k
T
j
T
w
j H e H
t 2
Relationship of
frequencies
( )
d c
T j H if t > O = O , 0
( ) t s
|
|
.
|

\
|
= w
T
w
j H e H then
d
c
jw
,
25
Aliasing in the Impulse Invariance
( )

=
|
|
.
|

\
|
+ =
k
d d
c
jw
k
T
j
T
w
j H e H
t 2
( )
d c
T j H if t > O = O , 0
( )
,
jw
c
d
w
then H e H j
T
w t
| |
=
|
\ .
s
26
periodic sampling
[ ] ( ) | ( )
c t nT c
x n x t x nT
=
= =
Tsample period; fs=1/T:sample rate
s=2/T:sample rate
( ) ( )

=
=
n
nT t t s o
( ) ( ) ( ) ( ) ( ) ( ) ( )
s c c c
n n
x t x t s t x t t nT x nT t nT o o

= =
= = =

Review
27
Time domain
) (t x
Complex frequency
domain
}



A
= dt e t x s X
st
) ( ) (
Laplace transform
O + = j s o
f t 2 = O

s pl ane
o
jO
0
Relation between Laplace Transform
and Z-transform
Review
28
}


O
= O dt e t x j X
t j
) ( ) (
Fourier Transform
frequency domain
s- pl ane
o
jO
0

Fourier Transform is the Laplace transform when s


have the value only in imaginary axis, s=j
O + = j s o Since
So
0 o =
s j = O
}



A
= dt e t x s X
st
) ( ) (
29
( ) ( ) ( ) ( ) ( )
n n
x n x t t nT x nT t nT o o

=
= =

For discrete-time signal
( ) ( )
st
n
x nT t nT e dt o

}
( ) ( )
snT sT
n
x nT e X e

=
= =

[ ( )] ( )
st
x n x n e dt

=
} L
sT
z e

( ) ( )
n
n
x n z X z

=
= =

z-transform
of discrete-
time signal
the Laplace transform
30
( ) sT j T T j T j
z e e e e re
o o e + O O
= = = =

=
n
n
z n x z X ) ( ) (
so

T
r e
T
o
e
=
= O
relation between
s z and
Laplace transform continuous time signal
z-transform discrete-time signal
relation
[ ( )] ( ) ( )
snT sT
n
x n x nT e X e

=
= =

L
sT
z e
let
31
2
s
T f f e t = O =
DTFT :
Discrete Time
Fourier Transform
( ) sT j T T j T j
z e e e e re
o o e + O O
= = = =
( ) ( )
j j n
n
X e x n e
e e

=
=

S plane
Z plane



-
3 /
s
T t
jO
/
s
T t
/
s
T t
1
|
j j
r
z re e
e e
=
= =
32
2 2
s s
T f f f e t t
'
= O = =
z
plane
Re[ ] z
Im[ ] z
0
r
e
0 2 / 2
0 2
2
s
s s
s s
f
f
t
t

O =
O O
: O
0
0 2
2 4
t
t
t t

: e
s
f f f
'
jO
s pl ane
o
0
2
2
s
s
f
T
t
t =
s
T
t

3
s
T
t
3
s
T
t

33
If input is bandlimited and f
s
>2f
max
, :
( )
( )

> O
< O
= O
O
T
T e H
j H
T j
eff
t
t
, 0
,
discrete-time filter design by impulse invariance
t < O = w for T w
d
( )

=
|
|
.
|

\
|
+ =
k
d d
c
jw
k
T
j
T
w
j H e H
t 2
( )
d c
T j H if t > O = O , 0
( )
,
jw
c
d
w
then H e H j w
T
t
| |
= <
|
\ .
| | ( )
d c d
nT h T n h =
34
< O < < < O = , , t e t e
d
T
relation between frequencies
S plane
Z plane



-

3 /
d
T t
jO
/
d
T t
/
d
T t
( )

=
|
|
.
|

\
|
+ =
k
d d
c
jw
k
T
j
T
w
j H e H
t 2
Relationship of
frequencies
( )
d c
T j H if t > O = O , 0
( ) t s
|
|
.
|

\
|
= w
T
w
j H e H then
d
c
jw
,
35
periodic sampling
[ ] ( ) | ( )
c t nT c
x n x t x nT
=
= =
Tsample period; fs=1/T:sample rate
s=2/T:sample rate
( ) ( )

=
=
n
nT t t s o
( ) ( ) ( ) ( ) ( ) ( ) ( )
s c c c
n n
x t x t s t x t t nT x nT t nT o o

= =
= = =

( ) ( )
2
s
k
S j k
T
t
o

=
O = O O

( ) ( ) ( ) ( ) ( )
1 1 2
*
2 2
s c c s
k
X j X j S j X j k d
T
t
u o u u
t t

=
O = O O = O O

}
( ) ( )
1
c s
k
X j k
T

=
= O O

Review
36
proof of
Tsample period; fs=1/T:sample rate;s=2/T:sample rate
( ) ( )

=
=
n
nT t t s o
( ) ( )
2
s
k
S j k
T
t
o

=
O = O O

Review
( ) ( )
2
s
k
S j k
T
t
o

=
O = O O

s
jk t
k
n
a e

O
=
=

s(t)T
1
s
jk t
n
e
T

O
=
=

2 ( )
s
jk t F
s
e k to
O
O O
37
periodic sampling
( ) ( ) ( ) ( ) ( ) ( ) ( )
s c c c
n n
x t x t s t x t t nT x nT t nT o o

= =
= = =

( )
j Tn
c
k
x nT e

O
=
=

( ) ( )
( )
j t
s c
n
X j x nT t nT e dt o


O
=

O =

}
[ ] ( ) | ( )
c t nT c
x n x t x nT
=
= =
( )
( )
j j n
c
n
X e x nT e
e e

=
=

( ) ( ) ( )
j j T
s T
X j X e X e
e
e
O
=O
O = =
( ) ( )
1
( )
j T
c s
k
X e X j k
T

O
=
= O O

1 2
( )
c
k
j
k
X X j
T T T
e
e
e t

=
| |
| |
=
| |
\ .
\ .

2
s
T
t
O =
( ) 0,
j T
if X e
T
t
O
= O>
1
( )
c
j
then X X j
T T
e
e
e
| |
=
|
\ .
( ) ( ) ( )
1
s c s
k
X j X j k
T

=
O = O O

38
discrete-time filter design by impulse invariance
( )

=
|
|
.
|

\
|
+ =
k
d d
c
jw
k
T
j
T
w
j H e H
t 2
( )
d c
T j H if t > O = O , 0
( )
,
jw
c
d
w
then H e H j w
T
t
| |
= <
|
\ .
| | ( )
d c d
nT h T n h =
1 2
( )
c
k
j
k
X X j
T T T
e
e
e t

=
| |
| |
=
| |
\ .
\ .

1
( )
c
j
X X j
T T
e
e
e
| |
=
|
\ .
1 2
( )
c
k
j
k
H H j
T T T
e
e
e t

=
| |
| |
=
| |
\ .
\ .

1
( )
c
j
H H j
T T
e
e
e
| |
=
|
\ .
[ ] ( ) | ( )
c t nT c
x n x t x nT
=
= = [ ] ( )
c
h n h nT =
39
Steps of DT filter design by transforming
a prototype continuous-time filter
Obtain the specifications for continuous-
time filter by transforming the specifications
for the desired discrete-time filter.
Find the system function of the continuous-
time filter.
Transform the continuous-time filter to
derive the system function of the discrete-
time filter.
40
Transformation from discrete to
continuous
In the impulse invariance design
procedure, the transformation is


Assuming the aliasing involved in the
transformation is neglected, the
relationship of transformation is
( ) t s
|
|
.
|

\
|
= w
T
w
j H e H
d
c
jw
,
d
T w = O
41
Steps of DT filter design by transforming
a prototype continuous-time filter
Obtain the specifications for continuous-
time filter by transforming the specifications
for the desired discrete-time filter.
Find the system function of the continuous-
time filter.
Transform the continuous-time filter to
derive the system function of the discrete-
time filter.
42
Continuous-time IIR filters
Butterworth filters
Chebyshev Type I filters
Chebyshev Type II filters
Elliptic filters

43
Steps of DT filter design by transforming
a prototype continuous-time filter
Obtain the specifications for continuous-
time filter by transforming the specifications
for the desired discrete-time filter.
Find the system function of the continuous-
time filter.
Transform the continuous-time filter to
derive the system function of the discrete-
time filter.
44
Transformation from
continuous to discrete
( )

=

=
N
k
k
k
s s
A
s H
1
( )

<
>
=

=
0 , 0
0 ,
1
t
t e A
t h
N
k
t s
k
c
k
:
k d
s T
k
pole s s z e
two requirements for transformation
= =
| | ( ) | | ( ) | |

= =
= = =
N
k
n
T s
k d
N
k
nT s
k d c d
n u e A T n u e A T t h T n h
d k d k
1 1
( )

=

=
N
k
T s
k d
z e
A T
z H
d k
1
1
1
45
Example 7.2 Impulse Invariance
with a Butterworth Filter
Specifications for the discrete-time filter:
( )
( ) t t
t
s s s
s s s s
w e H
w e H
jw
jw
3 . 0 , 17783 . 0
2 . 0 0 , 1 89125 . 0
O = O = =
d d
T w T let 1
Assume the effect of aliasing is negligible
( )
( ) O s s O
s O s s O s
t
t
3 . 0 , 17783 . 0
2 . 0 0 , 1 89125 . 0
j H
j H
c
c
46
Example 7.2 Impulse Invariance
with a Butterworth Filter
( )
( )
0.89125 1, 0 0.2
0.17783, 0.3
c
c
H j
H j
t
t
s O s s O s
O s s O
( )
( )
0.2 0.89125
0.3 0.17783
c
c
H j
H j
t
t
>
s
0.3t
0.2t
2
2
0.2 1
1
0.89125
N
c
t
| |
| |
+ =
|
|
O
\ .
\ .
2
2
0.3 1
1
0.17783
N
c
t
| |
| |
+ =
|
|
O
\ .
\ .
( )
( )
2
2
1
1
N
c
c
H j
j j
O =
+ O O
( )
( )
2
2
1
1
N
c
c
j j
H j
+ O O =
O
47
Example 7.2 Impulse Invariance
with a Butterworth Filter
( )
( )
2
2
1
1
N
c
c
H j
j j
O =
+ O O
2
2
0.2 1
1 1.25893
0.89125
N
c
t
| |
| |
+ = =
|
|
|
O
\ .
\ .
7032 . 0 , 6 = O =
c
N
2
2
0.3 1
1 31.62204
0.17783
N
c
t
| |
| |
+ = =
|
|
|
O
\ .
\ .
2
0.2
0.25893
N
c
t
| |
=
|
O
\ .
2
0.3
30.62204
N
c
t
| |
=
|
O
\ .
2
3
118.26378
2
N
| |
=
|
\ .
70470 . 0 , 8858 . 5 = O =
c
N
( )
( )
0.2 0.89125
0.3 0.17783
c
c
H j
H j
t
t
>
s
48
Example 7.2 Impulse Invariance
with a Butterworth Filter
( )
( )
2
2
1
1
N c
c
H j
j j
O =
+ O O
( ) ( ) ( )
( )
2
2
1
1
N
c c c
c
H s H s H s
s j
= =
+ O
0,1, , 2 1 k N =
( )
( )( )
2 2 1
1 2
1 ,
k
j N k N
N
c c
s j e
t +
= O = O
6, 0.7032
c
N = O =
0.182 0.679, j
0.497 0.497, j
0.679 0.182 j
Plole pairs:
( )
c
H s
49
Example 7.2 Impulse Invariance
with a Butterworth Filter
( )
( )( )( ) 4945 . 0 3585 . 1 4945 . 0 9945 . 0 4945 . 0 3640 . 0
12093 . 0
2 2 2
+ + + + + +
=
s s s s s s
s H
c
( ) ( ) ( )
( )
2
2
2 2 2
1
1
N
N N N
c
c
c c c
c
H s H s H s
s
s j
O
= = =
+O
+ O
0.182 0.679, j 0.497 0.497, j
0.679 0.182 j
Plole pairs:
( )
c
H s
( )
( ) ( ) ( )
0.12093
0.182 0.679 0.182 0.679 0.497 0.497
c
H s
s j s j s j
=
+ + + +
( ) ( )( )
1
0.497 0.497 0.679 0.182 0.679 0.182 s j s j s j

+ + + + +
6
0.7032
N
c
O =
50
Example 7.2 Impulse Invariance
with a Butterworth Filter
1 1
1 2 1 2
1
1 2
0.2871 0.4466 2.1428 1.1455
1 1.2971 0.6949 1 1.0691 0.3699
1.8557 0.6303
1 0.9972 0.2570
z z
z z z z
z
z z


+
= +
+ +

+
+
( )
( ) ( ) ( )
0.12093
0.182 0.679 0.182 0.679 0.497 0.497
c
H s
s j s j s j
=
+ + + +
( ) ( )( )
1
0.497 0.497 0.679 0.182 0.679 0.182 s j s j s j

+ + + + +
1
N
k
k
k
A
s s
=
=

( )
1 1
1 1 1 1
N N
d k k
k k
k d k
s T
s
T A A
H z
e z e z

= =
= =


1
d
T =
51
Basic for Impulse Invariance
To chose an impulse response for the
discrete-time filter that is similar in some
sense to the impulse response of the
continuous-time filter.
If the continuous-time filter is bandlimited,
then the discrete-time filter frequency
response will closely approximate the
continuous-time frequency response.
The relationship between continuous-time
and discrete-time frequency is linear;
consequently, except for aliasing, the shape
of the frequency response is preserved.
52
7.1.2 Bilinear Transformation
Bilinear transformation can avoid the
problem of aliasing.
Bilinear transformation maps
onto
s O s
t t s s w
( )
1
1
2 1
1
d
c
z
H z H
T z

(
| |

=
(
|
+
\ .

|
|
.
|

\
|
+

1
1
1
1 2
z
z
T
s
d
Bilinear transformation:
| |
c
H s =
|
|
.
|

\
|
+

1
1
1
1 2
z
z
T
s
d
53
7.1.2 Bilinear Transformation
|
|
.
|

\
|
+

1
1
1
1 2
z
z
T
s
d
( )
( )s T
s T
z
d
d
2 1
2 1

+
=
O + = j s o
2 2 1
2 2 1
d d
d d
T j T
T j T
z
O
O + +
=
o
o
O < < any for z 1 0 o
O > > any for z 1 0 o
( )
1 1
2 (1 ) 1
d
T s z z

+ =
( ) { } ( )
1
1 2 ] 1 2
d d
T s z T s

+ =
54
7.1.2 Bilinear Transformation
O = O j s axis j
2 1
2 1
d
d
T j
T j
z
O
O +
= 1 = z

1 2
1 2
d
d
jw
j T
j T
e
+ O
=
O
plane s
Im
Re
plane z Im
Re
2 2 1
2 2 1
d d
d d
T j T
T j T
z
O
O + +
=
o
o
O < < any for z 1 0 o
O > > any for z 1 0 o
O + = j s o
55
7.1.2 Bilinear Transformation
|
|
.
|

\
|
+

1
1
1
1 2
z
z
T
s
d
2 1
1
d
jw
jw
j
T
e
e

| |

O =
|
|
+
\ .
( )
2
tan 2
d
j w
T
=
2 2 sin 2
2cos 2
d
j w
T w
| |
=
|
\ .
( ) 2 tan
2
w
T
d
= O
( ) 2 tan 2
1
d
T w O =

/2 /2 /2
/2 /2 /2
2 ( )
( )
d
jw jw jw
jw jw jw
T
e e e
e e e


| |

=
|
|
+
\ .
56

|
.
|

\
|
= O
|
|
.
|

\
|
= O
2
tan
2
2
tan
2
:
s
d
s
p
d
p
T
T
prewarp
e
e
|
.
|

\
|
= O
O =
2
tan
2
) ( ) (
e
e
d
T
c
j
j H e H
relation between frequency response of H
c
(s), H(z)
O
e
e
O
57
Comments on the Bilinear Transformation
It avoids the problem of aliasing encountered
with the use of impulse invariance.
It is nonlinear compression of frequency axis.
S plane
Z plane



-

3 /
d
T t
jO
/
d
T t
/
d
T t
( ) 2 tan
2
w
T
d
= O
( ) 2 tan 2
1
d
T w O =

58
Comments on the Bilinear Transformation
The design of discrete-time filters using
bilinear transformation is useful only when
this compression can be tolerated or
compensated for, as the case of filters
that approximate ideal piecewise-constant
magnitude-response characteristics.
0
c
w
c
w t t t 2 t 2
( )
jw
e H
1
59
Bilinear Transformation of
|
|
.
|

\
|
+

1
1
1
1 2
z
z
T
s
d
( ) 2 tan
2
w
T
d
= O
s
e
o
j
e
o O
( )
2
tan 2
d
w
T
o
o O =
d
T
eo

60
Comparisons of Impulse Invariance
and Bilinear Transformation
The use of bilinear transformation is
restricted to the design of approximations to
filters with piecewise-constant frequency
magnitude characteristics, such as highpass,
lowpass and bandpass filters.
Impulse invariance can also design lowpass
filters. However, it cannot be used to design
highpass filters because they are not
bandlimited.
61
Comparisons of Impulse Invariance
and Bilinear Transformation
Bilinear transformation cannot design
filter whose magnitude response isnt
piecewise constant, such as
differentiator. However, Impulse
invariance can design an bandlimited
differentiator.
62
Butterworth Filter,
Chebyshev Approximation,
Elliptic Approximation
7.1.3 Example of Bilinear
Transformation
( )
( ) t t
t
s s s
s s s
w e H
w e H
jw
jw
6 . 0 , 001 . 0
4 . 0 , 01 . 1 99 . 0
63 0.016
0.01
Example 7.3 Bilinear Transformation of a
Butterworth Filter
( )
( )
0.89125 1, 0 0.2
0.17783, 0.3
jw
jw
H e w
H e w
t
t t
s s s s
s s s
( )
( )
2 0.2
0.89125 1, 0 tan
2
2 0.3
0.7783, tan
2
c
d
c
d
H j
T
H j
T
t
t
| |
s O s s O s
|
\ .
| |
O s s O s
|
\ .
, 1
d
For convenience we choose T =
( ) ( )
( ) ( ) , 17783 . 0 15 . 0 tan 2
, 89125 . 0 1 . 0 tan 2
s
>
t
t
j H
j H
c
c
( ) 2 tan
2
w
T
d
= O
64
Example 7.3 Bilinear Transformation of a
Butterworth Filter
( ) ( )
( ) ( ) , 17783 . 0 15 . 0 tan 2
, 89125 . 0 1 . 0 tan 2
s
>
t
t
j H
j H
c
c
( )
( )
N
c
c
j j
j H
2
2
1
1
O O +
= O
( )
( )
2
2
2
2
2tan 0.1
1
1
0.89125
3tan 0.15
1
1
0.17783
N
c
N
c
t
t
| |
| |
+ =
|
|
O
\ .
\ .
| |
| |
+ =
|
|
O
\ .
\ .
305 . 5 = N
766 . 0
, 6
= O
=
c
N
0.016
0.01
65
Locations of Poles
0,1, , 2 1 k N =
( )
( )( )
2 2 1
1 2
1 ,
k
j N k N
N
c c
s j e
t +
= O = O
0.1998 0.7401, j
0.5418 0.5418, j
0.7401 0.1998 j
Plole pairs:
( )
c
H s
( )
( )
2
2
1
1
N c
c
H j
j j
O =
+ O O
( ) ( ) ( )
( )
2
2
1
1
N
c c c
c
H s H s H s
s j
= =
+ O
6, 0.766
c
N = O =
66
Example 7.3 Bilinear Transformation of a
Butterworth Filter
( )
( )( )( ) 5871 . 0 4802 . 1 5871 . 0 0836 . 1 5871 . 0 3996 . 0
20238 . 0
2 2 2
+ + + + + +
=
s s s s s s
s H
c
( )
( )
( )( )
( )
2 1
2 1 2 1
6
1
2155 . 0 9904 . 0 1
1
3583 . 0 0106 . 1 1 7051 . 0 2686 . 1 1
1 0007378 . 0

+ +
+
=
z z
z z z z
z
z H
( ) ( ) ( )
( )
2
2
2 2 2
1
1
N
N N N
c
c
c c c
c
H s H s H s
s
s j
O
= = =
+O
+ O
0.1998 0.7401, j
0.5418 0.5418, j 0.7401 0.1998 j
Plole pairs:
( )
c
H s
|
|
.
|

\
|
+

1
1
1
1 2
z
z
T
s
d
67
Ex. 7.3 frequency response of discrete-time filter
68
Example 7.4 Butterworth
Approximation (Hw)

( )
( ) t t
t
s s s
s s s
w e H
w e H
jw
jw
6 . 0 , 001 . 0
4 . 0 , 01 . 1 99 . 0
14 = N order
69
Example 7.4 frequency response
70
Chebyshev filters
C
Chebyshev filter (type I)
) / ( 1
1
| ) ( |
2
2
2
c N
c
V
j H
O O +
= O
c
) cos cos( ) (
1
x N x V
N

=
c
O
1
c 1
Chebyshev polynomial
Chebyshev filter (type II)
1
2
2
2
)] / ( [ 1
1
| ) ( |

O O +
= O
c N
c
V
j H
c
1
c
c
O
71
Example 7.5 Chebyshev Type I , II
Approximation





( )
( ) t t
t
s s s
s s s
w e H
w e H
jw
jw
6 . 0 , 001 . 0
4 . 0 , 01 . 1 99 . 0
8 = N order
Type I
Type II
72
Example 7.5 frequency response of Chebyshev
Type I
Type II
73
E
elliptic filters
Elliptic filter
) ( 1
1
| ) ( |
2 2
2
O +
= O
N
c
U
j H
c
s
O
p
O
1
1
1 o
2
o
Jacobian elliptic function
74
Example 7.6 Elliptic Approximation





( )
( ) t t
t
s s s
s s s
w e H
w e H
jw
jw
6 . 0 , 001 . 0
4 . 0 , 01 . 1 99 . 0
6 = N order
75
Example 7.6 frequency response of Elliptic
76
*Comparison of Butterworth, Chebyshev, elliptic filters: Example
-Given specification
t e
e
0.4 | | .01 1 | ) ( | 99 . 0 s s s
j
e H
t e t
e
s s s | | 0.6 0.001 | ) ( |
j
e H
t e t e o o 6 . 0 , 4 . 0 001 . 0 , 01 . 0
s 2 1
= = = =
p
) (
s
e
-Order
Butterworth Filter : N=14. ( max flat)
Chebyshev Filter : N=8. ( Cheby 1, Cheby 2)
Elliptic Filter : N=6 ( equiripple)
B
C
E
77
-Pole-zero plot (analog)
-Pole-zero plot (digital)
B C1 C2 E
B C1 C2 E
(14) (8)
78
-Magnitude
-Group delay
B
C1
C2
E
B
C1
C2
E
t 4 . 0 t 6 . 0
t
t 4 . 0 t 6 . 0
t
5
20
79
7.2 Design of FIR Filters by
Windowing
FIR filters are designed based on
directly approximating the desired
frequency response of the discrete-
time system.
Most techniques for approximating the
magnitude response of an FIR system
assume a linear phase constraint.
80
Window Method
An ideal desired frequency response
( ) | |

=
n
jwn
d
jw
d
e n h e H
| | ( )
}

=
t
t
t
dw e e H n h
jwn jw
d d
2
1
Many idealized systems are defined by
piecewise-constant frequency response with
discontinuities at the boundaries. As a result,
these systems have impulse responses that
are noncausal and infinitely long.
( )

< <
<
=
t w w
w w
e H
c
c
jw
lp
, 0
, 1
( )
sin
c
lp
w n
h n
n t
=
0
c
w
c
w t t
( )
jw
e H
1
81
Window Method
| |
| |

s s
=
otherwise
M n n h
n h
d
, 0
0 ,
| | | | | | n w n h n h
d
=
| |

s s
=
otherwise
M n
n w
, 0
0 , 1
( ) ( )
( )
( )
}


=
t
t
u
u
t
d e W e H e H
w j jw
d
jw
2
1
The most straightforward approach to
obtaining a causal FIR approximation is to
truncate the ideal impulse response.
82
Windowing in Frequency Domain
Windowed frequency response
( ) ( )
( )
( ) u
t
=
u e e
t
t
e
}
d e W e H
2
1
e H
j j
d
j
The windowed version is smeared version
of desired response
83
Window Method
( ) ( )
( )
( )
( )
1
2
j w
jw j jw
d d
H e H e W e d H e
t
u
u
t
u
t

= =
}
If
| | s s = n n w 1
( ) | | ( )


=

= =
k n
jwn jw
k w e n w e W t o t 2 2
0
c
w
c
w t t
( )
jw
e H
1
0
5
10 5 10 15 15
2t
2t
2t 4t 4t 6t
e
( )
jw
W e
84
Choice of Window
is as short as possible in duration. This
minimizes computation in the
implementation of the filter.
| | n w
approximates an impulse. ( )
jw
e W
( )
| |
0
M
jw jwn jwn
n n
W e w n e e


= =
= =

( )
( )
( )
1
2
sin 1 2
1
1 sin 2
jw M
jwM
jw
w M
e
e
e w
+

+ (


= =

| |

s s
=
otherwise
M n
n w
, 0
0 , 1
1 M +
2
1 M
t

+
2
1 M
t
+
( )
jw
W e
85
Window Method
( ) ( )
( )
( ) ( )
jw
d
w j jw
d
jw
e H d e W e H e H = =
}


t
t
u
u
t 2
1
then would look like , except
where changes very abruptly.
( )
jw
e H ( )
jw
d
e H
( )
jw
d
e H
| | n w ( )
jw
e W
0 = w
If is chosen so that is concentrated
in a narrow band of frequencies around
0
c
w
c
w t
t
( )
jw
d
H e
1
1 M +
2
1 M
t

+
2
1 M
t
+
( )
jw
W e
86
Rectangular Window
for the rectangular window has a
generalized linear phase.
( )
jw
e W
As M increases, the width of the main lobe
decreases.
( )
4 1
m
w
M t A = +
While the width of each lobe decreases with
M, the peak amplitudes of the main lobe and
the side lobes grow such that the area under
each lobe is a constant.
( )
( )
( )
2
sin 1 2
sin 2
jw jwM
w M
W e e
w

+ (

=
1 M +
2
1 M
t

+
2
1 M
t
+
1
M
M
t
+
1
M
M
t
+
87
Rectangular Window
will oscillate at
the discontinuity.
( )
( )
( )
}


t
t
u
u d e W e H
w j jw
d
The oscillations occur more rapidly, but
do not decrease in magnitude as M
increases.
The Gibbs phenomenon can be
moderated through the use of a less
abrupt truncation of the Fourier series.
88
Rectangular Window
By tapering the window smoothly to zero
at each end, the height of the side lobes
can be diminished.
The expense is a wider main lobe and thus
a wider transition at the discontinuity.
89
7.2 Design of FIR Filters by Windowing Method
To design an ilowpass FIR Filters
( )

< <
<
=
t w w
w w
e H
c
c
jw
lp
, 0
, 1
( )
sin
c
lp
w n
h n
n t
=
0
c
w
c
w t t
( )
jw
e H
1
Review
| | | | | |
d
h n h n w n =
| |
1, 0
0,
n M
w n
otherwise
s s

( ) ( )
( )
( )
}


=
t
t
u
u
t
d e W e H e H
w j jw
d
jw
2
1
1 M +
2
1 M
t

+
2
1 M
t
+
( )
jw
W e
( )
( )
sin 2
2
c
w n M
n M t
(

0
2 M 0
2 M 0
M
M
2 M
0 M
90
7.2.1 Properties of Commonly Used
Windows
Rectangular
| |

s s
=
otherwise
M n
n w
, 0
0 , 1
| |

s s
s s
=
otherwise
M n M M n
M n M n
n w
, 0
2 , 2 2
2 0 , 2
Bartlett (triangular)
91
7.2.1 Properties of Commonly Used
Windows
Hanning
| |
( )

s s
=
otherwise
M n M n
n w
, 0
0 , 2 cos 5 . 0 5 . 0 t
| |
( )

s s
=
otherwise
M n M n
n w
, 0
0 , 2 cos 46 . 0 54 . 0 t
Hamming
92
7.2.1 Properties of Commonly Used
Windows
Blackman
| |
( )
( )

s s +

=
otherwise
M n M n
M n
n w
, 0
0 , 4 cos 08 . 0
2 cos 5 . 0 42 . 0
t
t
93
7.2.1 Properties of Commonly Used
Windows
94
Frequency Spectrum of Windows
(a) Rectangular, (b) Bartlett,
(c) Hanning, (d) Hamming,
(e) Blackman , (M=50)
(a)-(e) attenuation of sidelobe increases,
width of mainlobe increases.
95
7.2.1 Properties of Commonly Used
Windows
biggesthigh oscillations
at discontinuity
smallestthe sharpest transition
Table 7.1
96
7.2.2 Incorporation of Generalized
Linear Phase
In designing FIR filters, it is desirable
to obtain causal systems with a
generalized linear phase response.
| |
| |

s s
=
otherwise
M n n M w
n w
, 0
0 ,
The above five windows are all
symmetric about the point ,i.e., 2 M
97
7.2.2 Incorporation of Generalized
Linear Phase
Their Fourier transforms are of the form
( ) ( )
2 M jw jw
e
jw
e e W e W

=
( ) w of function even and real a is e W
jw
e
| | | | | | causal n w n h n h
d
: =
| | | | | | | | | |
d d d
if h M n h n h n h n w n = =
( ) ( )
2 M jw jw
e
jw
e e A e H

=
| | | |
: h M n h n generalized linear phase =
2 M
M
98
7.2.2 Incorporation of Generalized
Linear Phase
| | | | | | | | | |
| | | | phase linear d generalize n h n M h
n w n h n h n h n M h if
d d d
: =
= =
( ) ( )
2 M jw jw
o
jw
e e jA e H

=
2 M
M
99
Frequency Domain Representation
| | | | n h n M h if
d d
=
( ) ( )
2 M jw jw
e
jw
d
e e H e H

=
( )
( )
( )
1
2
jw
d
j w
j
H e H W d e e
t
t
u
u
u
t

| |
=
|
\ .
}
( )
( )
( )
1
2
e e
j w
jw jw
e
where A H W d e e e
t
t
u
u
t

| |
=
|
\ .
}
( )
( ) ( )
2
2
1
2
e e
j w j w M
j j M
H W d e e e e
t
t
u u
u u
u
t

| |
=
|
\ .
}
( ) ( )
2 M jw jw
e
jw
e e W e W

=
| | | |
w n w M n =
( )
2 jw jwM
e
A e e

=
| | | | | |
d
h n h n w n =
100
Example 7.7 Linear-Phase Lowpass
Filter
The desired frequency response is
( )

s <
<
=

t w w
w w e
e H
c
c
jwM
jw
lp
, 0
,
2
| |
lp
h M n =
| |
( ) | |
( )
| | n w
M n
M n w
n h
c
2
2 sin


=
t
| |
( )
( )
2
1
2
sin 2
2
c
c
lp
c
w
w
jwM jwn
h n dw
w n M
for n
n M
e e
t
t


=
(

= < <

}
2 M
( )
( ) t o
o
s s s
s s >
w w e H
w w e H
s
jw
p
jw
0 1
101
magnitude frequency response
p
w
s
w
( )
( )
1 0
jw
p p
jw
s s
H e w w
H e w w
o
o t
> s s
s s s
s p
w w w A =
10
20log
p p
o o =
( )
0.1 0.15
jw
H e w t t s s s
( )
1 0.05 0 0.25
jw
H e w t > s s
0.1
s p
w w w t A = =
10
20log 0.05 26
p
dB o = =
10
20log
s s
o o =
20
s
dB o =
102
7.2.1 Properties of Commonly Used
Windows
smallestthe sharpest
transition
biggesthigh oscillations
at discontinuity
103
7.2.3 The Kaiser Window Filter
Design Method




| |
( )
( )
| |
1 2
2
0
0
1
, 0
0,
I n
n M
w n
I
otherwise
| o o
|

(
(

(

s s
=

2, where M o =
( )
0
: I u zero order modified Bessel function of the first kind
( )
( )
2
0
1
2
1
!
r
r
u
I u
r

=
(
= +
(
(

: 1, length M + | : parameter shape


: two parameters
Trade side-lobe amplitude for main-lobe width
104
Figure 7.24
As | increases, attenuation of
sidelobe increases, width of
mainlobe increases.
As M increases, attenuation of
sidelobe is preserved, width of
mainlobe decreases.
M=20
(a) Window shape, M=20,
(b) Frequency spectrum, M=20,
(c) beta=6
| =6
105
Table 7.1
Transition width is a little less than
mainlobe width
106
Increasing M wile holding
| constant causes the main
lobe to decrease in width,
but does not affect the
amplitude of the side lobe.
Comparison
If the window is tapered more, the side lobe
of the Fourier transform become smaller, but
the main lobe become wider.
M=20
| =6
M=20
107
p
w
s
w
Filter Design by Kaiser Window
( )
( ) t o
o
s s s
s s >
w w e H
w w e H
s
jw
p
jw
0 1
p s
w w w = A
o
10
log 20 = A
108
Filter Design by Kaiser Window
p s
w w w = A o
10
log 20 = A
( )
( ) ( )

<
s s +
>
=
21 , 0 . 0
50 21 , 21 07886 . 0 21 5842 . 0
50 , 7 . 8 1102 . 0
4 . 0
A
A A A
A A
|
2
285 . 2
8

=
w
A
M
| |
( )
( )
| |
1 2
2
0
0
1
, 0
0,
I n
n M
w n
I
otherwise
| o o
|

(
(

(

s s
=

M=20
109
Example 7.8 Kaiser Window Design
of a Lowpass Filter
( )
( ) t t
t
s s s
s s s
w e H
w e H
jw
jw
6 . 0 , 001 . 0
4 . 0 , 01 . 1 99 . 0
p s
w w w = A
o
10
log 20 = A
( )
( )
( )
( )
( )
1 2
2
0
0
1
sin
, 0
c
I n
w n
n M
n I
| o o
o
t o |
| |
(
|

\ .
s s

| |
0,
h n
otherwise

5 . 18 2 = = M where o
( )
( ) ( )

<
s s +
>
=
21 , 0 . 0
50 21 , 21 07886 . 0 21 5842 . 0
50 , 7 . 8 1102 . 0
4 . 0
A
A A A
A A
|
8
2.285
A
M
w

=
A
110
Example 7.8 Kaiser Window Design
of a Lowpass Filter
( )
( ) t t
t
s s s
s s s
w e H
w e H
jw
jw
6 . 0 , 001 . 0
4 . 0 , 01 . 1 99 . 0
( ) 001 . 0 , min , 001 . 0 , 01 . 0
, 6 . 0 , 4 . 0
: 1
2 1 2 1
= = = =
= =
o o o o o
t t
s p
w w
step
0.5
2
s p
c
w w
cutoff frequency w t
+
= =
2: step
3: step
10
0.2 20log 60
0.5653 37
s p
w w w A
M
t o
|
A = = = =
= =
111
Example 7.8 Kaiser Window Design
of a Lowpass Filter
0.5653 | =
5 . 18 2 = = M where o
( )
( )
2
0
1
2
1
!
r
r
u
I u
r

=
(
= + (
(

( )
( )
( )
( )
( )
1 2
2
0
0
1
sin
, 0
c
I n
w n
n M
n I
| o o
o
t o |
| |
(
|

\ .
s s

| |
0,
h n
otherwise

( )
( ) ( )

<
s s +
>
=
21 , 0 . 0
50 21 , 21 07886 . 0 21 5842 . 0
50 , 7 . 8 1102 . 0
4 . 0
A
A A A
A A
|
8
37
2.285
A
M
w

= ~
A
10
3:
0.2 20log 60
s p
step
w w w A t o A = = = =
112
| |
( )
( )
( )
( )
( )
1 2
2
0
0
1
sin
, 0
c
I n
w n
h n n M
n I
| o o
o
t o |
| |
(
|

\ .
= s s

Ex. 7.8 Kaiser Window Design of a Lowpass Filter


113
7.3 Examples of FIR Filters Design
by the Kaiser Window Method
The ideal highpass filter with
generalized linear phase
( )

s s
<
=

t w w e
w w
e H
c
M jw
c
jw
hp
,
, 0
2
( ) ( )
jw
lp
M jw jw
hp
e H e e H =
2
| |
( )
( )
( )
( )
< <

= n
M n
M n w
M n
M n
n h
c
hp
,
2
2 sin
2
2 sin
t t
t
| | | | | |
hp
h n h n w n =
114
Example 7.9 Kaiser Window Design
of a Highpass Filter
Specifications:
( )
( ) t o o
o
s s + s s
s s
w w e H
w w e H
p
jw
s
jw
, 1 1
,
1 1
2
021 . 0 , 5 . 0 , 35 . 0
21 1
= = = = = o o o t t
p s
w w where
24 , 6 . 2 = = M |
By Kaiser window method
115
Example 7.9 Kaiser Window Design
of a Highpass Filter
Specifications:
( )
( ) t o o
o
s s + s s
s s
w w e H
w w e H
p
jw
s
jw
, 1 1
,
1 1
2
021 . 0 , 5 . 0 , 35 . 0
21 1
= = = = = o o o t t
p s
w w where
24 , 6 . 2 = = M |
By Kaiser window method
116
7.3.2 Discrete-Time Differentiator
( ) ( ) t t < < =

w e jw e H
M jw jw
diff
,
2
| |
( )
( )
( )
( )
< <


= n
M n
M n
M n
M n
n h
diff
,
2
2 sin
2
2 cos
2
t
t t
| | | | | | n w n h n h
diff
=
| | | | phase linear d generalize IV type or III type n M h n h : =
117
Example 7.10 Kaiser Window
Design of a Differentiator
Since kaisers formulas were
developed for frequency responses
with simple magnitude discontinuities,
it is not straightforward to apply them
to differentiators.

Suppose 4 . 2 10 = = | M
118
Group Delay
Phase:

Group Delay:
2
5
2 2
t t
+ = + w w
M
samples
M
5
2
=
119
Group Delay
Phase:

Group Delay:

Noninteger delay
2 2
5
2 2
t t
+ = + w w
M
samples
M
2
5
2
=
120
7.4 Optimum Approximations of FIR
Filters
Goal: Design a best filter for a given M
In designing a causal type I linear phase
FIR filter, it is convenient first to consider
the design of a zero phase filter.


Then insert a delay sufficient to make it
causal.
| | | | n h n h
e e
=
121
7.4 Optimum Approximations of FIR
Filters
| | | | n h n h
e e
=
( ) | | 2 , M L e n h e A
L
L n
jwn
e
jw
e
= =

=

( ) | | | | ( ) function periodic even real wn n h h e A


L
n
e e
jw
e
, , : cos 2 0
1

=
+ =
| |
. 2 samples M L by it delaying
by n h from obtained be can system causal A
e
=
| | | | | | n M h M n h n h
e
= = 2
( ) ( )
2 M jw jw
e
jw
e e A e H

=
122
7.4 Optimum Approximations of FIR
Filters
Designing a filter to meet these specifications
is to find the (L+1) impulse response values
| | L n n h
e
s s 0 ,
In Packs-McClellan algorithm,
is fixed, and is variable.
2 1
, , , o o and w w L
s p
( )
2 1
o o or
Packs-McClellan algorithm is the dominant
method for optimum design of FIR filters.
123
7.4 Optimum Approximations of FIR
Filters
( ) ( ) ( ) ( ) w n w T wn
n
cos cos cos cos cos
1
= =
( ) ( ) ( ) ( ) 1 cos cos 0 cos cos 0 cos
1
0
= = =

w w T w
( ) ( ) ( ) ( ) w w w T w cos cos cos 1 cos cos 1 cos
1
1
= = =

( ) ( ) 1 cos 2 cos 2 cos
2
2
= = w w T w
( ) ( )
( ) ( ) ( ) w T w T w
w T wn
n n
n
cos cos cos 2
cos cos
2 1
=
=
( ) ( )( ) ( )
( ) w w w w w
w w w w
cos 3 cos 4 cos 1 cos 2 cos 2
cos 2 cos cos 2 3 cos
3 2
= =
=
124
7.4 Optimum Approximations of FIR
Filters
( ) | | | | ( ) ( ) ( )
( )


=
=
= =
=
= = + =
L
k
k
k
w x
L
k
k
k
L
n
e e
jw
e
x a x P where
x P w a wn n h h e A
0
cos
0 1
cos cos 2 0
( ) ( ) ( ) ( ) | |
( ) f unction weighting the is w W where
e A e H w W w E
f unction error ion approximat an Def ine
jw
e
jw
d
=
125
7.4 Optimum Approximations of FIR
Filters
( )

s s
s s
=
t w w
w w
e H
s
p
jw
d
, 0
0 , 1
( )

s s
s s =
=
t
o
o
w w
w w
K
w W
s
p
, 1
0 ,
1
1
2
126
Minimax criterion
Within the frequency interval of the
passband and stopband, we seek a
frequency response that
minimizes the maximum weighted
approximation error of
( )
jw
e
e A
( ) ( ) ( ) ( ) | |
jw
e
jw
d
e A e H w W w E =
| | { }
( ) ( ) w E
F w L n n h
e
e s s
max min
0 :
127
Other criterions
| | { }
( )
|
.
|

\
|
=
}
s s
t
0 0 :
1
min dw w E H
L n n h
e
| | { }
( ) ( )
|
.
|

\
|
=
}
s s
t
0
2
0 :
2
min dw w E H
L n n h
e
| | { }
( ) ( ) w E H
F w L n n h
e
e s s

= max min
0 :
128
Let denote the closet subset consisting of
the disjoint union of closed subsets of the
real axis x.
Alternation Theorem
p
F
is an r th-order polynomial. ( )

=
=
r
k
k
k
x a x P
0
denotes a given desired function of x
that is continuous on
( ) x D
P
p
F
is a positive function, continuous on p
F
( ) x W
P
The weighted error is ( ) ( ) ( ) ( ) | | x P x D x W x E
P P P
=
( ) x E E
P
F x
P
e
= max
The maximum error is defined as
129
Alternation Theorem
A necessary and sufficient condition that be
the unique rth-order polynomial that
minimizes is that exhibit at least
(r+2) alternations; i.e., there must exist at
least (r+2) values in such that
( ) x P
E ( ) x E
P
i
x
P
F
2 2 1 +
< < <
r
x x x
( ) ( ) E x E x E
i P i P
= =
+1
( ) 1 , , 2 , 1 + = r i
and such that
for
130
Example 7.11 Alternation Theorem
and Polynomials
Each of these polynomials is of fifth
order.
The closed subsets of the real axis x
referred to in the theorem are the
regions


1 1 . 0 1 . 0 1 s s s s x and x
( ) 1 = x W
P
131
7.4.1 Optimal Type I Lowpass
Filters
For Type I lowpass filter


The desired lowpass frequency response


Weighting function
( ) ( )

=
=
L
k
k
k
w a w P
0
cos cos
( )
( )
( )

s s s s
s s s s
=
t w w w w
w w w w
w D
s s
p p
p
cos cos 1 , 0
0 1 cos cos , 1
cos
( )
( )
( )

s s s s
s s s s
=
t w w w w
w w w w
K
w W
s s
p p
p
cos cos 1 , 1
0 1 cos cos ,
1
cos
132
7.4.1 Optimal Type I Lowpass
Filters
The weighted approximation error is


The closed subset is

or
( ) ( ) ( ) ( ) | | w P w D w W w E
P P P
cos cos cos cos =
t s s s s w w and w w
s p
0
s p
w w and w w cos 1 1 cos cos s s s s
( ) x E
P
133
7.4.1 Optimal Type I Lowpass
Filters
The alternation theorem states that a set of
coefficients will correspond to the filter
representing the unique best approximation
to the ideal lowpass filter with the ratio
fixed at K and with passband and stopband
edge and if and only if
exhibits at least (L+2) alternations on ,
i.e., if and only if alternately equals plus
and minus its maximum value at least (L+2)
times.
Such approximations are called equiripple
approximations.
k
a
2 1
o o
p
w
s
w
) (cos w E
P
P
F
) (cos w E
P
134
7.4.1 Optimal Type I Lowpass
Filters
The alternation theorem states that
the optimum filter must have a
minimum of (L+2) alternations, but
does not exclude the possibility of
more than (L+2) alternations.
In fact, for a lowpass filter, the
maximum possible number of
alternations is (L+3).
135
7.4.1 Optimal Type I Lowpass
Filters
Because all of the filters satisfy the
alternation theorem for L=7 and for
the same value of , it follows
that and/or must be different for
each ,since the alternation theorem
states that the optimum filter under
the conditions of the theorem is
unique.
2 1
o o = K
p
w
s
w
136
Property for type I lowpass filters
from the alternation theorem
The maximum possible number of
alternations of the error is (L+3)
Alternations will always occur at and
All points with zero slop inside the passband
and all points with zero slop inside stopband
will correspond to alternations; i.e., the filter
will be equiripple, except possibly at
and
p
w
s
w
0 = w
t = w
137
7.4.2 Optimal Type II Lowpass
Filters
For Type II causal FIR filter:
The filter length (M+1) is even, ie, M is odd
Impulse response is symmetric
The frequency response is
| | M n n h s s 0
| | | | n h n M h =
( ) | |
( )
| |
( )
| | ( ) | | ( ) 2 1 , , 2 , 1 , 2 1 2
2
1
cos
2
cos 2
2 1
1
2
2 1
0
2
+ = + =
(

|
.
|

\
|
=
(

|
.
|

\
|
=

+
=

M n n M h n b where
n w n b e
n
M
w n h e e H
M
n
M jw
M
n
M jw jw

138
7.4.2 Optimal Type II Lowpass
Filters
| |
( )
( ) | | ( )
( )
(

=
(

|
.
|

\
|



=
+
=
2 1
0
2 1
1
cos
~
2 cos
2
1
cos
M
n
M
n
wn n b w n w n b
( ) ( ) ( ) w P w e e H
M jw jw
cos 2 cos
2
=
( ) ( ) ( ) 2 1 cos
0
= =

=
M L and w a w P where
L
k
k
k
| | | | | | ( ) | | n M h n b n b n b a find
k
+ = 2 1 2
~
139
7.4.2 Optimal Type II Lowpass
Filters
For Type II lowpass filter,
( ) ( )
( )

s s
s s
= =
t w w
w w
w
w D e H
s
p
P
jw
d
, 0
0 ,
2 cos
1
cos
( ) ( )
( )
( )

s s
s s
= =
t w w
w w
K
w
w W w W
s
p
P
, 2 cos
0 ,
2 cos
cos
140
7.4.3 The Park-McClellan Algorithm
From the alternation theorem, the optimum
filter will satisfy the set of equation
( ) ( ) ( ) | | ( ) ( ) 2 , , 2 , 1 1
1
+ = =
+
L i e A e H w W
i
jw
e
jw
d
o
( )
jw
e
e A
( )
( )
( )
( )
( )
( )
( )
i i
jw
d
jw
d
jw
d
L
L
L
L L L
L
L
w x where
e H
e H
e H
a
a
w W
x x x
w W
x x x
w W
x x x
L
cos
1
1
1
1
1
1
2
2
1
1
0
2
2
2
2
2 2
2
2
2
2 2
1
1
2
1 1
=
(
(
(
(
(

=
(
(
(
(

(
(
(
(
(
(
(
(

+
+
+
+ + +

o
141
7.4.3 The Park-McClellan Algorithm
Guessing a set of alternation frequencies
( )
( )
( )
( )
[

+
=
=
+
=
+
+
=
=

=
2
1
2
1
1
2
1
cos ,
1
1
L
k i
i
i i
i k
k
L
k
k
k
k
L
k
jw
d k
w x
x x
b where
w W
b
e H b
k
o
( ) 2 , , 2 , 1 + = L i for w
i

s l p l
w w w w = =
+1
,
and
142
7.4.3 The Park-McClellan Algorithm
( ) ( )
( ) | |
( ) | |
( )
( )
2
1
1
1
1
1
1
1
cos , cos
+
+
=
=
+
=
+
=
=

=
=

= =
[

L k k
L
k i
i
i k
k
k k
L
k
k k
k
L
k
k k
jw
e
x x b
x x
d
w x x
x x d
C x x d
w P e A
143
7.4.3 The Park-McClellan Algorithm
For equiripple lowpass approximation




Filter length: (M+1)
( )
p s
w w w where
w
M
= A
A

=
324 . 2
13 log 10
2 1 10
o o
144
7.5 Examples of FIR Equiripple Approximation
7.5.1 Lowpass Filter
( )
( ) t t
t
s s s
s s s
w e H
w e H
jw
jw
6 . 0 , 001 . 0
4 . 0 , 01 . 1 99 . 0
26 = M
( )
( )
( )
( )
( )

s s
s s
= =
t w w e A
w w e A
w W
w E
w E
error ion approximat unweighted
s
jw
e
p
jw
e
A
, 0
0 , 1
145
Comments
M=26, Type I filter
The minimum number of alternations
is (L+2)=(M/2+2)=15
7 alternations in passband and 8
alternations in stopband
The maximum error in passband and
stopband are 0.0116 and 0.0016,
which exceed the specifications.
146
7.5.1 Lowpass Filter
M=27, , Type II filter, zero at z=-1
The maximum error in passband and
stopband are 0.0092 and 0.00092,
which exceed the specifications.
The minimum number of alternations
is (L+2)=(M-1)/2+2=15
7 alternations in passband and 8
alternations in stopband
( ) t = w
147
Comparison
Kaiser window method require M=38
to meet or exceed the specifications.
Park-McClellan method require M=27
Window method produce
approximately equal maximum error in
passband and stopband.
Park-McClellan method can weight the
error differently.
148
7.6 Comments on IIR and FIR
Discrete-Time Filters
What type of system is best, IIR or
FIR?
Why give so many different design
methods?
Which method yields the best result?


149
7.6 Comments on IIR and FIR
Discrete-Time Filters
Closed-
Form
Formulas
Generalized
Linear Phase
Order
IIR Yes No Low
FIR No Yes High
150
7.2.1 Properties of Commonly Used
Windows
Their Fourier transforms are concentrated
around
They have a simple functional form that
allows them to be computed easily.
0 = w
The Fourier transform of the Bartlett
window can be expressed as a product of
Fourier transforms of rectangular windows.
The Fourier transforms of the other
windows can be expressed as sums of
frequency-shifted Fourier transforms of
rectangular windows.(Problem7.34)
151
Homework
Simulate the frequency response
(magnitude and phase) for
Rectangular, Bartlett, Hanning,
Hamming, and Blackman window with
M=21 and M=51
152 2014/9/14 152 Zhongguo Liu_Biomedical Engineering_Shandong Univ.
Chapter 5 HW

You might also like