CHAPTER 7 Digital Filter Design

advertisement
CHAPTER 7
Digital Filter Design
Wang Weilian
wlwang@ynu.edu.cn
School of Information Science and Technology
Yunnan University
Outline
• About Digital Filter Design
• Bilinear Transformation Method of IIR Filter Design
• Design of Lowpass IIR Digital Filters
• Design of Hignpass, Bandpass, and Bandstop IIR Digital
Filter
• FIR Filter Design Based on Windowed Fourier Series
• Computer-Aided Design of Digital Filters
• Digital Filter Design Using MATLAB
About Digital Filter Design
•
The most important step in the development of a digital filter :Determine a
realizable transfer function G(z)
•
Digital Filter Specifications
(1) magnitude response specifications in the passband and the stopband
are given with some acceptable tolerances
(2) A transition band is specified between the passband and the stopband
to permit the magnitude to drop off smoothly
About Digital Filter Design
About Digital Filter Design
• Passband edge frequency
• Stopband edge frequency
p
s
• Peak ripple value of passband
• Peak ripple value of stopband
• Peak passband ripple
p
• Minimum stopband attenuation
• Sample frequency
FT
p
s
s
About Digital Filter Design
 P  20 log 10 (1   P )dB
 S  20 log 10 ( s )dB
 P  1  10
 S  10
 P / 20
 S / 20
P 
P
FT
S 
S
FT

2FP
FT

