Connexions

You are here: Home » Content » Finite-Length Sequences and the DWT Matrix
Content Actions

Finite-Length Sequences and the DWT Matrix

Module by: Phil Schniter

Summary: Discrete-time implementation of the DWT.

The wavelet transform, viewed from a filterbank perspective, consists of iterated 2-channel analysis stages like the one in Figure 1.
wavelet_2channel.png
Figure 1
First consider a very long (i.e., practically infinite-length) sequence { c k m|m} c k m m . For every pair of input samples c k 2n c k 2n-1 c k 2 n c k 2 n 1 that enter the k th k th filterbank stage, exactly one pair of output samples c k + 1 n d k + 1 n c k + 1 n d k + 1 n are generated. In other words, the number of output equals the number of input during a fixed time interval. This property is convenient from a real-time processing perspective.
For a short sequence { c k m|m0M-1} c k m m 0 M 1 , however, linear convolution requires that we make an assumption about the tails of our finite-length sequence. One assumption could be
m,m0M-1: c k m=0 m m 0 M 1 c k m 0 (1)
In this case, the linear convolution implies that MM nonzero inputs yield M+N2-1 M N 2 1 outputs from each branch, for a total of 2M+N2-1=M+N-2>M 2 M N 2 1 M N 2 M outputs. Here we have assumed that both Hz-1 H z and Gz-1 G z have impulse response lengths of N>2 N 2 , and that MM and NN are both even. The fact that each filterbank stage produces more outputs than inputs is very disadvantageous in many applications.
A more convenient assumption regarding the tails of { c k m|m0M-1} c k m m 0 M 1 is that the data outside of the time window 0M-1 0 M 1 is a cyclic extension of data inside the time window. In other words, given a length-MM sequence, the points outside the sequence are related to points inside the sequences via
c k m= c k m+M c k m c k m M (2)
Recall that a linear convolution with an MM-cyclic input is equivalent to a circular convolution with one MM-sample period of the input sequences. Furthermore, the output of this circular convolution is itself MM-cyclic, implying our 2-downsampled branch outputs are cyclic with period M2 M 2 . Thus, given an MM-length input sequence, the total filterbank output consists of exactly MM values.
It is instructive to write the circular-convolution analysis fiterbank operation in matrix form. In Equation 3 we give an example for filter length N=4 N 4 , sequence length N=8 N 8 , and causal synthesis filters Hz H z and Gz G z .
c k + 1 0 c k + 1 1 c k + 1 2 c k + 1 3 d k + 1 0 d k + 1 1 d k + 1 2 d k + 1 3=h0h1h2h3000000h0h1h2h3000000h0h1h2h3h2h30000h0h1g0g1g2g3000000g0g1g2g3000000g0g1g2g3g2g30000g0g1 c k 0 c k 1 c k 2 c k 3 c k 4 c k 5 c k 6 c k 7 c k + 1 0 c k + 1 1 c k + 1 2 c k + 1 3 d k + 1 0 d k + 1 1 d k + 1 2 d k + 1 3 h 0 h 1 h 2 h 3 0 0 0 0 0 0 h 0 h 1 h 2 h 3 0 0 0 0 0 0 h 0 h 1 h 2 h 3 h 2 h 3 0 0 0 0 h 0 h 1 g 0 g 1 g 2 g 3 0 0 0 0 0 0 g 0 g 1 g 2 g 3 0 0 0 0 0 0 g 0 g 1 g 2 g 3 g 2 g 3 0 0 0 0 g 0 g 1 c k 0 c k 1 c k 2 c k 3 c k 4 c k 5 c k 6 c k 7 (3)
where c k + 1 d k + 1 = c k + 1 0 c k + 1 1 c k + 1 2 c k + 1 3 d k + 1 0 d k + 1 1 d k + 1 2 d k + 1 3 c k + 1 d k + 1 c k + 1 0 c k + 1 1 c k + 1 2 c k + 1 3 d k + 1 0 d k + 1 1 d k + 1 2 d k + 1 3 H M G M =h0h1h2h3000000h0h1h2h3000000h0h1h2h3h2h30000h0h1g0g1g2g3000000g0g1g2g3000000g0g1g2g3g2g30000g0g1 H M G M h 0 h 1 h 2 h 3 0 0 0 0 0 0 h 0 h 1 h 2 h 3 0 0 0 0 0 0 h 0 h 1 h 2 h 3 h 2 h 3 0 0 0 0 h 0 h 1 g 0 g 1 g 2 g 3 0 0 0 0 0 0 g 0 g 1 g 2 g 3 0 0 0 0 0 0 g 0 g 1 g 2 g 3 g 2 g 3 0 0 0 0 g 0 g 1 c k = c k 0 c k 1 c k 2 c k 3 c k 4 c k 5 c k 6 c k 7 c k c k 0 c k 1 c k 2 c k 3 c k 4 c k 5 c k 6 c k 7 The matrices H M H M and G M G M have interesting properties. For example, the conditions δm=nhnhn-2m δ m n n h n h n 2 m gn=-1nhN-1-n g n -1 n h N 1 n imply that H M G M T H M G M = H M G M H M G M T= I M H M G M H M G M H M G M H M G M I M where I M I M denotes the MMxMM identity matrix. Thus, it makes sense to define the MMxMM DWT matrix as
T M = H M G M T M H M G M (4)
whose transpose constitutes the MMxMM inverse DWT matrix:
T M -1= T M T T M T M (5)
Since the synthesis filterbank (Figure 2)
syn_filterbank.png
Figure 2
gives perfect reconstruction, and since the cascade of matrix operations T M T T M T M T M also corresponds to perfect reconstruction, we expect that the matrix operation T M T T M describes the action of the synthesis filterbank. This is readily confirmed by writing the upsampled circular convolutions in matrix form:
c k 0 c k 1 c k 2 c k 3 c k 4 c k 5 c k 6 c k 7=h000h2g000g2h100h3g100g3h2h000g2g000h3h100g3g1000h2h000g2g000h3h100g3g1000h2h000g2g000h3h100g3g1 c k + 1 0 c k + 1 1 c k + 1 2 c k + 1 3 d k + 1 0 d k + 1 1 d k + 1 2 d k + 1 3 c k 0 c k 1 c k 2 c k 3 c k 4 c k 5 c k 6 c k 7 h 0 0 0 h 2 g 0 0 0 g 2 h 1 0 0 h 3 g 1 0 0 g 3 h 2 h 0 0 0 g 2 g 0 0 0 h 3 h 1 0 0 g 3 g 1 0 0 0 h 2 h 0 0 0 g 2 g 0 0 0 h 3 h 1 0 0 g 3 g 1 0 0 0 h 2 h 0 0 0 g 2 g 0 0 0 h 3 h 1 0 0 g 3 g 1 c k + 1 0 c k + 1 1 c k + 1 2 c k + 1 3 d k + 1 0 d k + 1 1 d k + 1 2 d k + 1 3 (6)
where H M T G M T= T M T=h000h2g000g2h100h3g100g3h2h000g2g000h3h100g3g1000h2h000g2g000h3h100g3g1000h2h000g2g000h3h100g3g1 H M G M T M h 0 0 0 h 2 g 0 0 0 g 2 h 1 0 0 h 3 g 1 0 0 g 3 h 2 h 0 0 0 g 2 g 0 0 0 h 3 h 1 0 0 g 3 g 1 0 0 0 h 2 h 0 0 0 g 2 g 0 0 0 h 3 h 1 0 0 g 3 g 1 0 0 0 h 2 h 0 0 0 g 2 g 0 0 0 h 3 h 1 0 0 g 3 g 1 So far we have concentrated on one stage in the wavelet decomposition; a two-stage decomposition is illustrated in Figure 3.
wavelet_decomp.png
Figure 3
The two-stage analysis operation (assuming circular convolution) can be expressed in matrix form as
c k + 2 d k + 2 d k + 1 = T M 2 00 I M 2 c k + 1 d k + 1 = T M 2 00 I M 2 T M c k c k + 2 d k + 2 d k + 1 T M 2 0 0 I M 2 c k + 1 d k + 1 T M 2 0 0 I M 2 T M c k (7)
Similarly, a three-stage analysis could be implemented via
c k + 3 d k + 3 d k + 2 d k + 1 = T M 4 000 I M 4 000 I M 2 T M 2 00 I M 2 T M c k c k + 3 d k + 3 d k + 2 d k + 1 T M 4 0 0 0 I M 4 0 0 0 I M 2 T M 2 0 0 I M 2 T M c k (8)
It should now be evident how to extend this procedure to >3 3 stages. As noted earlier, the corresponding synthesis operations are accomplished by transposing the matrix products used in the analysis.

Comments, questions, feedback, criticisms?

Send feedback