Filter Banks 1 Orthonormal Transforms 2 Filters
Total Page:16
File Type:pdf, Size:1020Kb
Filter Banks 1 Orthonormal transforms Consider the transformation of a data vector x: y = Q x y0 q(0, 0) q(0, 1) ··· q(0,N − 1) x0 y1 q(1, 0) q(1, 1) ··· q(1,N − 1) x1 . = . . . . . yN−1 q(N − 1, 0) q(N − 1, 1) ··· q(N − 1,N − 1) xN−1 X y(k) = q(k, n) x(n) n If Q is an orthogonal matrix (meaning that Qt Q = I) then the data vector x can be recovered from y using the transpose of Q: x = Qt y x0 q(0, 0) q(1, 0) ··· q(N − 1, 0) y0 x1 q(0, 1) q(1, 1) ··· q(N − 1, 1) y1 . = . . . . . xN−1 q(0,N − 1) q(1,N − 1) ··· q(N − 1,N − 1) yN−1 X x(n) = q(k, n) y(k) k 2 Filters Consider a linear time-invariant system with impulse response h(n). (Is assumed in these notes that all impulses response h(n) are real-valued.) x(n) - h(n) - y(n) 1 The block diagram is represented in matrix form as .. . . . . . .. . h0 0 0 0 y0 x0 .. . h1 h0 0 0 y1 x1 . .. h h h 0 y2 2 1 0 x2 . y3 = h h h h .. · x3 3 2 1 0 y4 .. x4 0 h3 h2 h1 . y5 .. x5 0 0 h3 h2 . y6 . x6 0 0 0 h .. . 3 . . . .. | {z } Q The vectors are of infinite length. The matrix has infinitely many rows and infinitely many columns. We can write convolution as a matrix-vector multiplication: y(n) = h(n) ∗ x(n) ⇐⇒ y = Q x where Q is a convolution matrix. The matrix Q is also called a Toeplitz matrix — a Toeplitz matrix is constant along its diagonals. Note that the impulse response h(n) appears in each column of the matrix Q. What is the transpose of the linear time-invariant system with impulse response h(n)? Usually, we do not think about the transpose of a system. However, we can derive the transpose of the system by using the matrix representation. We just need to look at the transpose of the matrix Q. The columns of Q are the rows of Qt, so Qt has the following form: . .. .. . h3 0 0 0 . .. h h 0 0 2 3 . .. h h h 0 1 2 3 t . Q = h h h h .. 0 1 2 3 . .. 0 h0 h1 h2 . .. 0 0 h0 h1 .. 0 0 0 h0 . . .. We can observe that Qt is again a convolution matrix (it is constant along the diagonals). So Qt represents a linear time-invariant system. The impulse response of this system can be found by 2 looking at the columns of Qt, which we see is the flipped version of h(n). Therefore, Qt represents convolution by h(−n). y(n) - h(−n) - z(n) y = Q x ⇐⇒ y(n) = h(n) ∗ x(n) z = Qt y ⇐⇒ z(n) = h(−n) ∗ y(n) Can the filter h(n) represent an orthogonal transformation? Equivalently, is it possible that Qt is the inverse of Q? If Qt Q = I, then z = Qt y = Qt Q x = I x = x or z(n) = x(n). But z(n) = h(−n) ∗ y(n) (1) = h(−n) ∗ h(n) ∗ x(n) (2) so z(n) = x(n) only if h(−n) ∗ h(n) = δ(n). Note that h(−n) ∗ h(n) = δ(n) ⇐⇒ H(1/z) H(z) = 1 ⇐⇒ H(e−jω) H(ejω) = 1 ⇐⇒ |H(ejω)|2 = 1 That means H(z) must be an allpass system. The only orthonormal LTI systems are allpass systems. But they provide no frequency selective filtering — the allpass filter does not provide a subband decomposition of the signal x(n). 3 3 Downsampling The downsampler is a linear system, but it is not time-invariant. x(n) - ↓2 - y(n) y(n) = x(2n) The downsampler can also be represented in matrix form. . . . x0 . x 1 y0 ··· 1 0 0 0 0 0 0 ··· x2 y ··· 0 0 1 0 0 0 0 ··· 1 = · x3 y2 ··· 0 0 0 0 1 0 0 ··· x 4 y3 ··· 0 0 0 0 0 0 1 ··· . . x5 . x6 | {z } D . . We can write y = D x where D is the infinite matrix having the form shown. Note that the matrix D that represents downsampling is not a Toeplitz matrix — it is not constant along the diagonals. As we know, the downsampling operation can not be represented as a convolution. Lets see what the transpose of the downsampler is. We can do this by observing the form of the transpose of the matrix D, which has the following form: . . ··· 1 0 0 0 ··· ··· 0 0 0 0 ··· ··· 0 1 0 0 ··· t D = ··· 0 0 0 0 ··· ··· 0 0 1 0 ··· ··· 0 0 0 0 ··· ··· 0 0 0 1 ··· . . 4 The matrix Dt represents upsampling: z = Dt y ⇐⇒ z(n) = [↑2] y(n) Note that Dt D 6= I so therefore upsampling is not an orthogonal transformation. Indeed, when the matrix product Dt D is computed, we find that . . ··· 1 0 0 0 0 0 ··· ··· 0 0 0 0 0 0 ··· ··· 0 0 1 0 0 0 ··· t D D = ··· 0 0 0 0 0 0 ··· ··· 0 0 0 0 1 0 ··· ··· 0 0 0 0 0 0 ··· ··· 0 0 0 0 0 1 ··· . . So ( x(n) if n is even z = Dt D x ⇐⇒ z(n) = [↑2] [↓2] x(n) = 0 if n is odd Equivalently, Z(z) = 0.5 (X(z) + X(−z)). 4 Filtering with Downsampling Consider filtering followed by downsampling: x(n) - h(n) - ↓2 - y(n) y(n) = [↓2] (h(n) ∗ x(n)) X = h(k) x(2n − k) k What is the transpose of this system? We usually do not think about the transpose of a system, but we can do so by using the matrix representation of the system. In matrix form: y = Q x = Qb Qa x 5 where Qb is the downsampling matrix . . ··· 1 0 0 0 0 0 ··· Qb = ··· 0 0 1 0 0 0 ··· ··· 0 0 0 0 1 0 ··· . . and Qa is a convolution matrix. The matrix Q = Qb Qa that represents the total system has the following form. . . . .. . . x0 .. y . h0 0 0 0 0 0 x 0 1 .. y1 . h2 h1 h0 0 0 0 x2 y2 = 0 h3 h2 h1 h0 0 · x3 y .. x 3 0 0 0 h3 h2 h1 . 4 y4 .. x5 0 0 0 0 0 0 . . . .. x6 . . | {z } . Q Observe that the matrix Q is a convolution matrix with every second row deleted. The transpose t t t of Q is given by Q = Qb Qa, which has the following form: . .. .. . h3 0 0 .. . h2 0 0 .. . h1 h3 0 t h0 h2 0 Q = 0 h1 h3 .. 0 h0 h2 . .. 0 0 h1 . .. 0 0 h0 . . .. This matrix represents upsampling followed by filtering with h(−n). The equation z = Qt y is represented by the diagram: 6 y(n) - ↑2 - h(−n) - z(n) z(n) = h(−n) ∗ [↑2] y(n) X = y(k) h(2k − n) k So we have y = Q x ⇐⇒ y(n) = [↓2] (h(n) ∗ x(n)) and z = Qt y ⇐⇒ z(n) = h(−n) ∗ ([↑2] y(n)) Note that it is impossible to have z(n) = x(n) all the time, because in this system the downsampler throws out information; in which case it is impossible to recover a generic input signal x(n) from y(n). Equivalently, it is impossible to have Qt Q = I. Qt Q 6= I. So Q can not represent an orthonormal transform. 7 5 Two-Channel Analysis Filter Bank Consider a two-channel analysis filter bank. - h (n) - ↓2 - s (n) 0 0 x(n) - h (n) - ↓2 - s (n) 1 1 What is the transpose of this system? We can find it by finding first the matrix representation. To find the matrix representation, note that we already know the matrix representation of the two branches individually. s0 = Q0 x, s1 = Q1 x So the total system can be represented as a single matrix: " # " # " # s0 Q0 x Q0 = = x = Q x s1 Q1 x Q1 where " # Q0 Q = . Q1 The transpose of the two-channel analysis filter bank is therefore: t h t t i Q = Q0 Q1 and " # " # s s t 0 h t t i 0 t t y = Q = Q0 Q1 = Q0 s0 + Q1 s1 s1 s1 This corresponds to the diagram: s (n) - ↑2 - h (−n) 0 0 - y(n) s (n) - ↑2 - h (−n) 1 1 8 5.1 Orthogonality Conditions How can we choose the two filters h0(n), h1(n) so that the two-channel analysis filter bank represents an orthonormal transformation of x(n) (so that Qt Q = I)? In other words, how do we choose the filters so as to ensure that y(n) = x(n)? Look at Y (z) in terms of X(z). Using multirate identities we get: 1 1 Y (z) = H (1/z)[H (z) X(z) + H (−z) X(−z)] + H (1/z)[H (z) X(z) + H (−z) X(−z)] 2 0 0 0 2 1 1 1 or 1 1 Y (z) = [H (z) H (1/z) + H (z) H (1/z)] X(z) + [H (−z) H (1/z) + H (−z) H (1/z)] X(−z). 2 0 0 1 1 2 0 0 1 1 If y(n) = x(n), then Qt Q = I and the analysis filter bank represents an orthonormal transform. We have y(n) = x(n) only if Y (z) = X(z) so we must have: H0(z) H0(1/z) + H1(z) H1(1/z) = 2 (3) H0(−z) H0(1/z) + H1(−z) H1(1/z) = 0 (4) The problem is to find H0(z) and H1(z) that satisfy these two perfect reconstruction conditions.