ELEN E481: Digital Signal Processing Topic 7: Filter tpes and structures 1. Some filter tpes 2. Minimum and maximum phase 3. Filter implementation structures 1 1. Some Filter Tpes 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 - onl modif signal phase 2
Comb Filters Replace all sstem delas with longer delas z -L x[n] z -L z -L [n] z -L z -L Sstem that behaves the same at a longer timescale 3 Comb Filters Parent filter impulse response h[n] becomes comb filter output as: g[n] = {h[] h[1] h[2]..} Thus, Gz L-1 zeros n (= gn [ ]z n = hn [ ]z nl n = Hz ( L 4
Comb Filters Thus, frequenc response: Ge ( jω = He ( jωl 2 parent frequenc response compressed & repeated L times H(e jω G(e jω 2 15 1 5 15 1 5 -π -π/2 π/2 π High-pass response pass ω = π/l, 3π/L, 5π/L... cut ω =, 2π/L, 4π/L... -π -π/2 π/2 π L copies of H(e jω useful to remove a harmonic series 5 Allpass Filters Allpass filter has A(e jω 2 = K ω i.e. spectral energ is not changed Phase response is not zero (else trivial phase correction special effects e.g. Magnitude (db 5-5 -1-15 -2.1.2.3.4.5.6.7.8.9 1 Normalized Frequenc (π rad/sample Phase (degrees -2-4 -6-8.1.2.3.4.5.6.7.8.9 1 Normalized Frequenc (π rad/sample 6
Allpass Filters A M Allpass has special form of sstem fn: (=± z d M d M 1 z 1... d 1 z ( M 1 z M 1 d 1 z 1... d M 1 z ( M 1 d M z M =±z M D M D M ( z 1 ( z A M (z has poles λ where D M (λ = A M (z has zeros ζ = 1/λ = λ -1 = mirror-image polnomials 7 Allpass Filters A M An (stable D M can be used: reciprocal zeros from D M ( Im{z}.5 Phase is alwas decreasing: -Mπ at ω = π -.5-1 (=±z z D M M -3-2 -1 1 D M ( z 1 ( z poles from 1/D M (z 3π.2.4.6.8 /π 8 arg{h(z} π 2π Re{z} peak group dela M
Allpass Filters Wh do mirror-img pol s give const gain? Conj-sm sstem fn can be factored as: A M * ( 1 i (= z K z λ i z λ i i ( i ( = K λ * 1 i z λ * i z 1 z λ i i ( z = e jω = e -jω also on u.circle... 9 ZP complex conjugate p/z λ i λ i * o * λ 1 i e jω e -jω 2. Minimum/Maximum Phase In AP filters, reciprocal roots have.. same effect on magnitude (modulo const. different effect on phase In normal filters, can tr substituting reciprocal roots reciprocal of stable pole will be unstable X reciprocals of zeros? Variants of filters with same magnitude response, different phase 1
Minimum/Maximum Phase Hence: H 1 (z = z - b z - a a H 2 (z = b(z - 1/b z - a a b 1/b reciprocal zero.. 3 3 H(e j 2 1 2 1.. same mag.. (H(e j.5π -.5π -π.2.4.6.8 /π.5π -.5π -π.2.4.6.8 /π.. added phase lag 11 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 12
Minimum/Maximum Phase Note: Min. phase Allpass o o o = Max. phase o polezero cancl n ( z ζ ( z ζ * z λ ( * x = o ( z 1 ζ z 1 ζ ( z ζ z ζ * ( o ( z 1 ζ z 1 ζ ( * z λ 13 Inverse Sstems h i [n] is called the inverse of h f [n] iff h i [ n] h f [ n]= δ[ n] Z-transform: H f ( e jω H i ( e jω =1 x[n] [n] w[n] H f (z H i (z Wz (= H i (Y z (= z H i (H z f wn [ ]= xn [ ] (Xz z (= Xz ( i.e. H i (z recovers x[n] from o/p of H f (z 14
Inverse Sstems What is H i (z? H i (=1/H z f z H i (z is reciprocal polnomial of H f (z H f (= z Pz Dz Just swap poles and zeros: H i z (H f ( ( H i (= z Dz ( Pz ( H f (z (=1 z ( poles of fwd zeros of bwd zeros of fwd poles of bwd 15 o o H i (z o Inverse Sstems When does H i (z exist? Causalstable 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 H i ( e jω =1/H f ( e jω lose... =1/ ω=ζ ω onl invert if min.phase, H f (e jω 16
Sstem Identification Inverse filtering = given and H, find x Sstem ID = given (and ~x, find H Just run convolution backwards? n [ ]= hk [ ]xn [ k] x[n] k= H(z [ ]= h[ ]x 1 []= h [ ]x 1 [n] [ ] h[ ] [] h[]x 1 [ ] h 1 deconvolution but: errors accumulate []... 17 Sstem Identification x[n] H? (z [n] Better approach uses correlations; Cross-correlate input and output: r x []= l [] l x[ l]= h? [] l x[] l x l = h? [] l r xx [] l If r xx is simple, can recover h? [n]... e.g. (pseudo- white noise: r xx [] l δ[] l h? [ n] r x l [] [ ] 18
Sstem Identification Can also work in frequenc domain: S x z (= H? ( z S xx z ( make a const. x[n] is not observable S x unavailable, but S xx (e jω ma still be known, so: S ( e jω = Ye ( jω Y * ( e jω = He ( jω Xe ( jω H * ( e jω X * ( e jω = He jω ( 2 S xx ( e jω Use e.g. min.phase to rebuild H(e jω... 19 3. Filter Structures Man different implementations, representations of same filter Different costs, speeds, laouts, noise performance,... 2
x[n] Block Diagrams Useful wa to illustrate implementations Z-transform helps analsis: [n] Y(= z G 1 (Xz z [ ( G 2 (Y z ( z ] G 1 (z Y(1 z [ G 1 (G z 2 ( z ]= G 1 (Xz z G 2 (z Approach Hz (= Y ( z Xz ( = G 1 ( z 1 G 1 (G z 2 ( z Output of summers as dumm variables Everthing else is just multiplicative ( 21 Block Diagrams More complex example: w x[n] 1 w 2 -α β -δ ε [n] z γ -1 W 1 = X αz 1 W 3 W 2 = W 1 δz 1 W 2 w 3 W 3 = z 1 W 2 εw 2 Y = γz 1 W 3 βw 1 W W 2 = 1 1 δz 1 Y X = β z 1 ( βδ γε z 2 ( γ 1 z ( 1 W 3 = z 1 ε ( δ αε z 2 ( α W 1 1 δz 1 stackable 2nd order section 22
Dela-Free Loops Can t have them! x Β Α u v ( u = x ( ( = Bv Au = Bv Ax At time n =, setup inputs x and v ; need u for, also for u can t calculate Algebra: ( 1 BA= Bv BAx Bv BAx = 1 BA 23 x BA 1 BA 1 1 BA B 1 BA u B 1 BA v can simplif... Equivalent Structures Modifications to block diagrams that do not change the filter e.g. Commutation H = AB = BA A B B A Factoring ABCB = (AC B x 1 x 2 A(zB(z C(zB(z x 1 x 2 A(z C(z B(z fewer blocks less computation 24
Equivalent Structures Transpose reverse paths adders nodes input output Y = b 1 X b 2 z 1 X b 3 z 2 X ( = b 1 X z 1 b 2 X z 1 b 3 X x b 1 b 2 b 3 b 1 b 2 b 3 x 25 x x FIR Filter Structures Direct form Tapped Dela Line n [ ]= h xn [ ] h 1 xn 1 [ ]... h h 1 h 2 h 3 h 4 4 = h k xn [ k ] k= Transpose h 4 h 3 h 2 h 1 h Re-use dela line if several inputs x i for single output? 26
FIR Filter Structures Cascade factored into e.g. 2nd order sections Hz (= h h 1 z 1 h 2 z 2 h 3 z 3 = h ( 1 ζ z 1 1 ζ ( 1 z 1 1 ζ ( * 1 z 1 = h ( 1 ζ z 1 1 2Re{ ζ 1 }z 1 ζ 2 1 z 2 x h ζ ( 27-2Re{ζ 1 } ζ 1 2 FIR Filter Structures Linear Phase: Smmetric filters with h[n] = (-h[n - n] ( ( [ ] n [ ]= b xn [ ] xn [ 4] b 1 xn 1 [ ] xn 3 b 2 xn 2 [ ] Also Transpose form: gains first, feeding folded dela/sum line 28 x n b b 1 b 2... half as man multiplies
IIR Filter Structures IIR: numerator denominator Hz (= p p 1 z 1 p 2 z 2... 1 d 1 z 1 d 2 z 2... = Pz ( 1 Dz ( FIR p p 1 p 2 -d 1 -d 2 all-pole IIR 29 IIR Filter Structures Hence, Direct form I Commutation Direct form II (DF2 -d 1 -d 2 p p 1 p 2 -d 1 -d 2 p p 1 p 2 same signal dela lines merge canonical = min. memor usage 3
IIR Filter Structures Use Transpose on FIR/IIR/DF2 x p p 1 p 2 -d 1 -d 2 Direct Form II Transpose 31 real root Factored IIR Structures Real-output filters have α conjugate-smm roots: β 1 Hz (= ( 1 (α jβz 1 1 (α jβz 1 ( Can alwas group into 2nd order terms with real coefficients: Hz (= p ( 1 γ 1 z 1 1 ( 2γ 2 z 1 (γ 2 2 δ 2 2 z 2... ( 1 α 1 z 1 1 ( 2α 2 z 1 (α 2 2 β 2 2 z 2... 32 β
Cascade IIR Structure Implement as cascade of second order sections (in DFII fwd gain factored out x p α 1 -γ 1 2α 2-2γ 2 (α 22 β 22 γ 22 δ 2 2 Second order sections (SOS: modular - an order from optimized block well-behaved, real coefficients (sensitive? 33 Second-Order Sections Free choices: grouping of pole pairs with zero pairs order of sections Optimize numerical properties: avoid ver large values (overflow avoid ver small values (quantization e.g. Matlab s zp2sos attempt to put close roots in same section intersperse gain & attenuation? 34
Second Order Sections Factorization affects intermediate values Original Sstem (2 pair poles, zeros Im{z} H(z / db 1-1 2-2 -1 1 2 Re{z} -2.2.4.6.8 /π 2 H(z / db H(z / db -2.2.4.6.8 /π 2 Factorization 1 Factorization 2 H(z / db H(z / db 2-2.2.4.6.8 /π 2-2.2.4.6.8 /π -2.2.4.6.8 /π 35 Parallel IIR Structures Can express H(z as sum of terms (IZT H(z = consts ρ l l=1 1 λ l z 1 Or, second-order terms: γ H(z = γ k γ 1k z 1 k 1 α 1k z 1 α 2k z 2 N ρ l = ( 1 λ l z 1 Fz ( z=λl Suggests parallel realization... 36
x Parallel IIR Structures -α 11 -α 21 -α 12 -α 22 γ γ 1 γ 11 γ 2 γ 12 Sum terms become parallel paths Poles of each SOS are from full TF Sstem zeros arise from output sum Wh do this? stabilit/sensitivit reuse common terms 37