Wavelet Toolbox |

Direct reconstruction from 2-D wavelet coefficients

**Syntax **

Y = upcoef2(O,X,'

',N,S) Y = upcoef2(O,X,Lo_R,Hi_R,N,S) Y = upcoef2(O,X,'*wname*

',N) Y = upcoef2(O,X,Lo_R,Hi_R,N) Y = upcoef2(O,X,'*wname*

') Y = upcoef2(O,X,Lo_R,Hi_R)*wname*

**Description **

`upcoef2`

is a two-dimensional wavelet analysis function.

`Y = upcoef2(O,X,`

'

'*wname*`,N,S)`

computes the `N`

-step reconstructed coefficients of matrix `X`

and takes the central part of size `S`

. '

' is a string containing the name of the wavelet. See *wname*`wfilters`

for more information.

If `O`

= 'a', approximation coefficients are reconstructed; otherwise if `O`

= `'h' `

(`'v'`

or `'d'`

,` `

respectively), horizontal (vertical or diagonal, respectively) detail coefficients are reconstructed. `N`

must be a strictly positive integer.

Instead of giving the wavelet name, you can give the filters.

For `Y = upcoef2(O,X,`

Lo_R`,`

Hi_R`,N,S)`

, Lo_R is the reconstruction low-pass filter and Hi_R is the reconstruction high-pass filter.

`Y = upcoef2(O,X,`

'

'*wname*`,N)`

or `Y = upcoef2(O,X,`

Lo_R`,`

Hi_R`,N)`

returns the computed result without any truncation.

`Y = upcoef2(O,X,`

'

'*wname*`)`

is equivalent to` Y = upcoef2(O,X,`

'

'*wname*`,1)`

.

`Y = upcoef2(O,X,`

Lo_R`,`

Hi_R`)`

is equivalent to `Y = upcoef2(O,X,`

Lo_R`,`

Hi_R`,1)`

.

**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 db4. [c,s] = wavedec2(X,2,'db4'); % Reconstruct approximation and details % at level 1, from coefficients. % This can be done using wrcoef2, or % equivalently using: % % Step 1: Extract coefficients from the % decomposition structure [c,s]. % % Step 2: Reconstruct using upcoef2. siz = s(size(s,1),:); ca1 = appcoef2(c,s,'db4',1); a1 = upcoef2('a',ca1,'db4',1,siz); chd1 = detcoef2('h',c,s,1); hd1 = upcoef2('h',chd1,'db4',1,siz); cvd1 = detcoef2('v',c,s,1); vd1 = upcoef2('v',cvd1,'db4',1,siz); cdd1 = detcoef2('d',c,s,1); dd1 = upcoef2('d',cdd1,'db4',1,siz);

**Algorithm **

See `upcoef`

.

**See Also**

```
idwt2
```

upcoef | upwlev |