Ch5-Dsp Design DF
Ch5-Dsp Design DF
1/37
Contents
5.1 General considerations
5.5 Summary
5.6 Problems
2/37
5.1 General considerations
What we have gained?
• FIR & IIR
• DFT/IDFT & FFT/IFFT
• Desired filter characteristics, i.e., magnitude & phase res.
What we are going to do?
• Further study on FIR & IIR in terms of filter designs, e.g.,
sidelobes in the stopband, complexity,…
• Freq. transformation in both analog & digital sig. for
lowpass, bandpass, bandstop, or high pass filters
• Various necessary design of digital filters
3/37
5.1 General considerations
Causality & its implications
• Let us examining the impulse res. h(n) of an ideal lowpass
filter with freq. res. given by
1, c
H ( )
0, c | |
8/37
5.2 Design of FIR filters
Symmetric & anti-symmetric FIR filters
• An linear-phase FIR filter of length M described by dif. equ.
M 1 M 1
y ( n) h(k ) x(n k ) bk x(n k )
k 0 k 0
h(k ) bk
M 1
H ( z) h( k ) z k
k 0
10/37
5.2 Design of FIR filters
Symmetric & anti-symmetric FIR filters
• An FIR filter has linear phase if its unit sample res. Satisfies
the condition h(n) h( M 1 n), n 9,1,.., M 1
11/37
5.2 Design of FIR filters
Symmetric & anti-symmetric FIR filters
• Utilizing the sym & anti-sym, we have
( M 3)/2
M 1
h(n) z
( M 1)/2 , M odd
z h
( M 1 2 n )/2
z ( M 1 2 n )/2
2 n 0
( M /2) 1
z ( M 1)/2 h(n) z ( M 1 2 n)/2 z ( M 1 2 n)/2 , M even
n 0
• We also have
M 1 M 1
z z 1
H ( z) h( k ) z k
1
H (z ) h( k ) z k
k 0 k 0 12/37
5.2 Design of FIR filters
Symmetric & anti-symmetric FIR filters
M 1 M 1
H (z ) 1
h( k ) z z
k ( M 1) 1
H (z ) h(k ) z k z ( M 1)
k 0 k 0
M 1
z ( M 1) 1
H (z ) h(k ) z ( M 1 k ) H ( z ), h(n) h( M 1 n)
k 0
H ( z ) H ( z 1 ) z ( M 1)
H ( ) H r ( )e j ( M 1)/2
M 1 ( M 3)/2 M 1
h 2 h ( n ) cos n , M odd
2 n 0 2
H r ( )
( M /2) 1
M 1
2 h ( n ) cos n , M even
n 0 2
M 1
2 , if H r ( ) 0
( )
M 1 , if H ( ) 0
2 r
14/37
5.2 Design of FIR filters
Symmetric & anti-symmetric FIR filters
• When h(n) = –h(M – 1 – n) page 683/1104
H ( ) jH r ( )e j ( M 1)/2 H r ( )e j[ ( M 1)/2 /2]
( M 3)/2 M 1
2 h ( n ) sin n , M odd
n 0 2
H r ( )
( M /2) 1
M 1
2 h ( n ) sin n , M even
n 0 2
M 1
2 2 , if H r ( ) 0
( )
3 M 1 , if H ( ) 0
2 r
2 15/37
5.2 Design of FIR filters
Symmetric & anti-symmetric FIR filters
• h(n) = h(M – 1 – n):
(M + 1)/2 filter coefficients when M is odd
M/2 filter coefficients when M is even
None-zeros res. at = 0
• h(n) = –h(M – 1 – n):
(M – 1)/2 coefficients when M is odd, due to h(M – 1)/2 = 0
M/2 coefficients when M is even
Zero res. at = 0 & =
We now design the desired freq. response Hd() of the FIR filter
16/37
5.2 Design of FIR filters
Design of linear-phase FIR filters using windows
• Fourier transform relations of Hd() & hd(n)
H d ( ) d
h ( n ) e j n
n 0
1 j n
hd (n)
2
H d ( )e d
19/37
5.2 Design of FIR filters
Design of linear-phase FIR filters using windows
Ex. 5.1: Assume that we want to design a sym. lowpass linear-
phase FIR filter having a desired freq. res. Below
e j (M 1)/2 , 0 c
H d ( )
0, otherwise
A delay of (M – 1)/2 units is incorporated into Hd() in
anticipation of forcing the filter to be of length M
c
1 sin c [n ( M 1) / 2]
hd (n) e j[ n ( M 1)/2] d , n ( M 1) / 2
2 c
[n ( M 1) / 2]
21/37
5.2 Design of FIR filters
Design of linear-phase FIR filters by freq.-sampling
Hd() is equally sampled by
M 1
k 0,1,..., , M odd
2 2 1
k (k ), , 0,
M k 0,1,..., M 1, M even 2
2
2
Define H (k ) H (k )
M
M 1
Because H ( ) h(n)e j n
n 0
M 1
We have H (k ) h(n)e j 2 ( k ) n / M , k 0,1,..., M 1
n 0
22/37
5.2 Design of FIR filters
Design of linear-phase FIR filters by freq.-sampling
Inversely we obtain
M 1
1
h( n)
M
H (k )e j 2 ( k ) n / M , n 0,1,..., M 1
k 0
Can
we
design
a passband
Filter?
B( s)
k
s k
k 0
H a (s) N
A( s )
k
s k
k 0
27/37
5.3 Design of IIR filters from analog filters
Techniques
• Its impulse res. is related to Ha(s) by Laplace transform
H a (s) h(t )e st dt
• It can be described by linear constant-coefficient dif. equ.
N
d k y (t ) M
d k x(t )
k dt k
k
dt k
k 0 k 0
Note:
1) An analog LTI sys. with the sys. function is stable if its poles
lie in the left half of the s-plane (LHP)
2) Not a linear-phase filter
28/37
5.3 Design of IIR filters from analog filters
IIR filter design by approximation of derivatives
• An equivalent dif. equ. for the first derivative is given by
dy (t ) y (nT ) y (nT T ) y (n) y (n 1)
dt t nT T T
29/37
5.3 Design of IIR filters from analog filters
IIR filter design by approximation of derivatives
• An equivalent dif. equ. for the second derivative is given by
d 2 y (t ) d dy (t )
dt 2 dt dt t nT
t nT
[ y (nT ) y (nT T )] / T [ y (nT T ) y (nT 2T )] / T
T
y (n) 2 y (n 1) y (n 2)
T2
1 2 1 z 1 2
1 2z z
s
2
2 T
T
30/37
5.3 Design of IIR filters from analog filters
IIR filter design by approximation of derivatives
• It is easily follows to obtain the kth derivative
1 z 1 k
s
k
T
H ( z ) H a ( s ) s (1 z1 )/T
• An Lth-order dif. is proposed in the form of
dy (t ) 1 L y (nT kT ) y (nT kT )
k
dt t nT T k 1 T
1 L
s k ( z k z k )
T k 1
• When z = ej, we have
2 L
s j k sin k
T k 1
33/37
5.3 Design of IIR filters from analog filters
IIR filter designs by …
FIR filter
IIR (s2z)
36/37
5.6 Problems
Problems
• All the problems related the lecture in Chapter 10 [4]
Matlab to compute, plot, and check
• Filter using window
• FIR filter
• IIR
Problems are solved mostly by students in the class
Group leaders have to submit Matlab files to my Zalo before the next
lecture (more details higher scores)