University of California Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences Professors : N.Morgan / B.Gold EE225D Digital Filters Spring,1999 Lecture 7 N.MORGAN / B.GOLD LECTURE 7 7.1
1. Example of inverse z-transform use. - Let input be un ( ) and filter be yn ( ) = ay( n 1) + xn ( ) Xz ( ) = xn ( )z 1 n = 0 xn ( ) = un ( ) n Yz ( ) = 1 ---------------- 1 az 1 so y( n) = 1 ------- z n 1 dz 2πj ( ----------------------------------------- 1 z 1 )( 1 az 1 ) Basic theorem 1 ------- z n 1 dz 2πj ---------------- = a n for n 0 1 az 1 = 0 for n < 0 This allows computation of the integral to be This result can be proved by iteration. yn ( ) 1 a = ----------------- n + 1 n 0 1 a N.MORGAN / B.GOLD LECTURE 7 7.2
2. Steady state respond to a complex exponential e jwn un ( ) n yn ( ) = hm ( )xn ( m) = m = 0 n xm ( )hn ( m) m = 0 If x( n) = e jwn un ( ), then y( n) from above is n m = 0 n yn ( ) = hm ( )e jw( n m) = e jwn hm ( )e jwm m = 0 m = 0 m = n + 1 n m = 0 =, so yn ( ) = e jwn hm ( )e jwn m = 0 Steady state value of y( n) = e jwn [ Hz ( )] jw z e = m = n + 1 hm ( )e jwn So the Frequency response is the value of the z-transform evaluated on the unit circle. steady state Transmit hm ( ) 0 m, thus sum 0 as n N.MORGAN / B.GOLD LECTURE 7 7.3
3. Geometric Interpretation of Steady State Frequency Response for simple first order diff equation : Hz ( ) 1 z = ---------------- = ---------- 1 az 1 z a Unit circle e f Hz ( ) at z = e jw is e f - ω General Rule Given a collection of poles and zeros in the complex z-plane, the Frequency response at any W N is --- where N is the product of D all vectors to the zeros and D is the product of all vectors to the poles. [special rules apply for multiple pole and zeros.] N.MORGAN / B.GOLD LECTURE 7 7.4
Preview of the Rest of the Material 1. Filtering concepts. - approximate problem 2. Sampling and Impulse Invariance 3. Bilinear Transformation 4. The DFT 5. Circular Convolution and Linear Convolution 6. Basic FFT Concept. 7. DFT s and Filter Banks N.MORGAN / B.GOLD LECTURE 7 7.5
5. Approximation Problem Example of Ideal Filters Important Point Linear Analog filters of R, L, C must have frequency responses that are rational functions in ω. Similary, linear digital filter must have rational functions in e jω A( ω) ω C ω C ω Ideal low pass Ideal band pass ω Ideal band step ω Ideal band pass differentiator ω N.MORGAN / B.GOLD LECTURE 7 7.6
Analog designers tackle the approximation problem by specifying a REAL function on the jω axis. Example : Hjω ( ) 1 2 = ---------------------- ω 1 + ---- 2n ω c H( ω) Figure 7.1 : Butterworth Frequency Response for Different n. ω N.MORGAN / B.GOLD LECTURE 7 7.7
T( ω) ω Figure 7.2 : Chebyshev Frequency Response for n=4. N.MORGAN / B.GOLD LECTURE 7 7.8
If a suitable Hjω ( ) 2 is chosen, it can lead to a specification in the complex s-plane of Hs ( ) and this function holds true Everywhere in the s-plane. ω Let s normalize, so that γ = ----- and then let s = jγ. ω C So Hs ( )H * ( s) = ---------------------- 1 1 + ( s 2 ) n N.MORGAN / B.GOLD LECTURE 7 7.9
Hs ( )H( s) = 1 ------------ 1 s 2 n = 1 Hs ( ) H( s) Hs ( )H( s) = 1 ------------ 1 + s 4 n = 2 Hs ( )H( s) = 1 ------------ 1 s 6 n = 3 N.MORGAN / B.GOLD LECTURE 7 7.10
Figure 7.4 : Comparison of Group Delay for Four Types, A = Butterworth, B = Chebyshev, C = Elliptic, D = Bessel, for a low pass filter with a 500Hz corner frequency. N.MORGAN / B.GOLD LECTURE 7 7.11
Raders channel vocoder experiment - Butterworth filter bank yielded better results than Chebyshev. Note : Bessel and Lenner filters have good phase response and were used in Vocoders. Question : How do we construct digital filters that give good frequency responses? * Impulse Invariance - Linear analog filters have a given impulse response. ĥ() t T time N.MORGAN / B.GOLD LECTURE 7 7.12
Figure 7.16 : Aliasing Effects of Hopped FFT s. N.MORGAN / B.GOLD LECTURE 7 7.13
Construct a Digital Filter that has an impulse response that are the samples of ht (). jω hn ( ) = ĥ( nt) s 1 is real Ĥ( s) Start with a simple analog filter. s 1 α A ĥ( n) L 1 ------------- 1 A S + S 1 1 e s 1 = = t hn ( ) A 1 e s 1nT = and Hz ( ) = hn ( )z n = n = 0 A 1 --------------------- 1 e s 1 T z 1 e s T 1 N.MORGAN / B.GOLD LECTURE 7 7.14
Procedure - Find impulse response of suitable analog filter. - Sample it to find hn ( ). - Take z-transform to find transfer function Hz ( ). N.MORGAN / B.GOLD LECTURE 7 7.15
Example of Impulse Invariant Design for a Very Simple Case. R C Filter is 1 ( sc) ----------------- R 1 + ----- sc 1 = ------------------- and s 1 1 + src 1 = ------- RC Digital Filter Hz ( ) = 1 -------------------- 1 z 1 e s 1T + e s T 1 z 1 yn ( ) e s 1 = T yn ( 1) + xn ( ) e s T 1 N.MORGAN / B.GOLD LECTURE 7 7.16
Aliasing is prevented by using the bilinear transfom to find the digital filter. z 1 s ----------, z + 1 z 1 + s = ---------- 1 s When s = jω z 1 + jω = -------------- z = 1 jω axis maps into 1 jω unit circle. Stated without proof - Left half s-plane imterior of z-plane unit circle Right half s-plane exterior of z-plane unit circle. N.MORGAN / B.GOLD LECTURE 7 7.17
Simple example 1 ------------------- 1 + src ---------------------------- 1 z 1 1 + z ---------- + 1 RC z = ----------------------------------------- + 1 = Hz ( ) z + 1 + ( z 1)RC Hz ( ) = z + 1 ---------------------------------------------------- ( 1 RC) + z( 1 + RC) As ω Π, He ( jω ) 0 No Folding. 1 RC ---------------- 1 + RC For more complex filter designs, multiple zeros appear at z = 1. N.MORGAN / B.GOLD LECTURE 7 7.18
Discrete Fourier Transform Consider a finite duration sequence. Inverse X k n 1 = xn ( )W nk W = e j xn ( ) n = 0 = N 1 1 --- X k W nk N k = 0 2π ----- N Related to z-transform Related to Fourier transform Related to Laplace transform Related to Fourier Series Important parameters Size of DFT N Size of data. Window How often the DFT is done. Sampling rates. N.MORGAN / B.GOLD LECTURE 7 7.19
Table 7.1 : Relations between Sequence and its DFT ; recall that an odd sequence is antisymmetric, and an even sequence is symmetric. N.MORGAN / B.GOLD LECTURE 7 7.20
* The DFT can implement an FIR filter exactly. Because a) The product of two DFT s corresponds to the circular convolution of two signals and b) By augmenting with zeros, circular convolution can be made equivalent to linear convolution. N.MORGAN / B.GOLD LECTURE 7 7.21
The DFT can Implement Linear Convolution. X k = x 0 W 0 + x 1 W k + x 2 W 2k + x 3 W 3k Y k = y 0 W 0 + y 1 W k + y 2 W 2k + y 3 W 3k y 0 x 0 X k Y k = x 0 y 0 + x 1 y 3 + x 2 y 2 + x 3 y 1 y 3 x 1 x 3 y 1 x 2 y 2 y 1 x 0 + x 0 y 1 + x 1 y 0 + x 2 y 3 + x 3 y 2 y 0 x 1 x 3 y 2 Circular Convolution x 2 y 3 N.MORGAN / B.GOLD LECTURE 7 7.22
Circular Convolution y 0 x 0 + x 0 y 2 + x 1 y 1 + x 2 y 0 + x 3 y 3 y 3 x 1 x 3 y 1 x 2 y 2 y 0 x 0 + x 0 y 3 + x 1 y 2 + x 2 y 1 + x 3 y 0 y 3 x 1 x 3 y 1 x 2 y 2 N.MORGAN / B.GOLD LECTURE 7 7.23
Linear Convolution 0 0 0 x 0 x 1 x 2 x 3 0 0 0 x 0 y 0 y 3 y 2 y 1 y 0 0 0 0 x 0 y 1 + x 1 y 0 x 0 y 2 + x 1 y 1 + x 2 y 4 0 y 3 y 2 y 1 y 0 0 0 0 0 y 3 y 2 y 1 y 0 0 0 0 0 y 3 y 2 y 1 y 0 0 0 0 0 0 y 3 y 2 y 1 y 0 0 0 0 0 0 y 3 y 2 y 1 y 0 0 0 x 3 y 3 y 3 y 2 y 1 y 0 N.MORGAN / B.GOLD LECTURE 7 7.24
Figure 7.10 : Circular Convolution of Two 8 Point Sequences. Only y(0), y(2), y(4) and y(7) are shown. All Outer Circles Carry the Same Sequence as the Upper Left Circle. N.MORGAN / B.GOLD LECTURE 7 7.25
Figure 7.11 : Linear Convolution of Two Finite Length Sequences by DFT. N.MORGAN / B.GOLD LECTURE 7 7.26
M L N.MORGAN / B.GOLD LECTURE 7 7.27
DFT of each Row - LM 2 Operations Twiddle the Resulting Matrix - LM Operation DFT of each Column - ML 2 Operation Total DFT of Complete Array ML( M + L + 1) ( ML) 2 = ML( ML) M = 12, L = 5 M + L + 1 = 18 ML = 60 savings of ~ 3:1 BUT e.g. M = 1000, L = 20 M + L+ 1 = 1021 ML = 20, 000 savings of ~ 20:1 N.MORGAN / B.GOLD LECTURE 7 7.28