appcoef2

2-D approximation coefficients

Syntax

```A = appcoef2(C,S,'wname',N)A = appcoef2(C,S,'wname')A = appcoef2(C,S,Lo_R,Hi_R)A = appcoef2(C,S,Lo_R,Hi_R,N)```

Description

`appcoef2` is a two-dimensional wavelet analysis function. It computes the approximation coefficients of a two-dimensional signal. The syntaxes allow you to give the wavelet name or the filters as inputs.

`A = appcoef2(C,S,'wname',N)` computes the approximation coefficients at level `N` using the wavelet decomposition structure [`C`,`S`] (see `wavedec2` for more information).

`'wname'`is a string containing the wavelet name. Level `N` must be an integer such that `0 `` N `` size(S,1)-2`.

`A = appcoef2(C,S,'wname')` extracts the approximation coefficients at the last level: `size(S,1)-2`.

`A = appcoef2(C,S,Lo_R,Hi_R)` or ```A = appcoef2(C,S,Lo_R,Hi_R,N)```, `Lo_R` is the reconstruction low-pass filter and `Hi_R` is the reconstruction high-pass filter (see `wfilters` for more information).

Examples

```% The current extension mode is zero-padding (see dwtmode). % Load original image. load woman; % X contains the loaded image. % Perform decomposition at level 2 % of X using db1. [c,s] = wavedec2(X,2,'db1'); sizex = size(X) sizex = 256 256 sizec = size(c) sizec = 1 65536 val_s = s val_s = 64 64 64 64 128 128 256 256 % Extract approximation coefficients % at level 2. ca2 = appcoef2(c,s,'db1',2); sizeca2 = size(ca2) sizeca2 = 64 64 % Compute approximation coefficients % at level 1. ca1 = appcoef2(c,s,'db1',1); sizeca1 = size(ca1) sizeca1 = 128 128 ```

collapse all

Tips

If `C` and `S` are obtained from an indexed image analysis or a truecolor image analysis, `A` is an `m`-by-`n` matrix or an `m`-by-`n`-by-3 array, respectively.

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

Algorithms

The algorithm is built on the same principle as `appcoef`.