12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7...
-
Upload
noreen-harper -
Category
Documents
-
view
222 -
download
0
Transcript of 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7...
123/4/19 1Zhongguo Liu_Biomedical Engineering_Shandong U
niv.
Biomedical Signal processingChapter 7 Filter Design
Techniques
Zhongguo Liu
Biomedical Engineering
School of Control Science and Engineering, Shandong University
2
Chapter 7 Filter Design Techniques
7.0 Introduction7.1 Design of Discrete-Time IIR Filters
From Continuous-Time Filters7.2 Design of FIR Filters by Windowing7.3 Examples of FIR Filters Design by
the Kaiser Window Method7.4 Optimum Approximations of FIR
Filters7.5 Examples of FIR Equiripple
Approximation7.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 stepSpecifications are typically given in
the frequency domain.
6
Frequency-Selective Filters
Ideal lowpass filter
ww
wweH
c
cjwlp ,0
,1
0cw
cw 22
jweH
1
nn
nwnh c
lp ,sin
7
Frequency-Selective Filters
Ideal highpass filter
0,
1,cjw
hpc
w wH e
w w
0cw
cw 22
jweH
1
sin,c
hp
w nh n n n
n
8
Frequency-Selective Filters
Ideal bandpass filter
others
wwweH ccjw
bp,0
,121
01c
w1c
w
jweH
1
2cw
2cw
9
Frequency-Selective Filters
Ideal bandstop filter
others
wwweH ccjw
bs,1
,021
01c
w1c
w
jweH
1
2cw
2cw
10
If input is bandlimited and sampling frequency is high enough to avoid aliasing, then overall system behave as a continuous-time system:
T
TeHjH
Tj
eff
,0
,
Linear time-invariant discrete-time system
,effjw w
H H j wT
e
continuous-time specifications are converted to discrete time specifications by:
Tw
11
Example 7.1 Determining Specifications for a Discrete-Time
FilterSpecifications of the continuous-time filter:1. passband2. stopband
20002001.0101.01 forjH eff
30002001.0 forjH eff
sT 410
max
12 2
22 5000
fT T
T
TeHjH
Tj
eff
,0
,
12
Example 7.1 Determining Specifications for a Discrete-Time
FilterSpecifications of the continuous-time filter:1. passband2. stopband
20002001.0101.01 forjH eff
30002001.0 forjH eff
sT 410
max
12 2
22 5000
fT T
1 0.01
2 0.001
2 (2000)p
2 (3000)s
13
sT 410T
Example 7.1 Determining Specifications for a Discrete-Time
FilterSpecifications of the discrete-time filter in
1 0.01 2 0.001
2 (2000)p 2 (3000)s
0.4p 0.6s
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. jwezjs
planes planez 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.
planes Im
Re
planez 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.
dcd nThTnh
dc TjHif ,0
w
T
wjHeHthen
dc
jw ,
wforTw d
k ddc
jw kT
jT
wjHeH
2Relationship of frequencies
24
,, dT
relation between frequencies
S plane Z plane
-
3 / dT
j
/ dT
/ dT
k ddc
jw kT
jT
wjHeH
2Relationship of frequencies
dc TjHif ,0
w
T
wjHeHthen
dc
jw ,
25
Aliasing in the Impulse Invariance
k ddc
jw kT
jT
wjHeH
2
dc TjHif ,0
,jwc
d
wthen H e H j
T
w
26
periodic sampling
[ ] ( ) | ( )c t nT cx n x t x nT
T : sample period; fs=1/T:sample rateΩs=2π/T:sample rate
n
nTtts
s c c cn n
x t x t s t x t t nT x nT t nT
Review
27
Time domain : )(tx
Complex frequency domain :
dtetxsX st)()(
Laplace transformLaplace transform
js
f2
s pl ane
j
0
Relation between Laplace Relation between Laplace Transform and Z-transformTransform and Z-transform
Review
28
dtetxjX tj)()(
Fourier Transform
frequency domain :
s-pl ane
j
0
Fourier Transform is the Laplace transform Laplace transform
when s have the value only in imaginary axis, s=jΩ
js Since
So 0 s j
dtetxsX st)()(
29
( ) ( ) ( ) ( ) ( )n n
x n x t t nT x nT t nT
For discrete-time signal ,
( ) ( ) st
n
x nT t nT e dt
( ) ( )snT sT
n
x nT e X e
[ ( )] ( ) stx n x n e dt
L
sTz e令:( ) ( )n
n
x n z X z
z-transform
of discrete-
time signal
the Laplace transformLaplace transform
30
( )sT j T T j T jz e e e e re
n
nznxzX )()(
so :Tr e
T
relation betweens zand
Laplace transformLaplace transform continuous time signal
z-transformz-transform discrete-time signalrelation
[ ( )] ( ) ( )snT sT
n
x n x nT e X e
LsTz elet :
31
2 sT f f
DTFT : Discrete Time Fourier Transform
( )sT j T T j T jz e e e e re
( ) ( )j j n
n
X e x n e
S plane Z plane
-
3 / sT
j
/ sT
/ sT
1|j jrz re e
32
2 2s sT f f f
z plane
Re[ ]z
Im[ ]z
0
r
0 2 / 2
0 2
2
s
s s
s s
f
f
: 0
0 2
2 4
:sf f f
j
s pl ane
0
22s
s
f
T
sT
3
sT
3
sT
33
If input is bandlimited and fs>2fmax , :
T
TeHjH
Tj
eff
,0
,
discrete-time filter design by impulse invariance
wforTw d
k ddc
jw kT
jT
wjHeH
2
dc TjHif ,0
,jwc
d
wthen H e H j w
T
dcd nThTnh
34
,, dT
relation between frequencies
S plane Z plane
-
3 / dT
j
/ dT
/ dT
k ddc
jw kT
jT
wjHeH
2Relationship of frequencies
dc TjHif ,0
w
T
wjHeHthen
dc
jw ,
35
periodic sampling
[ ] ( ) | ( )c t nT cx n x t x nT
T : sample period; fs=1/T:sample rateΩs=2π/T:sample rate
n
nTtts
s c c cn n
x t x t s t x t t nT x nT t nT
2s
k
S j kT
1 1 2*
2 2s c c sk
X j X j S j X j k dT
1c s
k
X j kT
Review
36
proof of
T : sample period; fs=1/T:sample rate;Ωs=2π/T:sample rate
n
nTtts
2s
k
S j kT
Review
2s
k
S j kT
sjk tk
n
a e
s(t) 为冲击串序列,周期为 T ,可展开傅立叶级数
1sjk t
n
eT
2 ( )sjk t Fse k
37
periodic sampling
s c c cn n
x t x t s t x t t nT x nT t nT
j Tnc
k
x nT e
( ) j ts c
n
X j x nT t nT e dt
[ ] ( ) | ( )c t nT cx n x t x nT ( )j j n
cn
X e x nT e
( ) ( ) ( )j j Ts TX j X e X e
1( )j T
c sk
X e X j kT
1 2( ) c
k
j kX X j
T T Te
2s T
( ) 0,j Tif X eT
1( ) c
jthen X X jT T
e
1s c s
k
X j X j kT
38
discrete-time filter design by impulse invariance
k ddc
jw kT
jT
wjHeH
2
dc TjHif ,0
,jwc
d
wthen H e H j w
T
dcd nThTnh
1 2( ) c
k
j kX X j
T T Te
1
( ) cjX X j
T Te
1 2( ) c
k
j kH H j
T T Te
1( ) c
jH H jT T
e
[ ] ( ) | ( )c t nT cx n x t x nT [ ] ( )ch 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
w
T
wjHeH
dc
jw ,
dTw
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 filtersChebyshev Type I filtersChebyshev Type II filtersElliptic 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
ss
AsH
1
0,0
0,1
t
teAth
N
k
tsk
c
k
: k ds Tkpole s s z e
two requirements for transformation
N
k
nTskd
N
k
nTskdcd nueATnueATthTnh dkdk
11
N
kTskd
ze
ATzH
dk1
11
45
Example 7.2 Impulse Invariance with a Butterworth Filter
Specifications for the discrete-time filter:
weH
weH
jw
jw
3.0,17783.0
2.00,189125.0
dd TwTlet 1
Assume the effect of aliasing is negligible
3.0,17783.0
2.00,189125.0
jH
jH
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
0.2 0.89125
0.3 0.17783
c
c
H j
H j
0.30.2
2 20.2 1
10.89125
N
c
2 2
0.3 11
0.17783
N
c
2
2
1
1Nc
cH j
j j
2
2
11
N
cc
j jH j
47
Example 7.2 Impulse Invariance with a Butterworth Filter
2
2
1
1Nc
cH j
j j
2 20.2 1
1 1.258930.89125
N
c
7032.0,6 cN
2 20.3 1
1 31.622040.17783
N
c
20.2
0.25893
N
c
20.3
30.62204
N
c
23
118.263782
N
70470.0,8858.5 cN
0.2 0.89125
0.3 0.17783
c
c
H j
H j
48
Example 7.2 Impulse Invariance with a Butterworth
Filter
2
2
1
1Nc
cH j
j j
2
2
1
1Nc c c
cH s H s H s
s j
0,1, , 2 1k N 2 2 11 21 ,k
j N k NNc cs j e
6, 0.7032cN
0.182 0.679,j
0.497 0.497,j
0.679 0.182j
Plole pairs: cH s
49
Example 7.2 Impulse Invariance with a Butterworth Filter
4945.03585.14945.09945.04945.03640.0
12093.0222
ssssss
sH c
22
2 2 2
1
1
N
N N N
c
cc c c
cH s H s H s
ss j
0.182 0.679,j 0.497 0.497,j 0.679 0.182j Plole pairs: cH s
0.12093
0.182 0.679 0.182 0.679 0.497 0.497cH ss j s j s j
1
0.497 0.497 0.679 0.182 0.679 0.182s j s j s j
60.7032Nc
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.497cH ss j s j s j
1
0.497 0.497 0.679 0.182 0.679 0.182s j s j s j
1
Nk
k k
A
s s
1 1
1 11 1
N Nd k k
k kk d ks T s
T A AH z
e z e z
1dT
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
w
1
1
2 1
1dc
zH z H
T z
1
1
1
12
z
z
Ts
d
Bilinear transformation:
cH s
1
1
1
12
z
z
Ts
d
53
7.1.2 Bilinear Transformation
1
1
1
12
z
z
Ts
d
sT
sTz
d
d
21
21
js 221
221
dd
dd
TjT
TjTz
anyforz 10
anyforz 10
1 12 (1 ) 1dT s z z
11 2 ] 1 2d dT s z T s
54
7.1.2 Bilinear Transformation
jsaxisj
21
21
d
d
Tj
Tjz
1z 1 2
1 2d
d
jw j T
j Te
planes Im
Re
planez Im
Re
221
221
dd
dd
TjT
TjTz
anyforz 10
anyforz 10
js
55
7.1.2 Bilinear Transformation
1
1
1
12
z
z
Ts
d
2 1
1d
jw
jwjT
ee
2tan 2
d
j wT
2 2 sin 2
2cos 2d
j w
T w
2tan2
wTd
2tan2 1dTw
/2 /2 /2
/2 /2 /22 ( )
( )d
jw jw jw
jw jw jwT
e e ee e e
56
2tan
2
2tan
2
:
s
ds
p
dp
T
T
prewarp
2
tan2)()(
dT
cj jHeH
relation between frequency response of Hc(s), H(z)
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 / dT
j
/ dT
/ dT
2tan2
wTd
2tan2 1dTw
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.
0cw
cw 22
jweH
1
59
Bilinear Transformation of
1
1
1
12
z
z
Ts
d
2tan2
wTd
se
je
2tan 2
d
wT
dT
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 isn’t 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
weH
weH
jw
jw
6.0,001.0
4.0,01.199.0
63
0.0160.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
2 0.20.89125 1, 0 tan
2
2 0.30.7783, tan
2
cd
cd
H jT
H jT
, 1dFor convenience we choose T
,17783.015.0tan2
,89125.01.0tan2
jH
jH
c
c
2tan2
wTd
64
Example 7.3 Bilinear Transformation of a Butterworth Filter
,17783.015.0tan2
,89125.01.0tan2
jH
jH
c
c
N
c
cjj
jH 2
2
1
1
2 2
2 2
2 tan 0.1 11
0.89125
3tan 0.15 11
0.17783
N
c
N
c
305.5N
766.0
,6
c
N
0.0160.01
65
Locations of Poles
0,1, , 2 1k N 2 2 11 21 ,k
j N k NNc cs j e
0.1998 0.7401,j
0.5418 0.5418,j
0.7401 0.1998j
Plole pairs: cH s
2
2
1
1Nc
cH j
j j
2
2
1
1Nc c c
cH s H s H s
s j
6, 0.766cN
66
Example 7.3 Bilinear Transformation of a Butterworth Filter
5871.04802.15871.00836.15871.03996.0
20238.0222
ssssss
sH c
21
2121
61
2155.09904.01
1
3583.00106.117051.02686.11
10007378.0
zz
zzzz
zzH
22
2 2 2
1
1
N
N N N
c
cc c c
cH s H s H s
ss j
0.1998 0.7401,j 0.5418 0.5418,j 0.7401 0.1998j Plole pairs: cH s
1
1
1
12
z
z
Ts
d
67
Ex. 7.3 frequency response of discrete-time filter
68
Example 7.4 Butterworth Approximation (Hw)
weH
weH
jw
jw
6.0,001.0
4.0,01.199.014Norder
69
Example 7.4 frequency response
70
Chebyshev filters
C Chebyshev filter (type I)
)/(1
1|)(| 22
2
cN
cV
jH
)coscos()( 1 xNxVN
c
1
1
Chebyshev polynomial
Chebyshev filter (type II)
122
2
)]/([1
1|)(|
cN
cV
jH
1
c
71
Example 7.5 Chebyshev Type I , II Approximation
weH
weH
jw
jw
6.0,001.0
4.0,01.199.08Norder
Type I Type II
72
Example 7.5 frequency response of Chebyshev
Type I Type II
73
E
elliptic filters
Elliptic filter
)(1
1|)(|
222
Nc U
jH
sp
1
11
2Jacobian elliptic function
74
Example 7.6 Elliptic Approximation
weH
weH
jw
jw
6.0,001.0
4.0,01.199.06Norder
75
Example 7.6 frequency response of Elliptic
76
*Comparison of Butterworth, Chebyshev, elliptic filters: Example
-Given specification
0.4| | .011 |)(| 99.0 jeH ||0.6 0.001 |)(| jeH
6.0 ,4.0 001.0 ,01.0 s21 p
)( s
-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
4.0 6.0 4.0 6.0
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 MethodAn ideal desired frequency response
n
jwnd
jwd enheH
dweeHnh jwnjw
dd 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.
ww
wweH
c
cjwlp ,0
,1
sin clp
w nh n
n
0cw
cw
jweH1
81
Window Method
otherwise
Mnnhnh d
,0
0,
nwnhnh d
otherwise
Mnnw
,0
0,1
deWeHeH wjjwd
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
deWeH21
eH jjd
j
The windowed version is smeared version of desired response
83
Window Method
1
2j wjw j jw
d dH e H e W e d H e
If nnw 1
kn
jwnjw kwenweW 22
0cw
cw
jweH1
0 5 10510 1515
2
2
24 4 6
jwW e
84
Choice of Window is as short as possible in duration.
This minimizes computation in the implementation of the filter.
nw
approximates an impulse. jweW
0
Mjw jwn jwn
n n
W e w n e e
1
2sin 1 21
1 sin 2
jw MjwM
jw
w Mee
e w
otherwise
Mnnw
,0
0,1
1M
2
1M
2
1M
jwW e
85
Window Method
jwd
wjjwd
jw eHdeWeHeH
21
then would look like , except where changes very abruptly.
jweH jwd eH
jwd eH
nw jweW0w
If is chosen so that is concentrated in a narrow band of frequencies around
0cwcw
jwdH e
11M
2
1M
2
1M
jwW e
86
Rectangular Window for the rectangular window has a
generalized linear phase. jweW
As M increases, the width of the “main lobe” decreases. 4 1
mw M
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.
2sin 1 2
sin 2jw jwM
w MW e e
w
1M
2
1M
2
1M
1
M
M
1
M
M
87
Rectangular Window will oscillate at the
discontinuity.
deWeH wjjwd
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 WindowBy 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
ww
wweH
c
cjwlp ,0
,1
sin clp
w nh n
n
0cw
cw
jweH1
Review
dh n h n w n 1, 0
0,
n Mw n
otherwise
deWeHeH wjjwd
jw
2
1
1M
2
1M
2
1M
jwW e
sin 2
2cw n M
n M
02M0
2M0
M
M
2M0 M
90
7.2.1 Properties of Commonly Used Windows
Rectangular
otherwise
Mnnw
,0
0,1
otherwise
MnMMn
MnMn
nw
,0
2,22
20,2
Bartlett (triangular)
91
7.2.1 Properties of Commonly Used Windows
Hanning
otherwise
MnMnnw
,0
0,2cos5.05.0
otherwise
MnMnnw
,0
0,2cos46.054.0
Hamming
92
7.2.1 Properties of Commonly Used Windows
Blackman
otherwise
MnMn
Mnnw
,00,4cos08.0
2cos5.042.0
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
biggest , high oscillations at discontinuity
smallest , the 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.
otherwise
MnnMwnw
,0
0,
The above five windows are all symmetric about the point ,i.e.,2M
97
7.2.2 Incorporation of Generalized Linear Phase
Their Fourier transforms are of the form
2Mjwjwe
jw eeWeW woffunctionevenandrealaiseW jw
e
causalnwnhnh d :
d d dif h M n h n h n h n w n
2Mjwjwe
jw eeAeH
:h M n h n generalized linear phase
2MM
98
7.2.2 Incorporation of Generalized Linear Phase
phaselineardgeneralizenhnMh
nwnhnhnhnMhif ddd
:
2Mjwjwo
jw eejAeH
2MM
99
Frequency Domain Representation
nhnMhif dd 2Mjwjwe
jwd eeHeH
1
2jw
d
j wjH e H W de e
1
2 e e
j wjw jwewhere A H W de e e
221
2 e e
j w j w Mj j MH W de e e e
2Mjwjwe
jw eeWeW w n w M n
2jw jwMeA e e
dh n h n w n
100
Example 7.7 Linear-Phase Lowpass Filter
The desired frequency response is
ww
wweeH
c
cjwM
jwlp ,0
,2
lph M n
nw
Mn
Mnwnh c
2
2sin
21
2
sin 2
2
c
clp
c
w
w
jwM jwnh n dw
w n Mfor n
n M
e e
2M
wweH
wweH
sjw
pjw 01
101
magnitude frequency response
pw
sw
1 0jwp p
jws s
H e w w
H e w w
s pw w w
1020logp p
0.1 0.15jwH e w
1 0.05 0 0.25jwH e w
0.1s pw w w 1020log 0.05 26p dB
1020logs s
20s dB
102
7.2.1 Properties of Commonly Used Windows
smallest , the sharpest transition
biggest , high oscillations at discontinuity
103
7.2.3 The Kaiser Window Filter Design Method
1 22
0
0
1, 0
0,
I nn Mw n
I
otherwise
2,where M
0 :I u zero order modified Bessel function of the first kind
2
01
21
!r
ru
I ur
: 1,length M :parametershape: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.
ComparisonIf 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
pw
sw
Filter Design by Kaiser Window
wweH
wweH
sjw
pjw 01
ps www 10log20A
108
Filter Design by Kaiser Window
ps www 10log20A
21,0.0
5021,2107886.0215842.0
50,7.81102.04.0
A
AAA
AA
2285.2
8
w
AM
1 22
0
0
1, 0
0,
I nn Mw n
I
otherwise
M=20
109
Example 7.8 Kaiser Window Design of a Lowpass Filter
weH
weH
jw
jw
6.0,001.0
4.0,01.199.0
ps www 10log20A
1 22
0
0
1sin
, 0c
I nw n
n Mn I
0,h n
otherwise
5.182 Mwhere
21,0.0
5021,2107886.0215842.0
50,7.81102.04.0
A
AAA
AA
8
2.285
AM
w
110
Example 7.8 Kaiser Window Design of a Lowpass Filter
weH
weH
jw
jw
6.0,001.0
4.0,01.199.0
001.0,min,001.0,01.0
,6.0,4.0
:1
2121
sp ww
step
0.52
s pc
w wcutoff frequency w
2 :step
3:step100.2 20log 60
0.5653 37
s pw w w A
M
111
Example 7.8 Kaiser Window Design of a Lowpass Filter
0.5653
5.182 Mwhere 2
01
21
!r
ru
I ur
1 22
0
0
1sin
, 0c
I nw n
n Mn I
0,h n
otherwise
21,0.0
5021,2107886.0215842.0
50,7.81102.04.0
A
AAA
AA
837
2.285
AM
w
10
3:
0.2 20log 60s p
step
w w w A
112
1 22
0
0
1sin
, 0c
I nw n
h n n Mn I
Ex. 7.8 Kaiser Window Design of a Lowpass Filter
113
7.3 Examples of FIR Filters Design by the Kaiser Window
MethodThe ideal highpass filter with
generalized linear phase
wwe
wweH
cMjw
cjwhp ,
,02
jwlp
Mjwjwhp eHeeH 2
nMn
Mnw
Mn
Mnnh c
hp ,2
2sin
2
2sin
hph n h n w n
114
Example 7.9 Kaiser Window Design of a Highpass Filter
Specifications:
wweH
wweH
pjw
sjw
,11
,
11
2
021.0,5.0,35.0 211 ps wwwhere
24,6.2 M
By Kaiser window method
115
Example 7.9 Kaiser Window Design of a Highpass Filter
Specifications:
wweH
wweH
pjw
sjw
,11
,
11
2
021.0,5.0,35.0 211 ps wwwhere
24,6.2 M
By Kaiser window method
116
7.3.2 Discrete-Time Differentiator
wejweH Mjwjwdiff ,2
nMn
Mn
Mn
Mnnhdiff ,
2
2sin
2
2cos2
nwnhnh diff
phaselineardgeneralizeIVtypeorIIItypenMhnh :
117
Example 7.10 Kaiser Window Design of a Differentiator
Since kaiser’s formulas were developed for frequency responses with simple magnitude discontinuities, it is not straightforward to apply them to differentiators.
Suppose 4.210 M
118
Group Delay
Phase:
Group Delay:
25
22
ww
M
samplesM
52
119
Group Delay
Phase:
Group Delay:
Noninteger delay
22
5
22
ww
M
samplesM
2
5
2
120
7.4 Optimum Approximations of FIR Filters
Goal: Design a ‘best’ filter for a given MIn 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.
nhnh ee
121
7.4 Optimum Approximations of FIR Filters
nhnh ee
2, MLenheAL
Ln
jwne
jwe
functionperiodicevenrealwnnhheAL
nee
jwe ,,:cos20
1
.2 samplesMLbyitdelaying
bynhfromobtainedbecansystemcausalA e
nMhMnhnh e 2
2Mjwjwe
jw eeAeH
122
7.4 Optimum Approximations of FIR Filters
Designing a filter to meet these specifications is to find the (L+1) impulse response values
Lnnhe 0,
In Packs-McClellan algorithm,
is fixed, and is variable. 21,,, andwwL sp
21 or
Packs-McClellan algorithm is the dominant method for optimum design of FIR filters.
123
7.4 Optimum Approximations of FIR Filters
wnwTwn n coscoscoscoscos 1 1coscos0coscos0cos 1
0 wwTw
wwwTw coscoscos1coscos1cos 11
1cos2cos2cos 22 wwTw
wTwTw
wTwn
nn
n
coscoscos2
coscos
21
wwwww
wwww
cos3cos4cos1cos2cos2
cos2coscos23cos32
124
7.4 Optimum Approximations of FIR Filters
L
k
kk
wx
L
k
kk
L
nee
jwe
xaxPwhere
xPwawnnhheA
0
cos01
coscos20
functionweightingtheiswWwhere
eAeHwWwE
functionerrorionapproximatanDefinejw
ejw
d
125
7.4 Optimum Approximations of FIR Filters
ww
wweH
s
pjwd ,0
0,1
ww
wwKwW
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
jwe eA
jwe
jwd eAeHwWwE
wE
FwLnnhe maxmin
0:
127
Other criterions
00:1 min dwwEH
Lnnhe
0
2
0:2 min dwwEH
Lnnhe
wEH
FwLnnhe maxmin0:
128
Let denote the closet subset consisting of the disjoint union of closed subsets of the real axis x.
Alternation Theorem
pF
is an r th-order polynomial.
r
k
kk xaxP
0
denotes a given desired function of x that is continuous on
xDP
pF is a positive function, continuous on pF xWP
The weighted error is xPxDxWxE PPP
xEE PFx P
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
xPE xEP
ix PF
221 rxxx
ExExE iPiP 1
1,,2,1 ri
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
11.01.01 xandx
1xWP
131
7.4.1 Optimal Type I Lowpass Filters
For Type I lowpass filter
The desired lowpass frequency response
Weighting function
L
k
kk wawP
0
coscos
wwww
wwwwwD
ss
ppp coscos1,0
01coscos,1cos
wwww
wwwwKwW
ss
ppp
coscos1,1
01coscos,1
cos
132
7.4.1 Optimal Type I Lowpass Filters
The weighted approximation error is
The closed subset is
or
wPwDwWwE PPP coscoscoscos
wwandww sp0
sp wwandww cos11coscos
xEP
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.
ka
21
pwsw )(coswEP
PF
)(coswEP
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.
21 K
pwsw
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 andAll 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
pw sw
0w
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 oddImpulse response is symmetricThe frequency response is
Mnnh 0
nhnMh
21,,2,1,212
2
1cos
2cos2
21
1
2
21
0
2
MnnMhnbwhere
nwnbe
nM
wnheeH
M
n
Mjw
M
n
Mjwjw
138
7.4.2 Optimal Type II Lowpass Filters
21
0
21
1
cos~
2cos2
1cos
M
n
M
n
wnnbwnwnb
wPweeH Mjwjw cos2cos2
21cos0
MLandwawPwhereL
k
kk
nMhnbnbnbafind k 212~
139
7.4.2 Optimal Type II Lowpass Filters
For Type II lowpass filter,
ww
wwwwDeH
s
pP
jwd
,0
0,2cos
1cos
ww
wwK
wwWwW
s
pP
,2cos
0,2cos
cos
140
7.4.3 The Park-McClellan Algorithm
From the alternation theorem, the optimum filter will satisfy the set of equation
2,,2,11 1 LieAeHwW ijwe
jwd
jwe eA
ii
jwd
jwd
jwd
L
LLLLL
L
L
wxwhere
eH
eH
eH
a
a
wWxxx
wWxxx
wWxxx
L
cos
11
11
11
2
2
1
1
0
2
2
22
22
22
222
11
211
141
7.4.3 The Park-McClellan Algorithm
Guessing a set of alternation frequencies
2
12
1
1
2
1 cos,1
1
L
kii
iiik
kL
k k
kk
L
k
jwdk
wxxx
bwhere
wW
b
eHb k
2,,2,1 Liforwi slpl wwww 1,and
142
7.4.3 The Park-McClellan Algorithm
2
1
1
1
1
1
1
1
cos,cos
Lkk
L
kii ik
k
kkL
kkk
k
L
kkk
jwe
xxbxx
d
wxxxxd
CxxdwPeA
143
7.4.3 The Park-McClellan Algorithm
For equiripple lowpass approximation
Filter length: (M+1)
ps wwwwherew
M
324.2
13log10 2110
144
7.5 Examples of FIR Equiripple Approximation
7.5.1 Lowpass Filter
weH
weH
jw
jw
6.0,001.0
4.0,01.199.0
26M
wweA
wweA
wW
wEwE
errorionapproximatunweighted
sjw
e
pjw
eA
,0
0,1
145
Comments
M=26, Type I filterThe minimum number of
alternations is (L+2)=(M/2+2)=157 alternations in passband and 8
alternations in stopbandThe 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=-1The 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
w
147
Comparison
Kaiser window method require M=38 to meet or exceed the specifications.
Park-McClellan method require M=27Window 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.
0w
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
23/4/19152Zhongguo Liu_Biomedical Engineering_Shandong U
niv.
Chapter 5 HW7.2, 7.4, 7.15,
上一页 下一页返 回