Dan Ellis 1 ELEN E4810: Digital Signal Processing Topic 7: Filter types and structures 1.Some filter types 2.Minimum and maximum phase 3.Filter implementation structures
Dan Ellis 2 1. Some Filter Types We have seen the basics of filters and a range of simple examples Now look at a couple of other classes: Comb filters - multiple pass/stop bands Allpass filters - only modify signal phase
Dan Ellis 3 Comb Filters Replace all system delays z -1 with longer delays z -L System that behaves ‘the same’ at a longer timescale x[n]x[n]y[n]y[n] + z-Lz-L z-Lz-L z-Lz-L z-Lz-L
Dan Ellis 4 Comb Filters ‘Parent’ filter impulse response h[n] becomes comb filter output as: g[n] = {h[0] h[1] h[2]..} Thus, L-1 zeros
Dan Ellis 5 Comb Filters Thus, frequency response: High-pass response pass = /L, 3 /L, 5 /L... cut = 0, 2 /L, 4 /L... parent frequency response compressed & repeated L times H(ej)H(ej)G(ej)G(ej) L copies of H(e j ) useful to remove a harmonic series
Dan Ellis 6 Allpass Filters Allpass filter has A(e j ) 2 = K i.e. spectral energy is not changed Phase response is not zero (else trivial) phase correction special effects e.g.
Dan Ellis 7 Allpass Filters Allpass has special form of system fn: A M (z) has poles where D M ( ) = 0 A M (z) has zeros = 1/ = -1 mirror-image polynomials =
Dan Ellis 8 Allpass Filters Any (stable) D M can be used: Phase is always decreasing: -M at poles from 1/D M (z) reciprocal zeros from D M (z -1 ) M peak group delay
Dan Ellis 9 Why do mirror-img poly’s give const gain? Conj-sym system fn can be factored as: z = e j z -1 = e -j also on u.circle... Allpass Filters ejej e -j ZP i o + complex conjugate p/z
Dan Ellis Minimum/Maximum Phase In AP filters, reciprocal roots have.. same effect on magnitude (modulo const.) different effect on phase In normal filters, can try substituting reciprocal roots reciprocal of stable pole will be unstable X reciprocals of zeros? Variants of filters with same magnitude response, different phase
Dan Ellis 11 Minimum/Maximum Phase Hence: reciprocal zero.... added phase lag.. same mag..
Dan Ellis 12 Minimum/Maximum Phase For a given magnitude response All zeros inside u.circle minimum phase All zeros outside u.c. maximum phase (greatest phase dispersion for that order) Otherwise, mixed phase i.e. for a given magnitude response several filters & phase fns are possible; minimum phase is canonical, ‘best’
Dan Ellis 13 Minimum/Maximum Phase Note: Min. phase + Allpass = Max. phase o o o o o o x= pole- zero cancl’n
Dan Ellis 14 Inverse Systems h i [n] is called the inverse of h f [n] iff Z-transform: i.e. H i (z) recovers x[n] from o/p of H f (z) Hf(z)Hf(z)Hi(z)Hi(z) x[n]x[n]y[n]y[n]w[n]w[n]
Dan Ellis 15 What is H i (z) ? H i (z) is reciprocal polynomial of H f (z) Just swap poles and zeros: Inverse Systems poles of fwd zeros of bwd zeros of fwd poles of bwd o o o Hf(z)Hf(z)Hi(z)Hi(z)
Dan Ellis 16 Inverse Systems When does H i (z) exist? Causal+stable all H i (z) poles inside u.c. all zeros of H f (z) must be inside u.c. H f (z) must be minimum phase H f (z) zeros outside u.c. unstable H i (z) H f (z) zeros on u.c. unstable H i (z) only invert if min.phase, H f (e j ) ≠ 0 lose...
Dan Ellis 17 System Identification Inverse filtering = given y and H, find x System ID = given y (and ~ x ), find H Just run convolution backwards? H(z)H(z) x[n]x[n]y[n]y[n] but: errors accumulate deconvolution
Dan Ellis 18 System Identification Better approach uses correlations; Cross-correlate input and output: If r xx is ‘simple’, can recover h ? [n]... e.g. (pseudo-) white noise: H?(z)H?(z) x[n]x[n]y[n]y[n]
Dan Ellis 19 System Identification Can also work in frequency domain: x[n] is not observable S xy unavailable, but S xx (e j ) may still be known, so: Use e.g. min.phase to rebuild H(e j )... make a const.
Dan Ellis Filter Structures Many different implementations, representations of same filter Different costs, speeds, layouts, noise performance,...
Dan Ellis 21 Block Diagrams Useful way to illustrate implementations Z-transform helps analysis: Approach Output of summers as dummy variables Everything else is just multiplicative G1(z)G1(z) + G2(z)G2(z) x[n]x[n]y[n]y[n]
Dan Ellis 22 Block Diagrams More complex example: x[n]x[n] + y[n]y[n] + z -1 -- + -- w1w1 w2w2 w3w3 + stackable 2nd order section
Dan Ellis 23 Delay-Free Loops Can’t have them! At time n = 0, setup inputs x and v ; need u for y, also y for u can’t calculate Algebra: x + y + u v x y + u v + can simplify...
Dan Ellis 24 Equivalent Structures Modifications to block diagrams that do not change the filter e.g. Commutation H = AB = BA Factoring AB+CB = (A+C)·B ABBA A(z)B(z)A(z)B(z) + C(z)B(z)C(z)B(z) x1x1 x2x2 y A(z)A(z) + x1x1 x2x2 y C(z)C(z) B(z)B(z) fewer blocksless computation
Dan Ellis 25 Equivalent Structures Transpose reverse paths adders nodes input output + z -1 yxb1b1 b2b2 b3b3 + xy b1b1 b2b2 b3b3 +
Dan Ellis 26 FIR Filter Structures Direct form “Tapped Delay Line” Transpose Re-use delay line if several inputs x i for single output y ? z x h0h0 h1h1 h2h2 h3h3 h4h4 y x h4h4 h3h3 h2h2 h1h1 h0h0 y
Dan Ellis 27 FIR Filter Structures Cascade factored into e.g. 2nd order sections + z -1 y -2Re{ 1 } 11 z -1 xh0h0 00 +
Dan Ellis 28 FIR Filter Structures Linear Phase: Symmetric filters with h[n] = (-)h[N - n] Also Transpose form: gains first, feeding folded delay/sum line n z -1 + x b0b0 b1b1 b2b y... half as many multiplies
Dan Ellis 29 IIR Filter Structures IIR: numerator + denominator + z -1 p0p0 p1p1 p2p2 + -d 1 -d 2 FIR all-pole IIR
Dan Ellis 30 IIR Filter Structures Hence, Direct form I Commutation Direct form II (DF2) + z -1 p0p0 p1p1 p2p2 -d 1 -d 2 + p0p0 p1p1 p2p2 + z -1 -d 1 -d 2 same signal delay lines merge “canonical” = min. memory usage
Dan Ellis 31 IIR Filter Structures Use Transpose on FIR/IIR/DF2 “Direct Form II Transpose” -d 1 -d 2 + z -1 xy p0p0 p1p1 p2p2 + +
Dan Ellis 32 Factored IIR Structures Real-output filters have conjugate-symm roots: Can always group into 2nd order terms with real coefficients: real root
Dan Ellis 33 Cascade IIR Structure Implement as cascade of second order sections (in DFII) Second order sections (SOS): modular - any order from optimized block well-behaved, real coefficients (sensitive?) + -2 2 + z -1 222 p0p0 -1-1 + 11 xy 22+2222+22 2 2 ) fwd gain factored out
Dan Ellis 34 Second-Order Sections ‘Free’ choices: grouping of pole pairs with zero pairs order of sections Optimize numerical properties: avoid very large values (overflow) avoid very small values (quantization) e.g. Matlab’s zp2sos attempt to put ‘close’ roots in same section intersperse gain & attenuation?
Dan Ellis 35 Second Order Sections Factorization affects intermediate values Original System (2 pair poles, zeros) Factorization 1Factorization 2
Dan Ellis 36 Parallel IIR Structures Can express H(z) as sum of terms (IZT) Or, second-order terms: Suggests parallel realization...
Dan Ellis 37 Parallel IIR Structures Sum terms become parallel paths Poles of each SOS are from full TF System zeros arise from output sum Why do this? stability/sensitivity reuse common terms + 01 11 + z -1 - 11 - 21 + 00 + 02 12 + z -1 - 12 - 22 x y