Single-level discrete 2-D wavelet transform

`[cA,cH,cV,cD] = dwt2(X,`

* 'wname'*)

[cA,cH,cV,cD] = dwt2(X,Lo_D,Hi_D)

[cA,cH,cV,cD] = dwt2(...,'mode',MODE)

The `dwt2`

command performs
a single-level two-dimensional wavelet decomposition. Compare this
function to `wavedec2`

, which
may be more useful for your application. The decomposition is done
with respect to either a particular wavelet (* 'wname'*,
see

`wfilters`

for more information)
or particular wavelet decomposition filters (`Lo_D`

and `Hi_D`

)
you specify.`[cA,cH,cV,cD] = dwt2(X,`

computes
the approximation coefficients matrix * 'wname'*)

`cA`

and details
coefficients matrices `cH`

, `cV`

,
and `cD`

(horizontal, vertical, and diagonal, respectively),
obtained by wavelet decomposition of the input matrix `X`

.
The `'wname'`

`[cA,cH,cV,cD] = dwt2(X,Lo_D,Hi_D)`

computes
the two-dimensional wavelet decomposition as above, based on wavelet
decomposition filters that you specify.

`Lo_D`

is the decomposition low-pass filter.`Hi_D`

is the decomposition high-pass filter.

`Lo_D`

and `Hi_D`

must be
the same length.

Let `sx = size(X)`

and `lf = `

the
length of filters; then `size(cA) = size(cH) = size(cV) = size(cD) = sa`

where ```
sa
= ceil(sx/2)
```

, if the DWT extension mode is set to periodization.
For the other extension modes, `sa = floor((sx+lf-1)/2)`

.

For information about the different Discrete Wavelet Transform
extension modes, see `dwtmode`

.

`[cA,cH,cV,cD] = dwt2(...,'mode',MODE)`

computes
the wavelet decomposition with the extension mode `MODE`

that
you specify.

`MODE`

is a string containing the desired extension
mode.

An example of valid use is

[cA,cH,cV,cD] = dwt2(x,'db1','mode','sym');

This example shows how to obtain the 2-D DWT of an image.

Load the "woman" image and obtain the 2-D DWT using the 'sym4' wavelet. Use the periodic extension mode.

load woman; wname = 'sym4'; [CA,CH,CV,CD] = dwt2(X,wname,'mode','per');

Display the vertical detail image and the lowpass approximation.

subplot(211) imagesc(CV); title('Vertical Detail Image'); colormap gray; subplot(212) imagesc(CA); title('Lowpass Approximation');

Daubechies, I. (1992), *Ten lectures on wavelets*,
CBMS-NSF conference series in applied mathematics. SIAM Ed.

Mallat, S. (1989), "A theory for multiresolution signal
decomposition: the wavelet representation," *IEEE
Pattern Anal. and Machine Intell.*, vol. 11, no. 7,
pp. 674–693.

Meyer, Y. (1990), *Ondelettes et opérateurs*,
Tome 1, Hermann Ed. (English translation: *Wavelets and operators*,
Cambridge Univ. Press. 1993.)

Was this topic helpful?