digital controls & digital filters lectures 21 & 22 21-22.pdfanalog filter design digital...
TRANSCRIPT
Analog Filter Design Digital Filter Design
Digital Controls & Digital FiltersLectures 21 & 22
M.R. Azimi, Professor
Department of Electrical and Computer EngineeringColorado State University
Spring 2015
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Review of Analog Filters-Cont.
Types of Analog Filters:
1 Butterworth
2 Chebyshev
3 Elliptic (Cauer)
4 Bessel
Narrower Transition: (1) Elliptic, (2) Chebyshev, (3) Butterworth, (4) Bessel
More linear phase over PB: (1) Bessel, (2) Butterworth, (3) Chebyshev, (4) Elliptic
The first three filters have a common form of magnitude-squared function:
AN (ω2) = 11+F (ω2)
ω = ωωc
: Normalized frequency (ωc: Cutoff frequency )
1. Low-pass Butterworth Filters
Maximally flat passband region
All-pole filter
For sharp cutoff, order must be large
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Butterworth Filters
Here F (ω2) = ω2n and n: order
or AN (ω2) = 1
1+(
ωωc
)2n
ω = 0 =⇒ AN (0) = 1ω = ωc =⇒ AN (ω2
c ) = 12
ω large =⇒ AN (ω2) ≈ 0
Changing jω → s in AN (ω2) gives,
AN (−s2) = 1
1+(
sjωc
)2n
Now, to find pole locations of this filter
1 +(
sjωc
)2n
= 0 =⇒ sk = (−1)1/2njωc
But, using (−1)1/N = ej(2k−1)π/N , k ∈ [0, N − 1], we get
sk = ej(2k−1)π/2njωc = sin (2k−1)π2n
+ j cos (2k−1)π2n
jωc, k ∈ [0, 2n− 1]There are n LH poles and n RH poles. The LH poles are the ones chosen according tothe spectral factorization (or use tables).
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Butterworth Filters-Cont.
Disadvantages:
1 Wide transition region (for low order filters).
2 Accuracy of approximation cannot be uniformly distributed in PB and SB regions.
Example:Design a Butterworth LPF, HA(s), that has attenuation of at least 10dB at ω = 2ωcwhere ωc = 2.5× 103
AN (ω2) = 11+ω2n
AN (22) = 11+22n
−10 log10 |AN (22)| ≥ 10 =⇒ (1 + 22n) ≥ 10 =⇒ n = 1.58 =⇒ n = 2
From table: HN (s) = 1s2+1.414s+1
Denormalize, s→ s/ωc
HA(s) = HN ( sωc
) = 11.6×10−7s2+5.657×10−4s+1
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Butterworth Filters-Cont.
Short-Cut Method:
The required filter order for providing a magnitude of 1/A (not in dB) at frequency ωcan be obtained using,
n = log10(A2−1)
2 log10( ωωc
)
For previous example,
−20 log10 1/A = 10 dB =⇒ A = 3.3
n = log10(3.32−1)
2 log10 2= 1.653 =⇒ n = 2
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Review of Analog Filters-Cont.
2. Lowpass Chebyshev Filters
Sharper cutoff or narrower transition region.
Magnitude of error is equiripple over the passband (Type I) or over the stopband(Type II).
Type I Chebyshev: Magnitude-squared function is given byAN (ω2) = |HN (jω)|2 = 1
1+F (ω2)
where F (ω2) = ε2C2n(ω)
ε: Ripple factor (determines ripple in passband)Cn(ω): nth order Chebyshev polynomialCn(ω) = cos (n cos−1 ω) for 0 ≤ ω ≤ 1 (passband)Cn(ω) = cosh (n cosh−1 ω) for ω > 1 (stopband)For any n, 0 ≤ |CN (ω)| ≤ 1 for 0 ≤ ω ≤ 1
|CN (ω)| > 1 for ω > 1n = 1 =⇒ C1(ω) = ωn = 2 =⇒ C2(ω) = 2ω2 − 1n = 3 =⇒ C3(ω) = 4ω3 − 3ω...i.e. Cn(ω) is an odd/even polynomial when n is odd/even.
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Chebyshev Filters-Cont.
Chebyshev polynomials can be generated recursively using,
Cn+1(ω) + Cn−1(ω) = 2ωCn(ω)
For n : even, C2n(0) = 1 =⇒ A(0) = 1
1+ε2
For n : odd, C2n(0) = 0 =⇒ A(0) = 1
max |HN (jω)| = Amax = 1: Max gain in passbandmin |HN (jω)| = Amin = 1√
1+ε2: Min gain in passband
Define:rdB = 20 log10
AmaxAmin
= 10 log10 (1 + ε2) : Loss in passband
r(peak-to-peak) = Amax −Amin = 1− 1√1+ε2
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Chebyshev Filters-Cont.
To find pole locations of the Chebyshev filter, change ω = s/j and set thedenominator to zero,
1 + ε2C2n(s/j) = 0 =⇒ cos (n cos−1( s
j)) = ± j
ε
But, using sk = σk + jωk, we get
σk = − sinhϕ sin[ (2k−1)π2n
] k ∈ [0, 2n− 1]
ωk = coshϕ cos[ (2k−1)π2n
] k ∈ [0, 2n− 1]
wheresinhϕ = γ−γ−1
2, coshϕ = γ+γ−1
2, and
γ = (1+√
1+ε2
ε)1/n.
It is interesting to note that from equations for σk and ωk, we have,
σ2k
sinh2 ϕ+
ω2k
cosh2 ϕ= 1
i.e. the poles are located on an ellipse in the s-plane.
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Chebyshev Filters-Cont.
Example:
Design a Chebyshev Type I filter with 1dB ripple in passband and attenuation of atleast 20dB at ω = 2ωc, fc = 3kHz.
r = 10 log10 (1 + ε2) = 1 =⇒ ε = .05088
−10 log101
1+ε2C2n(2)≥ 20
Since in stopband, ε2C2n(2) 1
Thus,10 log10 ε
2 + 10 log10 C2n(2) ≥ 20
log10 [cosh(n cosh−1 2)] ≥ 1− log10 ε = 1.2935 =⇒ n cosh−1 2 ≥ 3.67
or n ≥ 2.8 =⇒ n = 3
Use Table 11.4 (for r = 1dB)
HN (s) = 0.4913s3+0.9883s2+1.2384s+0.4913
Denormalize: ωc = 2π × 3× 103 = 6π × 103Rad/Sec
s→ sωc
HA(s) = 0.49131.493×10−13s3+2.78×10−9s2+6.569×10−5s+0.4913
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Review of Analog Filters-Cont.
Short-Cut Method:If the magnitude of minimum stopband loss is 1/A at frequency ωr, then the order can
be found using n =log10(g+
√g2−1)
log10(ωr+√ω2r−1)
where g =√
A2−1ε2
3. Elliptic Filters:Characteristics are:
1 Equiripple both in passband and stopband.
2 Excellent transition region.
The magnitude-squared function for elliptic filters is:
A(ω2) = 11+ε2R2
n(ω,κ1)
Rn(ω, κ1) : Chebyshev rational function with roots that are related to Jacobi ellipticfunctions hence called elliptic filters.κ1 , ε/
√A2 − 1: selectivity factor
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Elliptic Filters
Define transition ratio p = ωcωr
. Then the order of the elliptic filter to meet ε, A (asdefined before) and ωc, ωr specs is:
n =K(p)K(
√1−κ2
1)
K(κ1)K(√
1−p2)
K(.): Complete elliptic integral of the 1st kind,
K(x) =1
0
1
(1−t2)1/2(1−xt2)1/2dt
Remarks:
1 In this filter, ε (ripple factor) determines the passband ripple, while thecombination of ε and κ1 specify the stopband ripple.
2 To obtain equiripple in both passband and stopband elliptic filters must havepoles on jω axis.
3 When κ1 →∞ the elliptic rational function becomes a Chebyshev polynomial,and therefore the filter becomes a Chebyshev Type I filter, with ripple factor ε.
Disadvantages:
1 Nonlinear phase characteristics.
2 Delay varies with frequency.
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Review of Analog Filters-Cont.
4. Bessel Filters:
Excellent phase characteristic (nearly linear).
Wide transition region (disadvantage).
Cutoff Frequency changes as function of n (disadvantage).
All-pole filter with transfer function,HA(s) = d0
Bn(s)
where Bn(s): nth order Bessel Polynomial
Bn(s) =n∑i=0
disi
di = (2n−i)!2n−ii!(n−i)! , i ∈ [0, n]
Bessel polynomials satisfy, Bn(s) = (2n− 1)Bn−1(s) + s2Bn−2(s)
with B0(s) = 0, B1(s) = s+ 1
Cutoff Frequency varies as function of order n, ωc ≈ d1/n0
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Recursive Digital Filter Design Using Bilinear z-Mapping
Idea: Analog systems are implemented using integrators, multipliers, and adders. Mapevery integrator HI(s) = 1/s (or hI(t) = us(t)) to the digital domain.
Convolution integral: y(t) =t
0
x(τ)hI(t− τ)dτ
Let 0 < t1 < t2, then
y(t2) =t2
0
x(τ)hI(t− τ)dτ
y(t1) =t1
0
x(τ)hI(t− τ)dτ
y(t2)− y(t1) =t2
t1
x(τ)dτ =Area
≈ (t2−t1)2
[x(t1) + x(t2)] Trapezoidal rule of integration.
Let t1 = (n− 1)T, t2 = nT
y(nT )− y((n− 1)T ) = T2
[x((n− 1)T ) + x(nT )]
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Bilinear z-Mapping-Cont.
Take z-transform:
Y (z)− z−1Y (z) = T2
[z−1X(z) +X(z)]
HI(z) = Y (z)X(z)
= T2
(1+z−1)
1−z−1 = T2z+1z−1
Thus the mapping from s-domain to z-domain is:
1/s→ T2
(z+1)(z−1)
s→ 2T
(1−z−1)
(1+z−1): Bilinear z-mapping
Once HA(s) prototype is described:
HD(z) = HA(s)|s= 2
T(1−z−1)
(1+z−1)
Properties of Bilinear z-Mapping:
Recall: s = 2T
(z−1)z+1)
or z = 2/T+s2/T−s
Also z = rejΩ, and s = σ + jω which gives
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Bilinear z-Mapping-Properties
rejΩ = (2/T+σ)+jω(2/T−σ)−jω
Then equations for r and Ω become,
r =[
(2/T+σ)2+ω2
(2/T−σ)2+ω2
]1/2
Ω = tan−1 ω2T +σ
+ tan−1 ω2T −σ
Right half of s-plane: σ > 0 =⇒ r > 1: outside unit circle
On jω axis: σ = 0 =⇒ r = 1: on unit circle
Left half of s-plane: σ < 0 =⇒ r < 1: inside the unit circle
=⇒ Stable HA(s) is mapped to stable HD(z).
Additionally, it is obvious that HD(z) will have real coefficients. However, thereis an issue with this mapping called warping.
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Bilinear z-Mapping-Warping Effects
For simplicity, let σ = 0 in equation of Ω,
Ω = 2 tan−1 ω2/T = 2 tan−1 ωT
2
or ω = 2T tan Ω
2 : Nonlinear relation between Ω, ω
Let Ω = ΩT (Normalized Ω)
ω = 2T tan ΩT
2
When ΩT2 < 0.15, tan ΩT
2 ≈ΩT2 =⇒ ω ≈ Ω
i.e. approximately linear portion of tangent curve.
Thus, If all essential frequencies (ωc, ωr) are below Ω = 0.3T , no prewarping is
needed since minimal warping effects and ω ≈ Ω.
If not, prewarp the analog filter before bilinear z-mapping.
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Bilinear z-Mapping-Warping Effects
Note: Warping affects both magnitude and phase responses. Although, the amplitudedistortion caused by warping can be remedied by prewarping, little can be done tolinearize the phase except maybe using equalization methods.
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Bilinear z-Mapping-Prewarping
Procedure:If all essential frequencies are above Ω = 0.3
T, then
1 Map all essential digital frequencies Ωi to corresponding analog frequencies using
ωi = 2T
tan ΩiT2
2 Design HA(s) using these analog frequencies ωi’s.
3 Map HA(s) to HD(z) using Bilinear z-mapping.
Example:
Design a digital Butterworth filter that meets:
1 T = 50 µ sec.
2 fc = 4 kHz or Ωc = 25.13× 103 Rad/sec
3 At 2Ωc attenuation is ≥ 15dB
Since Ωc 0.3T≈ 6000 =⇒ Prewaring is needed
We prewarp both Ωc and 2Ωc, using
M.R. Azimi Digital Control & Digital Filters
Analog Filter Design Digital Filter Design
Bilinear z-Mapping-Cont.
ωc = 2T
tan ΩcT2≈ 29.1× 103 Rad/sec
ω15dB = 2T
tan 2ΩcT2
= 123.1× 103 Rad/sec
We now use these frequencies to design HA(s)
|HA(jω)|2 = 1
1+(
ωωc
)2n
−10 log10
∣∣∣∣ 1
1+( 123.129.1 )2n
∣∣∣∣ ≥ 15dB =⇒ n ≥ 1.2 =⇒ n = 2
From Table 11.2:
HN (s) = 1s2+1.4142s+1
Denormalize s→ s/ωc
HA(s) = (29×103)2
s2+41.15×103s+(29×103)2
HD(z) = HA(s)|s= 2
T1−z−1
1+z−1
= 2.117+4.234z−1+2.117z−2
10.232−3.766z−1+2.002z−2
M.R. Azimi Digital Control & Digital Filters