Main Content

# idwt3

Single-level 3-D inverse discrete wavelet transform

## Syntax

``X = idwt3(wt)``
``C = idwt3(wt,type)``

## Description

example

````X = idwt3(wt)` returns the single-level reconstructed 3-D array `X` based on the single-level three-dimensional wavelet decomposition structure `wt`.```
````C = idwt3(wt,type)` returns the single-level reconstructed component of specified `type`.```

## Examples

collapse all

Create a 3-D array.

```X = reshape(1:64,4,4,4); tiledlayout(2,2) for k=1:4 nexttile imagesc(X(:,:,k)) title("k = "+num2str(k)) colorbar end```

Decompose `X` using the Haar wavelet.

`wt = dwt3(X,"haar");`

Reconstruct `X` from the coefficients. Verify that the reconstructed data agrees with the original data to machine precision.

```XR = idwt3(wt); dff = max(abs(X(:)-XR(:)))```
```dff = 3.5527e-14 ```

Compute the reconstructed approximation, which consists of the lowpass component.

`A = idwt3(wt,"aaa");`

Compute the sum of all the components different from the lowpass component. Visualize the reconstruction.

```D = idwt3(wt,"d"); tiledlayout(2,2) for k=1:4 nexttile imagesc(D(:,:,k)) title("k = "+num2str(k)) colorbar end```

Reconstruct the component associated with lowpass in the x and z directions and highpass in the y direction.

`ADA = idwt3(wt,"ada");`

## Input Arguments

collapse all

Single-level 3-D wavelet decomposition, specified as a structure with these fields:

 `sizeINI` Size of the three-dimensional array `X`. `mode` Name of the wavelet transform extension mode. `filters` Structure with four fields: `LoD`, `HiD`, `LoR`, `HiR`, which are the filters used for DWT. `dec` 2-by-2-by-2 cell array containing the coefficients of the decomposition.`dec{i,j,k}`, where `i`, `j`, and `k` equal `1` or `2`, contains the coefficients obtained by lowpass filtering (for `i`, `j`, or `k` equal to `1`) or highpass filtering (for `i`, `j`, `k` equal to `2`).The `i` element filters along the rows of `X`, the `j` element filters along the columns, and the `k` element filters along the third dimension. For example, `dec{1,2,1}` is obtained by filtering `X` along the rows with the lowpass (scaling) filter, along the columns with the highpass (wavelet) filter, and along the third dimension with the lowpass (scaling) filter.

Type of reconstruction, specified as a character vector or string scalar. Valid values of `type` are these:

• A group of three characters `'xyz'`, one per direction, with each character selected in the set {`'a'`, `'d'`, `'l'`, `'h'`} or in the corresponding uppercase set {`'A'`,`'D'`, `'L'`, `'H'`}, where `'A'` (or `'L'`) is a lowpass filter and `'D'` (or `'H'`) is a highpass filter.

• The char `'d'` (or `'h'` or `'D'` or `'H'`) gives the sum of all the components different from the lowpass component.

Data Types: `char` | `string`

## Output Arguments

collapse all

Reconstruction, returned as a 3-D array.

Reconstructed component of specified `type`, returned as a 3-D array.

## Version History

Introduced in R2010a