Lecture 7 - IIR Filters James Barnes (James.Barnes@colostate.edu) Spring 204 Colorado State University Dept of Electrical and Computer Engineering ECE423 / 2
Outline. IIR Filter Representations Difference Equations, h[n], H() 2. IIR Filter Topologies Lecture 8. IIR Filter Design Overview 2. REVIEW Analog Digital Filter Design via Impulse Invariance 3. NEW Analog Digital Filter Design via Bilinear Transformation 4. Pre-warping 5. Low-pass to High-pass Frequency Transformation Colorado State University Dept of Electrical and Computer Engineering ECE423 2 / 2
Outline IIR Filter Representations Difference Equations, h[n], H() Review - Digital Computer Wiring Diagram IIR Filter is an LTI System IIR Transfer Function Product Form of Transfer Function Time Domain Representation Time Domain Representations (cont d) Frequency Response IIR Filter Representations Difference Equations, h[n], H() IIR Filter Topologies Colorado State University Dept of Electrical and Computer Engineering ECE423 3 / 2
Review - Digital Computer Wiring Diagram Colorado State University Dept of Electrical and Computer Engineering ECE423 4 / 2
IIR Filter is an LTI System An IIR filter is one class of linear time-invariant system. We can represent the function of the filter as a difference equation: y[n] = N a k y[n k]+ k= M b k x[n k] () The first sum represents the Auto-Regressive or IIR part and the second sum represents the Moving Average or FIR part. In general, a filter can have either or both parts. k=0 Recalling that y[n k] = k y[k], we can write () as {+ N M a k k }{y[n]} = { b k k }{x[n]} (2) k= k=0 Colorado State University Dept of Electrical and Computer Engineering ECE423 5 / 2
IIR Transfer Function Equation (2) has the form A(){y[n]} = B(){x[n]} (3) Taking the -transform of the sequences x[n] and y[n] in (3), we get A()Y() = B()X() (4) or Therefore A()H() = B(). (5) H() = B() A() = M k=0 b k k + N k= a (6) k k. Therefore, by choosing a k and b k, we determine the filter frequency response. Colorado State University Dept of Electrical and Computer Engineering ECE423 6 / 2
Product Form of Transfer Function Another form of the transfer function we will use is the factored or product form: H() = b 0 M k= ( k ) N k= ( p k ), (7) where k and p k are the pole and ero locations. Since we are concerned with systems having a real impulse response h[n], the poles and eros either be real or occur in complex conjugate pairs. Recall that for a filter to have linear phase, H() must satisfy H() = ± N H( ). (8) For an IIR filter to satisfy the linear phase condition, both the poles and eros would need to have mirror images outside the unit circle of the -plane. However, poles outside the unit circle unstable. Therefore, a causal, stable IIR cannot have linear phase. Colorado State University Dept of Electrical and Computer Engineering ECE423 7 / 2
Time Domain Representation Taking the inverse -transform of (4), we get the standard convolution sum form N M a k y[n k] = b k x[n k]. (9) k=0 k=0 But using the fact that x[n] = δ[n] y[n] = h[n], (0) can be written N a k h[n k] = k=0 M b k δ[n k]. (0) k=0 Colorado State University Dept of Electrical and Computer Engineering ECE423 8 / 2
Time Domain Representations (cont d) Assuming causality (h[n]=0 for n<0), (9) can be expanded to a series of equations. Recalling that a 0 =, the equations are h[0] = b 0, h[] = b a h[0],......... h[m] = b M a h[m ]... a N h[m N], h[m +] = a h[m] a 2 h[m ]... a N h[m N] a N h[m N ]. Note that even though h[n] has a finite length, the impulse response can have an infinite duration because of the recursive nature of the equation for y[n]. Colorado State University Dept of Electrical and Computer Engineering ECE423 9 / 2
Frequency Response The frequency response is given by H( = e jω ) = B(ejω ) A(e jω ) = M k=0 b ke jωk where ω = 2πF/F s is the relative frequency in radians/sample. + N k= a () ke jωk, For comparison, the frequency response of an equivalent analog LTI system is given by H(s) = M k=0 β ks k + N k= α ks k (2) Colorado State University Dept of Electrical and Computer Engineering ECE423 0 / 2
Outline IIR Filter Representations Difference Equations, h[n], H() IIR Filter Topologies IIR Filter Topologies Summary Direct Type I Direct Type II Transposed Type II Numerical Effects Pole/Zero Quantiation Effects Pole/Zero Quantiation - Relation to Roundoff Error P/Z Quantiation - Relation to Roundoff Error(II) Biquad Section Pole/Zero Quantiation for Coupled-Form Realiation of 2-Pole Section IIR Filter Topologies Colorado State University Dept of Electrical and Computer Engineering ECE423 / 2
IIR Filter Topologies Summary IIR filter topologies can be classified as Direct Type I or Type II Transposed In addition, filters can be either monolithic or built from cascades of smaller (typically second order) sections Colorado State University Dept of Electrical and Computer Engineering ECE423 2 / 2
Direct Type I H() = H ()H 2 () = B() A() (3) x[n] b[0] v[n] y[n] + + - - b[] b[2] + + + + -a[] -a[2] - - s[] Properties Memory cells: M+N+ Mpy/Add ops: M+N+ b[m-] + + -a[n-] - b[m] -a[n] - s[n] Colorado State University Dept of Electrical and Computer Engineering ECE423 3 / 2
Direct Type II H() = H 2 ()H () = B() (4) A() x[n] + v[n] b[0] + y[n] -a[] - + + -a[2] - s [n] s 2 [n] b[] b[2] + + Properties Memory cells: Greater of [M,N] Mpy/Add ops: M+N+ -a[n-] s N- [n] b[n-] + + -a[n] - s N [n] b[n] Colorado State University Dept of Electrical and Computer Engineering ECE423 4 / 2
Transposed Type II Transposition Theorem: reverse direction of all signal flow paths, exchange input and output, and the filter function is unchanged x[n] b[0] + y[n] s [n] - Properties b[] + s 2 [n] - -a[] Memory cells: Greater of [M,N] Mpy/Add ops: M+N+ Fewer adders, but 3 inputs b[2] + -a[2] s N [n] - b[n] -a[n] Colorado State University Dept of Electrical and Computer Engineering ECE423 5 / 2
Numerical Effects Fixed point arithmetic (and to a lesser extent floating point) can cause deviations from ideal behavior because of Round-off error in computing sum-of-products expressions Arithmetic overflow in computing SOP expressions Arithmetic overflow in filter tap coefficients in adaptive filters Quantiation of pole and ero locations due to finite precision leading to different frequency dependence than design target. Colorado State University Dept of Electrical and Computer Engineering ECE423 6 / 2
Pole/Zero Quantiation Effects Pole and Zero locations are determined from the a k and b k values. Because of finite precision in fixed-point arithmetic, placement is constrained to a grid of points. Example for a 2-pole system, using 4 bit precision Colorado State University Dept of Electrical and Computer Engineering ECE423 7 / 2
Pole/Zero Quantiation - Relation to Roundoff Error Consider case of pole-only system, with H() = /A() : H() = But because of roundoff error, + N k= a k = k N k= ( p k k ). (5) ā k = a k + a k, (6) where a k is the quantied value and a k is the infinite precision desired value. If p i is the error in pole location p i due to quantiation, we can compute p i from the expression p i = N k= p i a k a k. (7) Colorado State University Dept of Electrical and Computer Engineering ECE423 8 / 2
P/Z Quantiation - Relation to Roundoff Error(II) But the derivative in (7) can be evaluated as Evaluating the numerator and denominator, we get p i a k = ( A()/ a k) =pi ( A()/ ) =pi. (8) p i = N k= p N k i N l=,l i (p i p l ). (9) Because of the product term in the denominator, the error term can get large for poles which are close together. The error can be minimied by breaking up the filter into sections with poles as far apart as possible. Typically, the filter is broken up into sections of second-order sections, where the poles and eros are chosen to be complex conjugates. These wil not be close together, and the error will be minimied. Colorado State University Dept of Electrical and Computer Engineering ECE423 9 / 2
Biquad Section Colorado State University Dept of Electrical and Computer Engineering ECE423 20 / 2 2 2 [2,] [,] [2,] [,] a a b b x[n] y[n] 2 2 ] [2, ] [, ] [2, ] [, k a k a k b k b 2 2 ] [2, ] [, ] [2, ] [, N a N a N b N b s s s s G
Pole/Zero Quantiation for Coupled-Form Realiation of 2-Pole Section There is also a realiation which will at least distribute the pole locations evenly in the -plane. This is the coupled-form. The data below are for a two-pole system with 4 bit coefficient precision as before. Colorado State University Dept of Electrical and Computer Engineering ECE423 2 / 2