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
be the mother wavelet and
the scaling function,
and
,
.
The two dimensional basis is given by the collection of functions
Let H1 be the low-pass filter (followed by downsampling)
corresponding to
,
acting columnwise (independently on
different columns), G1 the high-pass filter corresponding to
;
H2 and G2 act row-wise.
Then the output of fwt2
5
is partitioned as follows:
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),
,
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
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).
The different operators correspond to the following integral operators (the matrices are simply a naive discretization of the operator):
,
i.e., the matrix is
,
where
,