# wavefun2

Wavelet and scaling functions 2-D

## Syntax

``[s,w1,w2,w3,xyval] = wavefun2(wname,iter)``
``[s,w1,w2,w3,xyval] = wavefun2(wname,iter,'plot')``
``[___] = wavefun2(wname,a,b)``

## Description

````[s,w1,w2,w3,xyval] = wavefun2(wname,iter)` returns an approximation `s` of the 2-D scaling function and approximations `w1`, `w2`, and `w3` of the three 2-D wavelet functions associated with the orthogonal wavelet `wname`. `xyval` is a 2-D grid of points. The positive integer `iter` specifies the number of iterations.The approximations are the tensor products of the one-dimensional scaling and wavelet functions associated with the orthogonal wavelet `wname`. For more information, see Algorithms.```
````[s,w1,w2,w3,xyval] = wavefun2(wname,iter,'plot')` also plots the functions.```

example

````[___] = wavefun2(wname,a,b)` returns the approximations using `max(a,b)` iterations. The `wavefun2` function also plots the approximations. `wavefun2(wname,0)` is equivalent to `wavefun2(wname,4,0)`.`wavefun2(wname)` is equivalent to `wavefun2(wname,4)`. ```

## Examples

collapse all

Specify an orthogonal wavelet.

`wav = "sym4";`

Obtain and plot the approximations of the 2-D scaling function and wavelets. Specify four iterations.

```iter = 4; [s,w1,w2,w3,xyval] = wavefun2(wav,iter,0);```

Obtain the wavelet approximation corresponding to the $\left(\varphi ,\psi \right)$ tensor product using one iteration. Compare with the first approximation.

```[~,w1x] = wavefun2(wav,1); tiledlayout(1,2) nexttile imagesc(w1) title("Four Iterations") nexttile imagesc(w1x) title("One Iteration")```

## Input Arguments

collapse all

Orthogonal wavelet, specified as a character vector or string scalar. For a list of orthogonal wavelets, see `wfilters`.

Data Types: `char` | `string`

Number of iterations to use to generate the wavelet and scaling function approximations, specified as a positive integer. Larger values of `iter` increase the refinement of the approximations.

Data Types: `double`

Iteration, specified as a pair of positive integers. The number of iterations is equal to `max(a,b)`.

## Output Arguments

collapse all

2-D scaling function approximation, returned as a matrix. For more information, see Algorithms.

2-D wavelet function approximations, returned as matrices. For more information, see Algorithms.

## Algorithms

The `wavefun2` function returns approximations of the 2-D scaling function and the three 2-D wavelet functions resulting from the tensor products of the one-dimensional scaling and wavelet functions associated with the orthogonal wavelet `wname`.

If ```[phi,psi,xval] = wavefun(wname,iter)```, then:

• `s` is the tensor product of `phi` and `phi`.

• `w1`, `w2`, and `w` are the tensor products (`phi`,`psi`), (`psi`,`phi`), and (`psi`,`psi`), respectively.

• `xyval` is the tensor product (`xval`,`xval`).

For more information, see `wavefun`.

## References

[1] Daubechies, I. Ten Lectures on Wavelets. CBMS-NSF Regional Conference Series in Applied Mathematics. Philadelphia, PA: Society for Industrial and Applied Mathematics, 1992.

[2] Strang, G., and T. Nguyen. Wavelets and Filter Banks. Wellesley, MA: Wellesley-Cambridge Press, 1996.

## Version History

Introduced before R2006a