370 likes | 387 Views
Learn about various filter types, minimum and maximum phases, filter implementation structures, comb and allpass filters, minimum/maximum phase concepts, inverse systems, system identification, and filter structures. Understand block diagrams, delay-free loops, equivalent structures, and more.
E N D
ELEN E4810: Digital Signal ProcessingTopic 7: Filter types and structures • Some filter types • Minimum and maximum phase • Filter implementation structures Dan Ellis
1. Some Filter Types • We have seen the basics of filtersand 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
x[n] y[n] + z-L z-L z-L z-L Comb Filters • Replace all system delays z-1 with longer delays z-L System that behaves ‘the same’ at a longer timescale Dan Ellis
Comb Filters • ‘Parent’ filter impulse response h[n]becomes comb filter output as: g[n] = {h[0] 0 0 0 0 h[1] 0 0 0 0 h[2]..} • Thus, L-1 zeros Dan Ellis
Comb Filters • Thus, frequency response: • High-pass response • passw = p/L, 3p/L, 5p/L... • cut w = 0, 2p/L, 4p/L... parent frequency responsecompressed & repeated L times H(ejw) G(ejw) L copies of H(ejw) useful to removea harmonic series Dan Ellis
Allpass Filters • Allpass filter has |A(ejw)|2 = Kwi.e. spectral energy is not changed • Phase response is not zero (else trivial) • phase correction special effects • e.g. Dan Ellis
Allpass Filters • Allpass has special form of system fn: • AM(z) has polesl whereDM(l) = 0AM(z) has zerosz = 1/l = l-1 = mirror-imagepolynomials Dan Ellis
Allpass Filters • Any (stable) DM can be used: • Phase is always decreasing: -Mp at w = p reciprocalzerosfrom DM(z-1) polesfrom 1/DM(z) peakgroupdelay M Dan Ellis
Allpass Filters Why do mirror-img poly’s give const gain? • Conj-sym system fn can be factored as: • z = ejwz-1 = e-jw also on u.circle... o ejw li e-jw ZP + complex conjugate p/z Dan Ellis
2. 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 reciprocalroots • reciprocal of stable pole will be unstable X • reciprocals of zeros? Variants of filters with same magnitude response, different phase Dan Ellis
Minimum/Maximum Phase • Hence: reciprocal zero.. .. same mag.. .. addedphaselag Dan Ellis
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 responseseveral filters & phase fns are possible;minimum phase is canonical, ‘best’ Dan Ellis
o o o o o o Minimum/Maximum Phase • Note: Min. phase + Allpass = Max. phase pole-zerocancl’n x = Dan Ellis
x[n] y[n] w[n] Hf(z) Hi(z) Inverse Systems • hi[n] is called the inverse of hf[n] iff • Z-transform: • i.e. Hi(z) recovers x[n] from o/p of Hf(z) Dan Ellis
o o o Inverse Systems • What is Hi(z)? • Hi(z) is reciprocal polynomial of Hf(z) • Just swappoles andzeros: poles of fwdzeros of bwd zeros of fwdpoles of bwd Hf(z) Hi(z) Dan Ellis
lose... w Inverse Systems When does Hi(z) exist? • Causal+stable all Hi(z)poles inside u.c. all zeros of Hf(z) must be inside u.c.Hf(z) must be minimum phase • Hf(z) zeros outside u.c. unstable Hi(z) • Hf(z) zeros on u.c. unstable Hi(z) only invert if min.phase, Hf(ejw) ≠ 0 Dan Ellis
x[n] y[n] H(z) System Identification • Inverse filtering = given y and H, find x • System ID = given y (and ~x), find H • Just run convolution backwards? deconvolution but: errorsaccumulate Dan Ellis
x[n] y[n] H?(z) System Identification • Better approach uses correlations;Cross-correlate input and output: • If rxxis ‘simple’, can recover h?[n]... • e.g. (pseudo-) white noise: Dan Ellis
System Identification • Can also work in frequency domain: • x[n] is not observable Sxy unavailable, but Sxx(ejw) may still be known, so: • Use e.g. min.phase to rebuild H(ejw)... make a const. Dan Ellis
3. Filter Structures • Many different implementations, representations of same filter • Different costs, speeds, layouts, noise performance, ... Dan Ellis
x[n] y[n] G1(z) + G2(z) Block Diagrams • Useful way to illustrate implementations • Z-transform helps analysis: • Approach • Output of summers as dummy variables • Everything else is just multiplicative Dan Ellis
w1 w2 x[n] + + -a -d b e y[n] z-1 z-1 + + w3 g Block Diagrams • More complex example: stackable2nd order section Dan Ellis
x u + A B y v + Delay-Free Loops • Can’t have them! • At time n = 0, setup inputs x and v ;needu for y, also y for u can’t calculate • Algebra: x u + y v + can simplify... Dan Ellis
Equivalent Structures • Modifications to block diagrams that do not change the filter • e.g. CommutationH = AB = BA • Factoring AB+CB = (A+C)·B A B B A x1 x1 A(z)B(z) A(z) y y B(z) x2 + x2 + C(z)B(z) C(z) fewer blocks less computation Dan Ellis
x b1 y + z-1 b2 z-1 b3 b1 y x + z-1 b2 + z-1 b3 Equivalent Structures • Transpose • reverse paths • addersnodes • inputoutput Dan Ellis
x z-1 z-1 z-1 z-1 h0 h1 h2 h3 h4 + + + + x h4 h3 h2 h1 h0 y z-1 z-1 z-1 z-1 + + + + FIR Filter Structures • Direct form “Tapped Delay Line” • Transpose • Re-use delay line if several inputs xifor single output y ? y Dan Ellis
x h0 y + + z-1 z-1 z0 -2Re{z1} z-1 |z1|2 FIR Filter Structures • Cascade • factored into e.g. 2nd order sections Dan Ellis
n x z-1 z-1 + + z-1 z-1 b0 b1 b2 y + + FIR Filter Structures • Linear Phase:Symmetric filters with h[n] = (-)h[N - n] • Also Transpose form:gains first, feeding folded delay/sum line ... half as many multiplies Dan Ellis
p0 + + p1 z-1 -d1 z-1 z-1 z-1 p2 -d2 IIR Filter Structures • IIR: numerator + denominator all-poleIIR FIR Dan Ellis
p0 + p1 z-1 -d1 z-1 z-1 z-1 p2 -d2 p0 + + p1 -d1 z-1 z-1 p2 -d2 IIR Filter Structures • Hence, Direct form I • Commutation Direct form II (DF2) • same signal delay lines merge • “canonical”= min. memory usage Dan Ellis
p0 x y + z-1 p1 -d1 + z-1 p2 -d2 + IIR Filter Structures • Use Transpose on FIR/IIR/DF2 • “Direct Form II Transpose” Dan Ellis
b a -b Factored IIR Structures • Real-output filters have conjugate-symm roots: • Can always group into 2nd order terms with real coefficients: real root Dan Ellis
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?) fwd gain factored out x y + + + + + + p0 z-1 z-1 z-1 a1 -g1 2a2 -2g2 z-1 z-1 -(a22+b22) g22+d22 Dan Ellis
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
Second Order Sections • Factorization affects intermediate values Factorization 1 Factorization 2 Original System(2 pair poles, zeros) Dan Ellis
Parallel IIR Structures • Can express H(z) as sum of terms (IZT) • Or, second-order terms: • Suggests parallel realization... Dan Ellis
y g0 x + g01 + + -a11 g11 z-1 z-1 -a21 g02 + + -a12 g12 z-1 z-1 -a22 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 Dan Ellis