next up previous contents
Next: Two-dimensional: tensor products Up: Fast wavelet transforms Previous: One-dimensional

  
Two-dimensional

There are two different ways to compute the wavelet transform of two-dimensional data. We first describe an approach that results in isotropic basis functions.

Let $\psi$ be the mother wavelet and $\varphi$ the scaling function, and $\psi_{jk}(x) = 2^{j/2}\psi(2^jx-k)$, $\varphi_{jk}(x) = 2^{j/2}\varphi(2^jx-k)$. The two dimensional basis is given by the collection of functions

\begin{displaymath}\psi_{jk}(x) \psi_{jk'}(y), \quad
\varphi_{jk}(x) \psi_{jk'}(y), \quad
\psi_{jk}(x) \varphi_{jk'}(y).
\end{displaymath}

Note that these functions have the same scale in both x- and y-variables (j is the same in both factors).

Let H1 be the low-pass filter (followed by downsampling) corresponding to $\varphi$, acting columnwise (independently on different columns), G1 the high-pass filter corresponding to $\psi$; H2 and G2 act row-wise. Then the output of fwt2 5 is partitioned as follows:

\begin{displaymath}\left[
\begin{array}{c\vert c}
\cdots & G_1 H_2 \\ \hline
H_1 G_2 & G_1 G_2
\end{array} \right],
\end{displaymath}

where the three blocks shown have size half the size of the original matrix and the upper left corner contains the same structure recursively (the upper left element of the matrix is $H_1\cdots H_1
H_2\cdots H_2$).

        FWT2 -- two dimensional fast wavelet transform
        
        A = fwt2(s, h, g)
        
        Input:
          s     original matrix 
          h,g   filter coefficients for the scaling function and wavelet
        
        Output:
          A     resulting two dimensional multi-scale analysis
        
        See also IFWT2, FWT1, FWT1NS, FWT2TNS, FWT2NS.

The inverse transform is:

        IFWT2 -- two dimensional inverse wavelet transform
        
        A = ifwt2ns(w, h, g)
        
        Input:
          w     two dimensional wavelet coefficients
          h,g   filter coefficients for the scaling function and wavelet
        
        Output:
          A     inverse transform of w
        
        See also FWT2, IFWT2TNS, FWT2TNS, IFWT1, IFWT1NS.

The function showoper displays the matrix containing the wavelet coefficients (actually any matrix) and nsgrid can be used to superimpose a grid that explains how the matrix is partitioned. The color or gray level indicates the magnitude of the corresponding element in the matrix.

Example: the transform of the matrix defined by Aij = 1/(i-j), $i\not=j$, and Aii=0.

        [h,g] = wavecoef('coi',30);
        [i,j] = meshgrid(0:63);
        A = 1./(i-j);  A(1:65:64^2) = zeros(1,64);
        W = fwt2(A,h,g);
        showoper(W);  nsgrid

pict/matlab/gif/fwt2.gif

The demo wav2demo allows the user to graph the basis functions that are effectively used by this algorithm (see the next section for more information). Another demo, wavoperd, knows a few example matrices and provides choices for which wavelets and which type of basis to use. In figure 3, the left hand plot depicts the original matrix, the right hand plot is the transformed matrix. Red indicates large magnitudes, blue values close to zero (on a logarithmic scale).


  
Figure 3: wavoperd
pict/window/gif/web/dither/wavoperd.gif

The different operators correspond to the following integral operators (the matrices are simply a naive discretization of the operator):

These, and other matrices, are defined in the function nsexampl.



Footnotes

...fwt2 5
fwt2 is restricted to input matrices of size 2n by 2n.

next up previous contents
Next: Two-dimensional: tensor products Up: Fast wavelet transforms Previous: One-dimensional
Harri Ojanen
1998-05-02