0% found this document useful (0 votes)
20 views37 pages

Ch5-Dsp Design DF

The document discusses the design of digital filters, including: 1) FIR filter design using symmetric and anti-symmetric properties which allow reducing the number of filter coefficients. 2) Linear-phase FIR filters can be designed using window functions to truncate the infinite impulse response of an ideal filter to a finite impulse response. 3) IIR filters can be designed by transforming analog filters to the digital domain through mappings of the s-plane to the z-plane.

Uploaded by

trucquynhtudoan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views37 pages

Ch5-Dsp Design DF

The document discusses the design of digital filters, including: 1) FIR filter design using symmetric and anti-symmetric properties which allow reducing the number of filter coefficients. 2) Linear-phase FIR filters can be designed using window functions to truncate the infinite impulse response of an ideal filter to a finite impulse response. 3) IIR filters can be designed by transforming analog filters to the digital domain through mappings of the s-plane to the z-plane.

Uploaded by

trucquynhtudoan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Digital Signal Processing

Ch5: Design of Digital Filters

Lecturer: Nguyen-Son Vo (Ph.D), email: vonguyenson@gmail.com

1/37
Contents
5.1 General considerations

5.2 Design of FIR filter

5.3 Design of IIR filter from analog filters

5.4 Freq. transformations

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 |  | 

• The impulse res. of this filter is


 c
  , n  0
h( n)  
 c sin c n , n  0
  c n
4/37
5.1 General considerations
 Causality & its implications
• But non-causal and thus cannot be realized in practice

Matlab: Ch_5_Ideal_Lowpass_Filter.m 5/37


5.1 General considerations
 Causality & its implications
• What are the necessary & sufficient conditions that H()
must satisfy to ensure the resulting filter to be causal?
 Paley-Wiener theorem
• Paley-Wiener theorem
If h(n) has finite energy & h(n) = 0 for n < 0, then

 ln H ( ) d   


Conversely, if |H()| is square-integrable the above integral is


finite, the resulting filter with H() = |H()|ej() is causal
6/37
5.1 General considerations
 Causality & its implications
• Limit to LTI sys. specified by difference equation in practice
N M 1
y (n)    ak y (n  k )   bk x(n  k )
k 1 k 0
M 1
 bk e j k
k 0
H ( )  N
1   ak e j k
k 1
 Causal & physically realizable
 Approximate any of the ideal freq. response characteristics
by properly selecting ak, bk, M, & N
7/37
5.1 General considerations
 Characteristics of practical freq.-selective filters

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

 It is a polynomial of degree M – 1 in the variable z-1


 The roots of this polynomial yield the zeros of the filter
9/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

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

H ( z )  h(0)  h(1) z 1  h(2) z 2  ...  h( M  1) z ( M 1)

 ( 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)

• If z1 is a root or a zero of H(z), the 1/ z1 is also a root


• If z1 is a complex-valued root, z1* is also a root, H(z) also has
a zero at 1/ z1*
13/37
5.2 Design of FIR filters
 Symmetric & anti-symmetric FIR filters
• When h(n) = h(M – 1 – n)

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

• hd(n), which is infinite, must be truncated at n = M – 1, to


yield an FIR filter of length M
• To do so, we multiply hd(n) by a “”rectangular window
1, n  0,1,..., M  1
w(n)  
0, otherwise
17/37
5.2 Design of FIR filters
 Design of linear-phase FIR filters using windows
• So, the unit response of the FIR filter becomes
hd (n), n  0,1,..., M  1
h(n)  hd (n) w(n)  
0, otherwise
• It is easy to derive the Fourier transform of w(n)
M 1
1  e j M sin( M / 2)  j ( M 1)/2
W ( )  e  j n

1  e j

sin( / 2)
e
n 0

sin( M / 2)  ( M  1) / 2,sin( M / 2)  0


W ( )  and ( )  
sin( / 2)  ( M  1) / 2   ,sin( M / 2)  0
18/37
5.2 Design of FIR filters
 Design of linear-phase FIR filters using windows
• Freq. res. of rectangular window

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]

Clearly, hd(n) is noncausal & infinite in duration


20/37
5.2 Design of FIR filters
 Design of linear-phase FIR filters using windows
Limit hd(n) by w(n) we have
sin c [n  ( M  1) / 2]
h( n)  , 0  n  M  1, n  ( M  1) / 2
 [n  ( M  1) / 2]
 M  1  c
If M is odd, the value of h(n) at n = (M – 1)/2 is h  
 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

When  = 0, they reduce to DFT & IDFT


Now, if we sample H() by  k = 2(k + )/M in slides 14 & 15,
we have
 2 
H (k   )  H r  (k   )  e j[  /2 2 ( k  )(M 1)/2 M ]
M 

where  = 0 when h(n) is sym. &  = 1 when h(n) is anti-sym.


23/37
5.2 Design of FIR filters
 Design of linear-phase FIR filters by freq.-sampling
If we further define
 2 
G (k   )  (1) H r 
k
(k   )  , k  0,1,..., M  1
M 
Then
 2  j[  /2 2 ( k  )( M 1)/2 M ]
H (k   )  H r  (k   )  e
M 
 G (k   )e j k e j[  /2 2 ( k  )( M 1)/2 M ]
Finally, h(n) can be obtained in 4 cases, i.e.,  = 0,  = 1/2,  =
0, &  = 1, by substituting H(k + ) to the eq. in slide 23
Detail results can be referred to Table 10.3
24/37
5.2 Design of FIR filters
 Design of linear-phase FIR filters by freq.-sampling

Can
we
design
a passband
Filter?

Matlab: Ch_5_Ex_5_2.m 25/37


5.2 Design of FIR filters
 Design of …

Read at home… 26/37


5.3 Design of IIR filters from analog filters
 Techniques
• There are several methods used to design digital filter (DF)
having an infinite-duration unit sample response
• AF design is a mature & well-developed field
• Design a AF and then convert the design into the DF
• An analog filter can be described by its system function

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 z1 )/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

where {k} are a set of parameters that can be selected to


optimize the approximation
31/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 z1 )/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

where {k} are a set of parameters that can be selected to


optimize the approximation
32/37
5.3 Design of IIR filters from analog filters
 IIR filter design by approximation of derivatives
• The resulting mapping between s-plane & z-plane is now

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

• Given an AF, we can convert it to a DF by the relationship


between s & z

33/37
5.3 Design of IIR filters from analog filters
 IIR filter designs by …

Read at home… 34/37


5.4 Freq. transformations
 To convert LPF to X-PF

Read at home… 35/37


5.5 Summary

Filter using window

FIR filter

IIR (s2z)

Others (further read at home)

Using Matlab to design FIR filter

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)

DO NOT COPY FROM EACH OTHER!


37/37

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy