Course 18.327 and 1.130 Wavelets and Filter Banks Signal and Image Processing: finite length signals; boundary filters and boundary wavelets; wavelet compression algorithms. Finite-Length Signals y-2 y-1 y0 y1 yN-1 = y[n] h0 h1 h0 h-1 h2 h1 h0 h-1 h1 h0 h-1 x-2 x-1 x0 x1 xN-1 unknown H(ω ω) x[n] length N (finite length) unknown 2 1 1) zero-padding x[n] -2 -1 0 1 2 3 n filtered by [1, 1] y[n] n -2 -1 0 1 2 3 filtered by [1, -1] y[n] -2 -1 0 1 2 3 artificial edge resulting from zero-padding 2) Periodic Extension … n 3 x[N] = x[0] x[n] … … n - 1 0 1 2 … N-1 N wrap-around y0 y1 = yN-1 N-output h1 h0 h-1 h-2 h2 h1 h1 h0 h-1 h3 h2 h-1 h-2 h2 h1 h0 xN-2 xN-1 x0 x1 x2 xN-1 x0 circulant matrix = H 4 2 What is the eigenvector for the circulant matrix? [ 1 eiωω ei2ωω ei(N-1)ωω ] T We need eiNωω = 1 = ei0ωω ∴ Nω ω = 2π πk , ω = 2π πk N discrete set of ω’s For the 0th row, N-1 2π πk H[k] = ¦ h[n] e-i N n n=0 5 1 1 1 1 w w2 [H] 1 w2 w4 1 wN-1 1 H[0] N-1 H[1] w w2(N-1) = [F] H[N-1] k=0k=1 k=N-1 2π π w = ei N F HF = FΛ Λ Λ contains the Fourier coefficients H[k] = ¦ h[n]e-i 2π πk Nn n ¦ ¦ h[n - ]x[]e-i n If x[] = ei 2π π k0 N 2π πk Nn = H[k]X[k] X[k] = δ[k – k0] H[k]X[k] = H[k0]X[k] 6 3 3) Symmetric Extension 1) Whole point symmetry – when filter is whole point symmetric. 2) Half point symmetry – when filter is half point symmetric. e.g. Whole point symmetry: filter and signal h0 h1 h1x2 + h0x1 + h1x0 h1x1 + h0x0 + h1x1 h1 h0 h1 = h1x0 + h0x1 + h1x2 h1 h0 h1 x2 x1 x0 x1 x2 7 e.g. whole point symmetry – filter, half-point symmetry - signal h1x2 + h1x1 + h1x0 + h1x0 + h0x1 + h1x0 h0x0 + h1x0 h0x0 + h1x1 h0x1 + h1x2 Half point symmetry h1 h0 h1 h1 h0 h1 = h1 h0 h1 x2 x1 x0 x0 x1 x2 Whole point symmetry 8 4 Downsampling a whole-point symmetric signal with even length N at the left boundary: x x -2 -1 0 1 still whole-point symmetric after ↓2. 2 at the right boundary: x x half-point symmetric after ↓2. x N-1 odd E.g. 9/7 filter: whole-point symmetric use the above extension for signal N N/2 exactly N/2 9 Downsample a half-point symmetric signal x x -3 -2 -1 0 1 x nothing guaranteed 2 Linear-phase filters ωα H(ω ω) = A(ω ω)e-iωα 1) half-point symmetric, α = fraction 2) whole-point symmetric, α = integer Symmetric extension of finite-length signal ωβ X(ω ω) = B(ω ω)e-iωβ 10 5 The output: Y(ω ω) = H(ω ω)X(ω ω) W W H H W H H W W H W H W = whole-point symmetry H = half-point symmetry The above extensions ensure the continuity of function values at boundaries, but not the continuity of derivatives at boundaries. 11 4) Polynomial Extrapolation (not useful in image processing) • Useful for PDE with boundary conditions. x0 x1 0 1 x2 x3 4 coefficients fits up to 3rd order polynomials. 2 3 a + bn + cn2 + dn3 = x(n) 1 0 0 0 1 1 1 1 1 2 22 23 1 3 32 33 A a b c d = x0 x1 x2 x3 12 6 Then, x–1 = [1 -1 1 -1] a b = [1 -1 1 -1] A–1 c d x0 x1 x2 x3 PDE f(x) = ¦ ckφ(x – k) k Assume f(x) has polynomial behavior near boundaries p-1 ¦ αixi = f(x) = ¦ ckφ(x – k) k i=0 {φ φ (•• - k)} orthonormal p-1 ¦ αi ³ φ(x – k)xidx = ck i=0 µik 13 µ00 µ10 µ p-1 0 α0 µ01 µ11 µ21 α1 c0 = αp-1 c1 cp-1 Using the computed αi’s, we can extrapolate, α0 0 1 p-1 µ–1 µ –1 µ –1 ] e.g. c–1 = [µ αp-1 DCT idea of symmetric extension cf. DFT X[k] = ¦ x[n]e-i n complex-valued 2π πk n N Want real-valued results. 14 7 1 0 N-1 N 2N-1 2N DFT of this extended signal: N-1 2π πk 2N-1 2π πk ¦ x[n]e–i 2N n + ¦ x[2N-1-n]e-i 2N n n=N n=0 N-1 2π πk ¦ x[m]e-i 2N (2N-1-m) m=0 N-1 2π πk 2π πk = ¦ x[n] {e-i 2N n + e-i 2N (2N-1-n)} N-1 ck ¦ ¥N2 x[n]cos n=0 πk (n+½) N n=0 X(k) ck = 1 DCT – II used in JPEG ¥2 k=0 1 k = 1, 2, …, N - 1 15 8