Академический Документы
Профессиональный Документы
Культура Документы
1
Digital Filter Specifications
Digital Filter Specifications
• ω p - passband edge frequency
• ω s - stopband edge frequency • Specifications are often given in terms of
• δ p - peak ripple value in the passband loss function G (ω ) = − 20 log10 G (e jω ) in dB
• δ s - peak ripple value in the stopband • Peak passband ripple
• Since G (e jω ) is a periodic function of ω, α p = − 20 log10 (1 − δ p ) dB
and G (e jω ) of a real-coefficient digital • Minimum stopband attenuation
filter is an even function of ω α s = − 20 log10 (δ s ) dB
• As a result, filter specifications are given
only for the frequency range 0 ≤ ω ≤ π
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
2
Selection of Filter Type
Digital Filter Specifications • The transfer function H(z) meeting the
frequency response specifications should be
• Example - Let Fp = 7 kHz, Fs = 3 kHz, and a causal transfer function
FT = 25 kHz • For IIR digital filter design, the IIR transfer
• Then function is a real rational function of z −1:
2π (7 × 103 )
ωp = = 0.56π p0 + p1 z −1 + p2 z −2 + L + pM z − M
25 × 103 H ( z) =
d 0 + d1z −1 + d 2 z −2 + L + d N z − N
2π (3 × 103 )
ωs = = 0.24π • H(z) must be a stable transfer function and
25 × 103 must be of lowest order N for reduced
computational complexity
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
3
Digital Filter Design: Digital Filter Design:
Basic Approaches Basic Approaches
• An analog transfer function to be denoted as • Basic idea behind the conversion of H a (s )
into G ( z ) is to apply a mapping from the
P (s)
H a (s) = a s-domain to the z-domain so that essential
Da ( s ) properties of the analog frequency response
where the subscript “a” specifically are preserved
indicates the analog domain • Thus mapping function should be such that
• A digital transfer function derived from H a (s ) – Imaginary ( jΩ ) axis in the s-plane be
shall be denoted as mapped onto the unit circle of the z-plane
P( z )
G( z) = – A stable analog transfer function be mapped
D( z ) into a stable digital transfer function
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
4
Bilinear Transformation
• Inverse bilinear transformation for T = 2 is Bilinear Transformation
z = 1+ s
1− s • Mapping of s-plane into the z-plane
• For s = σo + jΩo
(1 + σ o ) + jΩ o 2 (1 + σ o ) 2 + Ωo2
z= Þz =
(1 − σ o ) − jΩo (1 − σ o ) 2 + Ω 2o
• Thus, σo = 0 → z =1
σo < 0 → z <1
σo > 0 → z >1
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
5
IIR Digital Filter Design Using
Bilinear Transformation IIR Digital Filter Design Using
• Example - Consider Bilinear Transformation
Ωc • Rearranging terms we get
H a (s) =
s + Ωc −1
G ( z ) = 1 − α ⋅ 1 + z −1
• Applying bilinear transformation to the above 2 1−α z
we get the transfer function of a first-order where
digital lowpass Butterworth filter
1 − Ωc 1 − tan( ωc / 2)
α= =
Ωc (1 + z −1 ) 1 + Ωc 1 + tan(ωc / 2)
G ( z ) = H a ( s ) s =1− z −1 =
1+ z −1
(1 − z −1 ) + Ω c (1 + z −1 )
IIR Digital Filter Design Using IIR Digital Filter Design Using
Bilinear Transformation Bilinear Transformation
• Example - Consider the second-order analog • Then G ( z ) = H a ( s) s =1− z −1
s 2 + Ω o2 (1 + Ωo ) − 2(1 − Ωo ) z −1 + (1 + Ωo2 ) z − 2
2 2
H a ( s) = 2 =
s + B s + Ωo2 (1 + Ωo2 + B ) − 2(1 − Ωo2 ) z −1 + (1 + Ωo2 − B) z −2
−1 −2
for which H a ( jΩo ) = 0 1+ α 1 − 2β z + z
= ⋅
2 1 − 2 β (1 + α ) z −1 + α z −2
H a ( j 0) = H a ( j∞) = 1
• Ωo is called the notch frequency 1 + Ωo2 − B 1 − tan( Bw / 2)
where α = =
• If H a ( jΩ 2 ) = H a ( jΩ1 ) = 1 / 2 then 1 + Ω o2 + B 1 + tan( Bw / 2)
B = Ω 2 − Ω1 is the 3-dB notch bandwidth 1 − Ωo2
β= = cos ω o
Copyright © 2001, S. K. Mitra 1 + Ωo2 Copyright © 2001, S. K. Mitra
IIR Digital Filter Design Using IIR Digital Filter Design Using
Bilinear Transformation Bilinear Transformation
• Example - Design a 2nd-order digital notch • Thus
filter operating at a sampling rate of 400 Hz 0.954965 − 1.1226287 z −1 + 0.954965 z −2
with a notch frequency at 60 Hz, 3-dB notch G ( z) =
bandwidth of 6 Hz 1 − 1.1226287 z −1 + 0.90993 z −2
• The gain and phase responses are shown below
• Thus ω o = 2π (60 / 400) = 0.3π 2
Bw = 2π (6 / 400) = 0.03π 0
1
Phase, radians
-10
• From the above values we get
Gain, dB
0
-20
α = 0.90993 -30 -1
β = 0.587785 -40
0 50 100 150 200
-2
0 50 100 150 200
Frequency, Hz Frequency, Hz
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
6
IIR Lowpass Digital Filter Design IIR Lowpass Digital Filter Design
Using Bilinear Transformation Using Bilinear Transformation
• Example - Design a lowpass Butterworth • Prewarping we get
digital filter with ω p = 0.25π , ω s = 0.55π , Ω p = tan(ω p / 2) = tan(0.25π / 2) = 0.4142136
α p ≤ 0.5 dB, and α s ≥ 15 dB Ω s = tan(ω s / 2) = tan(0.55π / 2) = 1.1708496
• Thus • The inverse transition ratio is
ε 2 = 0.1220185 A2 = 31.622777 1 Ωs
= = 2.8266809
• If G (e j 0 ) = 1 this implies k Ωp
20 log10 G (e j 0.25π ) ≥ − 0.5 • The inverse discrimination ratio is
1 A2 − 1
20 log10 G (e j 0.55π ) ≤ −15 = = 15.841979
k1 ε
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
IIR Lowpass Digital Filter Design IIR Lowpass Digital Filter Design
Using Bilinear Transformation Using Bilinear Transformation
• We then get
log10 (1 / k1 ) Ω c = 1.419915 (Ω p ) = 0.588148
• Thus N= = 2.6586997
log10 (1 / k )
• 3rd-order lowpass Butterworth transfer
• We choose N = 3 function for Ω c = 1 is
• To determine Ω c we use 1
Han ( s ) =
( s + 1)( s 2 + s + 1)
2 1 1
H a ( jΩ p ) = = • Denormalizing to get Ω c = 0.588148 we
1 + (Ω p / Ω c ) 2 N 1 + ε 2
arrive at s
Ha ( s ) = Han æç ö
÷
è 0. 588148 ø
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
0.8 -10
(2) Convert frequency specifications of H D (s )
into that of prototype analog lowpass filter
Magnitude
Gain, dB
0.6
-20
0.4 H LP (s )
-30
0.2
0 -40
(3) Design analog lowpass filter H LP (s )
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π ω/π
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
7
Design of IIR Highpass,
Highpass, Bandpass,
Bandpass, Design of IIR Highpass,
Highpass, Bandpass,
Bandpass,
and Bandstop Digital Filters and Bandstop Digital Filters
(4) Convert H LP (s ) into H D (s ) using • Second Approach -
inverse frequency transformation used in (1) Prewarp digital frequency specifications
Step 2 of desired digital filter GD (z ) to arrive at
(5) Design desired digital filter GD ( z ) by frequency specifications of analog filter H D ( s )
applying bilinear transformation to H LP ( s ) of same type
(2) Convert frequency specifications of H D ( s )
into that of prototype analog lowpass filter
H LP (s )
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
IIR Highpass Digital Filter Design IIR Highpass Digital Filter Design
• Prewarping these frequencies we get • MATLAB code fragments used for the design
ˆ p = tan(ω p / 2) = 1.9626105
Ω [N, Wn] = cheb1ord(1, 1.9626105, 1, 32, ’s’)
Ωˆ s = tan(ω s / 2) = 1.0 [B, A] = cheby1(N, 1, Wn, ’s’);
• For the prototype analog lowpass filter choose [BT, AT] = lp2hp(B, A, 1.9626105);
Ωp =1 [num, den] = bilinear(BT, AT, 0.5);
Ω Ω ˆ
• Using Ω = − p p we get Ω s = 1.962105 0
Ωˆ -10
-20
-30
Ω s = 1.926105 , α p = 1 dB, α s = 32 dB -40
-50
0 0.2 0.4 0.6 0.8 1
ω/π
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
8
IIR Bandpass Digital Filter Design IIR Bandpass Digital Filter Design
• Design of a Butterworth IIR digital bandpass • Width of passband Bw = Ω ˆ p2 − Ωˆ p1 = 0.777771
filter
ˆ o2 = Ω
Ω ˆ p1Ωˆ p 2 = 1.393733
• Specifications: ω p1 = 0.45π , ω p 2 = 0.65π ,
ˆ s1Ω
Ω ˆ s 2 = 1.23010325 ≠ Ω ˆ o2
ω s1 = 0.3π , ω s 2 = 0.75π , α p = 1 dB, α s = 40 dB ˆ s1and
• We therefore modify Ω s1 so that Ω
ˆ
• Prewarping we get Ωˆ s 2 exhibit geometric symmetry with
ˆ p1 = tan(ω p1 / 2) = 0.8540807
Ω respect to Ω ˆ o2
ˆ p 2 = tan(ω p 2 / 2) = 1.6318517
Ω • We set Ω ˆ s1 = 0.5773031
Ωˆ s1 = tan(ω s1 / 2) = 0.5095254 • For the prototype analog lowpass filter we
ˆ choose Ω p = 1
Ω s 2 = tan(ω s 2 / 2) = 2.41421356
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
IIR Bandpass Digital Filter Design IIR Bandpass Digital Filter Design
ˆ2 ˆ2 • MATLAB code fragments used for the design
• Using Ω = −Ω p Ωo − Ω we get [N, Wn] = buttord(1, 2.3617627, 1, 40, ’s’)
ˆ Bw
Ω
[B, A] = butter(N, Wn, ’s’);
1.393733 − 0.3332788 [BT, AT] = lp2bp(B, A, 1.1805647, 0.777771);
Ωs = = 2.3617627
0.5773031× 0.777771 [num, den] = bilinear(BT, AT, 0.5);
• Specifications of prototype analog 0
Ω p = 1 , Ω s = 2.3617627 , α p = 1 dB,
-20
-30
α s = 40 dB -40
-50
0 0.2 0.4 0.6 0.8 1
ω/π
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
IIR Bandstop Digital Filter Design IIR Bandstop Digital Filter Design
• Design of an elliptic IIR digital bandstop filter • We therefore modify Ω ˆ p1and Ω
ˆ p1so that Ω ˆ p2
• Specifications: ω s1 = 0.45π , ω s 2 = 0.65π , exhibit geometric symmetry with respect to
ω p1 = 0.3π, ω p 2 = 0.75π , α p = 1 dB, α s = 40 dB Ωˆ o2
• Prewarping we get • We set Ω ˆ p1 = 0.577303
Ωˆ s1 = 0.8540806, Ω ˆ s 2 = 1.6318517, • For the prototype analog lowpass filter we
ˆ p1 = 0.5095254, Ω
Ω ˆ p 2 = 2.4142136 choose Ω s = 1
ΩˆB
• Width of stopband Bw = Ω ˆ s2 − Ωˆ s1 = 0.777771 • Using Ω = Ω s 2 w 2 we get
ˆ o −Ω
Ω ˆ
Ωˆ o2 = Ωˆ s 2Ω
ˆ s1 = 1.393733 0.5095254 × 0.777771
ˆ p 2Ω ˆ p1 = 1.230103 ≠ Ω ˆ o2 Ωp = = 0.4234126
Ω 1.393733 − 0.3332787
Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra
9
IIR Bandstop Digital Filter Design
• MATLAB code fragments used for the design
[N, Wn] = ellipord(0.4234126, 1, 1, 40, ’s’);
[B, A] = ellip(N, 1, 40, Wn, ’s’);
[BT, AT] = lp2bs(B, A, 1.1805647, 0.777771);
[num, den] = bilinear(BT, AT, 0.5);
0
-10
Gain, dB
-20
-30
-40
-50
0 0.2 0.4 0.6 0.8 1
ω/π
Copyright © 2001, S. K. Mitra
10