2FS
FT
About Digital Filter Design
• Selection of the Filter Type
(1)The objective of digital filter design is to develop a causal
transfer function H(z) meeting the frequncy specifications.
(2)FIR and IIR Digital Filter
N
FIR Digital Filter
H ( z )   h[ n] z
n
n0
IIR Digital Filter
H ( z) 
p0  p1 z 1  p2 z 2  pM z  M
d 0  d1 z 1  d 2 z 2  d N z  N
About Digital Filter Design
FIR
IIR
Impulse Response
finite
infinite
System Function
H(z)=P(z)
H(z)=P(z)/D(z)
Structure diagram
Have feedback
No feedback
Phase response
Exact linear phase
________________
h[n]= ±h[n-N]
Zero-poles
Only have zeros
Both zeros and poles
About Digital Filter Design
The order NFIR of an FIR filter is higher than the
order NIIR of an equivalent IIR filter meeting the
same magnitude specifications
The ratio NFIR/ NIIRis typically of the order of 10 or
more (the IIR filter usually is computationally
more efficient)
About Digital Filter Design
• Basic Approaches to Digital Filter Design
Step1:convert the digital filter specifications into
analog lowpass prototype filter specifications
Step2:determine the analog lowpass filter transfer
function Ha(s)
Step3:transform Ha(s) into the desired digital filter
transfer function G(z)
About Digital Filter Design
• Why analog?
(1)Analog approximation techniques are highly
advanced
(2)They usually yield closed-form solutions
(3)Extensive tables are available for analog filter
design
(4)Many applications require the digital simulation
of analog filters
About Digital Filter Design
• How to convert an analog prototype transfer function Ha(s)
into a digital IIR transfer function G(z)?
(1)the imaginary(j ) axisin the s-plane be mapped onto the unit
circle of the z-plane
(2)A stable analog transfer functon be transformed into a stable
digital transfer function
About Digital Filter Design
• Estimation of the Filter Order
IIR: The order of G(z) is determined from the transformation
being used to convert Ha(s) into G(z)(The determination of
Ha(s) is refered to Eq.(5.33),(5.41),or(5.51)
FIR(lowpass digital filter):
For narrowband filter
For wideband filter
N
20 log10 (  p s ) 13
N
 20 log10 ( s )  0.22
( s  p ) / 2
N
 20 log10 ( p )  5.94
27 ( s  p ) / 2
14.6 ( s  p ) / 2
Bilinear Transformation Method of IIR Filter
Design
• Bilinear transformation is more commonly used to design
IIR digital filters based on the conversion of analog
prototype filters
• The Bilinear Transformation
S-plane to z-plane
G(z)= Ha(s) |
s (
2
T
1 z 1
1 z 1
)
The transformation is a one-to-one mapping. It maps a
single point in the s-plane to a unique point in the z-plane
Bilinear Transformation Method of IIR Filter
Design
Bilinear Transformation Method of IIR Filter
Design
Bilinear Transformation Method of IIR Filter
Design
• Digital filter design procedure:
Step1 the invert bilinear transformation is applied
to the digital filter specifications to arrive at the
specifications of the analog filter function
Step2 the bilinear transformation is employed to obtain the
desired digital transfer function G(z) from the analog
transfer function Ha(s) desired to meet the analog filter
specifications
Bilinear Transformation Method of IIR Filter
Design
•
When T=2(T has no effect on the G(z))
z
s  j0
1 s
1 s
z
1 j 0
1 j 0
s   0  j0
z
0  0
If  0 >0
If
(1 0 )  j 0
(1 0 )  j 0
then
then
z
z
<1
>1
(1 0 ) 2  ( 0 ) 2
z  (1
2
2
2
)

(

)
0
0
Bilinear Transformation Method of IIR Filter
Design
• When
s  j
j 
and
z  e j
 j
1 e
1 e j
 j tan( )
  tan( 2 )


2
Bilinear Transformation Method of IIR Filter
Design
•
Design of Digital IIR Notch Filters
Example
a second-order IIR notch filter
H ( s) 
Analog transfer function:
Applying a bilinear transformation :
s 2   02
s 2  Bs   02
(1 02 )  2 (102 ) z 1  (1 02 ) z 2
G( z )  (12  B )2(12 ) z 1 (12  B ) z 2
0
Rewrite it:
G( z) 
(1 )  2  (1 ) z 1  (1 ) z 2
2[1  (1 ) z 1 z 2 ]
B
  11 tan(
tan( B
/ 2)
w / 2)
w
  cos 0
Notch frequency
0
Notch bandwidth
Bw
0
0
Design of Lowpass IIR Digital Filters
• Steps of designing a lowpass IIR digital filter
Step1: get the digital filter specifications(
 p  s  p s
Step2: convert to analog filter specifications with bilineat
transformation
Step3: design analog transfer function Ha(s)
Step4: transfer Ha(s) to H(z) since
s (
2
T
1 z 1
1 z 1
)
)
Design of Lowpass IIR Digital Filters
• Example
 with a passband ripple pof
Passband edge frequency  is 0.25
p
0.5dB
Stopband edge frequency
 sis 0.55  with a stopband attenuation
 s of 15dB
Then
 p  tan(
p
2
)  tan( 0.252  )  0.4142136
s
 s  tan( 2 )  tan( 0.552  )  1.1708496
1
k

p
s
 10..1708496
4142135  2.8266809
Design of Lowpass IIR Digital Filters
• From the passband ripple of 0.5dB obtaining
 2  0.1220185
From the stopband attenuation of 15dB obtaining
Then
1
K1

N
since
 15.841979
A2 1

log(1 / k )
log(1 / k )
2
 2.6586997  N  3
H a ( j p )  1 ( 
1
2N
p / c )
H a ( j s )  1 (  1
2
then we get
s / c
)
2N
c  1.419915( p )
 11 2

1
A2
A2  310622777
Design of Lowpass IIR Digital Filters
The transfer function of third-order lowpass Butterworth is
H an ( s)  ( s 1)( s12  s 1)
Then we can get
s
H a ( s)  H an ( 0.588148
)
0.203451
( s  0.588148)( s 2  0.588148s  0.345918)
G ( z )  H a ( s) |s (1 z 1 ) /(1 z 1 ) 
0.0662272(1 z 1 ) 3
(1 0.2593284z 1 )(1 0.6762858z 1  0.3917468z 2 )
Design of Highpass, Bandpass, and
Bandstop IIR Digital Filters
• To design IIR filters there are two approches can be followed
• First approch:
Step1: prewarp the digital frequency specifications to arrive at
the specifications of an analog filter of the same type.
j 
1 e  j
1 e j
  tan( 2 )

 j tan( 2 )

Design of Highpass, Bandpass, and
Bandstop IIR Digital Filters
• Step2: convert the frequency specifications of HD(s) into that of a
prototype analog lowpass filter HLP(S)
s  F ( sˆ)
H D ( sˆ)  H LP ( s ) |s  F ( sˆ )
H LP ( s )  H D ( sˆ) |sˆ  F 1 ( S )
( s is the Laplace transform variable of the prototype analog
lowpass filter HLP(S) and is the Laplace transform variable of
the desired analog filterH D (sˆ)
sˆ
Design of Highpass, Bandpass, and
Bandstop IIR Digital Filters
• Step3: Design the analog lowpass filter HLP(S) using the
method described in Section 5.4
• Step4: convert the transfer function HLP(S) into HD(S) using
the inverse of the frequency transformation used in step2
• Transform the transfer function HD(S) using the bilinear
transformation to arrive at the desired digital IIR transfer
function GD (Z)
s (
2
T
1 z 1
1 z 1
)
Design of Highpass, Bandpass, and
Bandstop IIR Digital Filters
• The second approach:
Step1: prewarp the digital frequency specifications to arrive at
the specifications of an analog filter of the same type.
j 
1 e  j
1 e j
 j tan( 2 )
  tan( 2 )

Design of Highpass, Bandpass, and
Bandstop IIR Digital Filters
• Step2: convert the frequency specifications of HD(s) into
that of a prototype analog lowpass filter HLP(S)
s  F ( sˆ)
H D ( sˆ)  H LP ( s ) |s  F ( sˆ )
H LP ( s )  H D ( sˆ) |sˆ  F 1 ( S )
( s is the Laplace transform variable of the prototype analog
lowpass filter HLP(S) and is the Laplace transform variable
of the desired analog filter H (sˆ))
sˆ
D
Design of Highpass, Bandpass, and
Bandstop IIR Digital Filters
• Step3: Design the analog lowpass filter HLP(S) using the method
described in Section 5.4
• Step4: convert the transfer function HLP(S) into the transfer
function GLP(Z) of an IIR digital filter using the bilinear
transformation
s (
2
T
1 z 1
1 z 1
)
• Step5: transform GLP(Z) into the desired digital transfer function
GD(z) using the appropriate spectral transformation discussed in
Section 7.5
Design of Highpass, Bandpass, and
Bandstop IIR Digital Filters
• The functions we usually used in Matlab
lp2hp: transform the lowpass analog filter to
highpass analog filter
lp2bp:
transform the lowpass analog filter to
bandpass analog filter
lp2bs :
transform the lowpass analog filter to
bandstop analog filter
Download