# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# idwt2

Single-level inverse discrete 2-D wavelet transform

## Syntax

```X = idwt2(cA,cH,cV,cD,'wname') X = idwt2(cA,cH,cV,cD,Lo_R,Hi_R) X = idwt2(cA,cH,cV,cD,'wname',S) X = idwt2(cA,cH,cV,cD,Lo_R,Hi_R,S) idwt2(cA,cH,cV,cD,'wname') X = idwt2(...,'mode',MODE) X = idwt2(cA,[],[],[],...) X = idwt2([],cH,[],[],...) ```

## Description

The `idwt2` command performs a single-level two-dimensional wavelet reconstruction with respect to either a particular wavelet (`'wname'`, see `wfilters` for more information) or particular wavelet reconstruction filters (`Lo_R` and `Hi_R`) that you specify.

`X = idwt2(cA,cH,cV,cD,'wname')` uses the wavelet `'wname'` to compute the single-level reconstructed approximation coefficients matrix `X`, based on approximation matrix `cA` and details matrices `cH`,`cV`, and `cD` (horizontal, vertical, and diagonal, respectively).

`X = idwt2(cA,cH,cV,cD,Lo_R,Hi_R)` reconstructs as above, using filters that you specify.

• `Lo_R` is the reconstruction low-pass filter.

• `Hi_R` is the reconstruction high-pass filter.

`Lo_R` and `Hi_R` must be the same length.

Let `sa = size(cA) = size(cH) = size(cV) = size(cD)` and `lf` the length of the filters; then `size(X) = SX`, where ```SX = 2* SA```, if the DWT extension mode is set to periodization. For the other extension modes, `SX = 2*size(cA)-lf+2`.

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

`X = idwt2(cA,cH,cV,cD,'wname',S)` and ```X = idwt2(cA,cH,cV,cD,Lo_R,Hi_R,S)``` return the size-`S` central portion of the result obtained using the syntax `idwt2(cA,cH,cV,cD,'wname')`. `S` must be less than `SX`.

`X = idwt2(...,'mode',MODE)` computes the wavelet reconstruction using the extension mode `MODE` that you specify.

`X = idwt2(cA,[],[],[],...)` returns the single-level reconstructed approximation coefficients matrix `X` based on approximation coefficients matrix `cA`.

`X = idwt2([],cH,[],[],...)` returns the single-level reconstructed detail coefficients matrix `X` based on horizontal detail coefficients matrix `cH`.

The same result holds for `X = idwt2([],[],cV,[],...)` and
`X = idwt2([],[],[],cD,...)`, based on vertical and diagonal details.

More generally, `X = idwt2(AA,HH,VV,DD,...)` returns the single-level reconstructed matrix `X`, where `AA` can be `cA` or `[]`, and so on.

`idwt2` is the inverse function of `dwt2` in the sense that the abstract statement
`idwt2(dwt2(X,'wname'),'wname')` would give back `X`.

## Examples

```% The current extension mode is zero-padding (see `dwtmode`). % Load original image. load woman; % X contains the loaded image. sX = size(X); % Perform single-level decomposition % of X using db4. [cA1,cH1,cV1,cD1] = dwt2(X,'db4'); % Invert directly decomposition of X % using coefficients at level 1. A0 = idwt2(cA1,cH1,cV1,cD1,'db4',sX); % Check for perfect reconstruction. max(max(abs(X-A0))) ans = 3.4176e-10 ```

## Tips

If cA,cH,cV,cD are obtained from an indexed image analysis or a truecolor image analysis, they are `m`-by-`n` matrices or `m`-by-`n`-by-3 arrays, respectively.

For more information on image formats, see the `image` and `imfinfo` reference pages.