Digital Signal Processing, MM4.ppt - Department of...
-
Upload
doannguyet -
Category
Documents
-
view
227 -
download
0
Transcript of Digital Signal Processing, MM4.ppt - Department of...
1
Digital Signal Processing, Fall 2009
L t 4 Filt D i n
Zheng-Hua Tan
D t t f El t i S t
Lecture 4: Filter Design
Digital Signal Processing, IV, Zheng-Hua Tan, 20091
Department of Electronic Systems Aalborg University, Denmark
Course at a glance
Discrete-time signals and systems
MM1 System
Fourier transform and Z-transform
Filt d i
MM2
Sampling andreconstruction
MM3
Systemanalysis
Digital Signal Processing, IV, Zheng-Hua Tan, 20092
DFT/FFT
Filter design
MM5
MM4
2
Part I: Filter design
Filter design
IIR filter design
FIR filter design
Digital Signal Processing, IV, Zheng-Hua Tan, 20093
Filter design process
Filter, in broader sense, covers any system.
Three design steps
SpecificationsProblem
Solution
RealizationApproximations
M it d
System functionPerformance constraints
Digital Signal Processing, IV, Zheng-Hua Tan, 20094
Magnitude responsePhase response(frequency domain)Complexity
Structure IIR or FIRSubtype
3
Specifications – an example
Specifications for a discrete-time lowpass filter
pjeH 0 ,01.01|)(|01.01
sjeH ,001.0|)(|
001.0
01.0
2
1
Digital Signal Processing, IV, Zheng-Hua Tan, 20095
Specifications of frequency response
Typical lowpass filter specifications in terms of tolerable Passband distortion as smallest as possible Passband distortion, as smallest as possible
Stopband attenuation, as greatest as possible
Width of transition band: as narrowest as possible
Improving one often worsens others a tradeoff
Increasing filter order improves all
Digital Signal Processing, IV, Zheng-Hua Tan, 20096
Increasing filter order improves all
4
DT filter for CT signals
DT filter for the processing of CT signals Bandlimited input signal High enough sampling frequencyg g p g q y
Then, specifications (often given in frequency domain) conversion is straightforward
TjHeH
T
TeHjH
effj
Tj
eff
|| ),()(
/|| ,0
/|| ),()( Signal is band-limited;
T is small enough.
Digital Signal Processing, IV, Zheng-Hua Tan, 20097
Fig. 7.1
Tjeff ||),()(
Specifications – an example
Specifications for a CT lowpass filter
)2000(20 ,01.01|)(|01.01 jHeff
Fig 7.2(a)(b)
)3000(2 ,001.0|)(| jHeff
001.0
01.0
2
1
T
Digital Signal Processing, IV, Zheng-Hua Tan, 20098
)3000(2
)2000(22
s
p
5
Design a filter
Design goal: find system function to make frequency response meet the specifications (tolerances)
Infinite impulse response filter Infinite impulse response filter Poles insider unit circle due to causality and stability
Rational function approximation
Finite impulse response filter Linear phase is often required
Polynomial approximation
Digital Signal Processing, IV, Zheng-Hua Tan, 20099
Polynomial approximation
E.g. IIR filter design
For rational system function
Nk
M
k
kk zb
zH 0)(
find the system coefficients such that the corresponding frequency response
id d i ti t d i d
k
kk za
1
1
jezj zHeH
|)()(
Digital Signal Processing, IV, Zheng-Hua Tan, 200910
provides a good approximation to a desired response
H(z)•Rational system function•Stable•causal
)()( jdesired
j eHeH
6
FIR and IIR
IIR Rational system
f ti
FIR Polynomial system
functionfunction
Poles + zeros
Stable/unstable
Hard to control phase
Low order (4-20)
function
Zeros
Stable
Easy to get linear phase
High order (20-
Digital Signal Processing, IV, Zheng-Hua Tan, 200911
Low order (4 20)
Designed on the basis of analog filter
2000)
Unrelated to analog filter
FIR or IIR
Whether FIR or IIR often depends on the phase requirements
Design principle Design principle If GLP is essential FIR
If not IIR preferable (can meet specifications with lower complexity)
Digital Signal Processing, IV, Zheng-Hua Tan, 200912
7
Part II: IIR Filter design
Filter design
IIR filter design Analog filter design
IIR filter design by impulse invariance
FIR filter design
Digital Signal Processing, IV, Zheng-Hua Tan, 200913
Design IIR filter based on analog filter
The mapping is direct
/||0
/|| ),()(
T
TeHjH
Tj
eff Signal is band-limited;
Advanced analog filter design techniques
Designing DT filter by transforming prototype CT filter:
|| ),()(
/|| ,0
TjHeH
T
effj
T is small enough.
Digital Signal Processing, IV, Zheng-Hua Tan, 200914
filter: Transform (map) DT specifications to analog
Design analog filter
Inverse-transform analog filter to DT
8
Transformation method
Transform (map) DT specifications to analog
Design analog filter
T
Design analog filter
Inverse-transform to DT)(or )( thsH cc
][or )( nhzH
jj
j
tj
st
rez
dtethjH
dtethsH
js
)()(
)()(
• The imaginary axis of the s-plane
Digital Signal Processing, IV, Zheng-Hua Tan, 200915
n
n
n
njj
znxzX
enxeX
][)(
][)( The imaginary axis of the s plane the unit circle of the z-plane• Poles in the left half of the s-plane poles inside the unit circle in the z-plane (stable)
Part II-A: Analog Filter design
Filter design
IIR filter design Analog filter design
IIR filter design by impulse invariance
FIR filter design
Digital Signal Processing, IV, Zheng-Hua Tan, 200916
9
Analog filter design
Butterworth
Chebyshev I
Cheb she II Chebyshev II
Ellipical
Digital Signal Processing, IV, Zheng-Hua Tan, 200917
Butterworth lowpass filters
The magnitude response Maximally flat in the passband
Monotonic in both passband and stopband Monotonic in both passband and stopband
The squared magnitude response
Nc
c jH2
2
)/(1
1|)(|
Digital Signal Processing, IV, Zheng-Hua Tan, 200918
10
Poles in s-plane
Digital Signal Processing, IV, Zheng-Hua Tan, 200919
Part II-B: Design by impulse invariance
Filter design
IIR filter design Analog filter design
IIR filter design by impulse invariance
FIR filter design
Digital Signal Processing, IV, Zheng-Hua Tan, 200920
11
Filter design by impulse invariance
Impulse invariance: a method for obtaining a DT system whose is determined by the of a CT system.
)( jHc)( jeH
of a CT system.
In DT filter design, the specifications are provided in the DT, so Td has no role. Td is included for discussion
interval sampling design'' -
)(][
d
dcd
T
nThTnh
Digital Signal Processing, IV, Zheng-Hua Tan, 200921
, d d
though. Td also has nothing to do with C/D and D/C conversion in Fig. 7.1, i.e. Td need not be the same as the sampling period T of the C/D and D/C conversion.
Relationship btw frequency responses
Impulse response sampling:
Frequency response)(][ dcd nThTnh
k21
)(][ nTxnx c Frequency response
if the CT filter is bandlimited
then
/|| ,0)(
)2
()(
dc
dk dc
j
TjH
kT
jT
jHeH
k
cj
T
kj
TjX
TeX )
2(
1)(
||)()( jHeH ffj
Digital Signal Processing, IV, Zheng-Hua Tan, 200922
This is also the way to get CT filter specifications from
|| ),()(d
cj
TjHeH
dj TeH /relation theapplyingby )(
|| ),()(T
jHeH eff
12
Aliasing in the impulse invariance design
)2
()( kT
jT
jHeHdk d
cj
)(][ dcd nThTnh
TT dk d
Digital Signal Processing, IV, Zheng-Hua Tan, 200923
The continuous-time filter may be designed to exceed the specifications, particularly in the stopband.
Impulse invariance with a Butterworth filter
Specifications
||30177830|)(|
2.0||0 ,1|)(|89125.0j
j
H
eH
Since the sampling interval Td cancels in the impulse invariance procedure, we choose Td=1, so
Magnitude function for a CT Butterworth filter
||3.0 ,17783.0|)(| jeH
||30177830|)(|
2.0||0 ,1|)(|89125.0
jH
jHc
/|| ,0
/|| ),()(
T
TeHjH
j
Tj
eff
Digital Signal Processing, IV, Zheng-Hua Tan, 200924
Due to the monotonic function of Butterworth filter, we have
||3.0 ,17783.0|)(| jHc
17783.0|)3.0(|
89125.0|)2.0(|
jH
jH
c
c
|| ),()(T
jHeH effj
13
Impulse invariance with a Butterworth filter
Squared magnitude function of a Butterworth filter
177830|)30(|
89125.0|)2.0(|
jH
jHc
Nc jH2
2
)/(1
1|)(|
(1)(2)
22
22
)17783.0
1()
3.0(1
)89125.0
1()
2.0(1
N
c
N
c
17783.0|)3.0(| jHcc )/(1
7032.0c
6N(5)
(3)
(6)
Digital Signal Processing, IV, Zheng-Hua Tan, 200925
70474.0
8858.5
c
N(4)
12
2
)7032.0/(1
1
)/(1
1)()(
js
jssHsH
Nc
cc
Impulse invariance with a Butterworth filter
12 poles for the squared magnitude functionfunction
The system function has the three pole pairs in the left half of the s-plane
Digital Signal Processing, IV, Zheng-Hua Tan, 200926
14
Impulse invariance with a Butterworth filter
To construct Hc(s) from the magnitude-squared function Hc(s)Hc(-s) , we choose the poles on the left-half-plane part of the s-plane to obtain a stable and causal filter.
)4945.03585.1)(4945.09945.0)(4945.03640.0(
12093.0)(
222
sssssssHc
4466028710 1z
Express Hc(s) as a partial fraction expansion, perform the transformation of Eq. (7.12):
Digital Signal Processing, IV, Zheng-Hua Tan, 200927
)2570.09972.01(
6303.08557.1
)3699.00691.11(
1455.11428.2
)6949.02971.11(
4466.02871.0)(
21
1
21
1
21
zz
z
zz
z
zz
zzH
Impulse invariance with a Butterworth filter
Digital Signal Processing, IV, Zheng-Hua Tan, 200928
15
Part III: FIR filter design
Filter design
IIR filter design
FIR filter design Commonly used windows
Generalized linear-phase FIR filter
The Kaiser window filter design method
Digital Signal Processing, IV, Zheng-Hua Tan, 200929
FIR filter design
Design problem: the FIR system function
)(0
zbzHM
k
kk
Start from impulse response directly
otherwise ,0
0 ,][
0
Mnbnh n
k
MzMhzhhzH ][...]1[]0[)( 1
Digital Signal Processing, IV, Zheng-Hua Tan, 200930
Find
the degree M and
the filter coefficients h[k]
to approximate a desired frequency response
16
Lowpass filter – as an example
Ideal lowpass filter
nn
nheH ccj sin][
|| ,1)(
IIR filter: based on transformations of CT IIR system into DT ones.
nn
nheHc
lp ,][ ,0
)(
Nc jH2
2 1|)(|
Digital Signal Processing, IV, Zheng-Hua Tan, 200931
FIR filter: how? is non-causal, infinite! ][nh
Nc
c j2)/(1
|)(|
poles
Design by windowing
Desired frequency responses are often piecewise-constant with discontinuities at the boundaries between bands, resulting in non-causal and infintebetween bands, resulting in non causal and infinteimpulse response extending from to , but
So, the most straightforward method is to truncate the ideal response by windowing and do time-shifting:
0][ , nhn d
Digital Signal Processing, IV, Zheng-Hua Tan, 200932
][][
otherwise ,0
|| ],[][
Mngnh
Mnnhng d
17
Design by windowing
After Champagne & Labeau, DSP Class Notes 2002.
Digital Signal Processing, IV, Zheng-Hua Tan, 200933
Design by rectangular window
In general,
][][][ nwnhnh d
For simple truncation, the window is the rectangular window
otherwise ,0
0 ,1][
][][][
Mnnw
d
Digital Signal Processing, IV, Zheng-Hua Tan, 200934
deHeHeH jjd
j )()(2
1)( )(
18
Convolution process by truncation
Fig. 7.19
Digital Signal Processing, IV, Zheng-Hua Tan, 200935
?t then wha, ,1][ nnw )2(2)( reWr
j
band narrow be should )( jeW
Requirements on the window
, ,1][ nnw )2(2)( reWr
j
bandnarrowbeshould)( jeW
Requirements approximates an impulse to faithfully
reproduce the desired frequency response
w[n] as short as possible in duration (the order of the filter) to minimize computation in the implementation of
bandnarrow be should)(eW
)( jeW
Digital Signal Processing, IV, Zheng-Hua Tan, 200936
) p pthe filter
Conflicting
Take the rectangular window as an example.
19
Rectangular window
M+1
M=7
4constant
Digital Signal Processing, IV, Zheng-Hua Tan, 200937
Part III-A: Commonly used windows
Filter design
IIR filter design
FIR filter design Commonly used windows
Generalized linear-phase FIR filter
The Kaiser window filter design method
Digital Signal Processing, IV, Zheng-Hua Tan, 200938
20
Standard windows – time domain
Rectangular
2/0/2 MM
otherwise ,0
0 ,1][
Mnnw
Triangular
Hanning
otherwise ,0
0 ),/2cos(5.05.0][
MnMnnw
otherwise ,0
2/ ,/22
2/0 ,/2
][ MnMMn
MnMn
nw
Digital Signal Processing, IV, Zheng-Hua Tan, 200939
Hamming
Blackman
,
otherwise ,0
0 ),/2cos(46.054.0][
MnMnnw
otherwise ,0
0 ),/4cos(08.0)/2cos(5.042.0][
MnMnMnnw
Standard windows – figure
Fig. 7.21
Digital Signal Processing, IV, Zheng-Hua Tan, 200940
Plotted for convenience. In fact, the window is defined only at integer values of n.
21
Standard windows – magnitude
Digital Signal Processing, IV, Zheng-Hua Tan, 200941
Standard windows – comparison
Magnitude of side lobes vs width of main lobe
Digital Signal Processing, IV, Zheng-Hua Tan, 200942
Independent of M!
22
Part III-B: Linear-phase FIR filter
Filter design
IIR filter design Analog filter design
IIR filter design by impulse invariance
FIR filter design Commonly used windows
Digital Signal Processing, IV, Zheng-Hua Tan, 200943
Generalized linear-phase FIR filter
The Kaiser window filter design method
Linear-phase FIR systems
Generalized linear-phase system
)()( jjjj eeAeH
Causal FIR systems have generalized linear-phase if h[n] satisfies the symmetry condition
constants real are and
, offunction real a is )(
jeA
Digital Signal Processing, IV, Zheng-Hua Tan, 200944
MnnhnMh
MnnhnMh
,...,1,0 ],[][
or
,...,1,0 ],[][
23
Generalized linear phase FIR filter
Often aim at designing causal systems with a generalized linear phase (stability is not a problem) If the impulse response of the desired filter is If the impulse response of the desired filter is
symmetric about M/2,
Choose windows being symmetric about the point M/2
2/)()( Mjje
j eeWeW
otherwise ,0
0 ],[][
MnnMwnw
][][ nhnMh dd
Digital Signal Processing, IV, Zheng-Hua Tan, 200945
is a real, even function of w
the resulting frequency response will have a generalized linear phase
)( je eW
2/)()( Mjje
j eeAeH even and real is )( je eA
Linear-phase lowpass filter – an example
Desired frequency response
e
eH cMj
jlp
|| ,)(
2/
so
apply a symmetric window a linear phase system
nMn
Mnnh c
lp
c
lp
,)2/(
)]2/(sin[][
,0)(
][][ nhnMh lplp
Digital Signal Processing, IV, Zheng-Hua Tan, 200946
apply a symmetric window a linear-phase system
][)2/(
)]2/(sin[][][][ nw
Mn
Mnnwnhnh c
lp
24
Window method approximations
)()(
even and real is )(
)()(
2/
2/
Mjjj
je
Mjje
jd
eeWeW
eH
eeHeH
even and real is )(
)()(j
e
e
eW
eeWeW
eeAeH Mjje
j )()( 2/
Digital Signal Processing, IV, Zheng-Hua Tan, 200947
deWeHeA j
ej
ej
e )()(2
1)( )(
Key parameters
To meet the requirement of FIR filter, choose Shape of the window
Duration of the window Duration of the window
Trail and error is not a satisfactory method to design filters a simple formalization of the window method by Kaiser
Digital Signal Processing, IV, Zheng-Hua Tan, 200948
25
Part III-C: Kaiser window filter design
Filter design
IIR filter design Analog filter design
IIR filter design by impulse invariance
FIR filter design Commonly used windows
Digital Signal Processing, IV, Zheng-Hua Tan, 200949
Generalized linear-phase FIR filter
The Kaiser window filter design method
The Kaiser window filter design method
An easy way to find the trade-off between the main-lobe width and side-lobe area
The Kaiser window The Kaiser window
is the zeroth order modified Bessel function of
2/
otherwise ,0
0 ,)(
])]/)[(1([
][ 0
2/120
M
MnI
nI
nw
)(I
Digital Signal Processing, IV, Zheng-Hua Tan, 200950
is the zeroth-order modified Bessel function of the first kind. is an adjustable design parameter.
The length (M+1) and the shape parameter can be adjusted to trade side-lobe amplitude for main-lobe width (not possible for preceding windows!)
)(0 I0
26
The Kaiser window
Digital Signal Processing, IV, Zheng-Hua Tan, 200951
Design FIR filter by the Kaiser window
Calculate M and to meet the filter specification The peak approximation error is determined by
Define then
log20A (Peak error is fixed for other windows)Define then
Passband cutoff frequency is determined by: 1|)(| jeH
21 ,0.0
5021 ),21(07886.021)-0.5842(A
50 ),7.8(1102.00.4
A
AA
AA
p
10log20A (Peak error is fixed for other windows)
(Rectangular)
Digital Signal Processing, IV, Zheng-Hua Tan, 200952
Stopband cutoff frequency by:
Transition width
M must satisfy
|)(|
|)(| jeH
ps s
285.2
8AM
27
A lowpass filter Specifications
Specifications for a discrete-time lowpass filter
4.00 ,01.01|)(|01.01 pjeH
6.0 ,001.0|)(| sjeH
001.0
01.0
2
1
Digital Signal Processing, IV, Zheng-Hua Tan, 200953
Design the lowpass filter by Kaiser window
Designing by window method indicating , we must set
Transition width
001.0 20
21
Transition width
The two parameters:
Cutoff frequency of the ideal lowpass filter
I l
60log20 10 A
2.0 ps
37 ,653.5 M
5.02/)( psc
Digital Signal Processing, IV, Zheng-Hua Tan, 200954
Impulse response
otherwise ,0
0 ,)(
])]/)[(1([
)(
)(sin
][ 0
2/120 Mn
I
nI
n
n
nhc
28
Design the lowpass filter
What is the group delay?
M/2=18 5M/2 18.5
Digital Signal Processing, IV, Zheng-Hua Tan, 200955
Summary Filter design
IIR filter design Analog filter design
IIR filter design by impulse invariance
FIR filter design Commonly used windows
Digital Signal Processing, IV, Zheng-Hua Tan, 200956
Generalized linear-phase FIR filter
The Kaiser window filter design method
29
Course at a glance
Discrete-time signals and systems
MM1 System
Fourier transform and Z-transform
Filt d i
MM2
Sampling andreconstruction
MM3
Systemanalysis
Digital Signal Processing, IV, Zheng-Hua Tan, 200957
DFT/FFT
Filter design
MM5
MM4