Single-level inverse discrete 2-D wavelet transform (periodized).
Syntax
X = idwtper2(cA,cH,cV,cD,'wname')
X = idwtper2(cA,cH,cV,cD,Lo_R,Hi_R)
X = idwtper2(cA,cH,cV,cD,'wname',S)
X = idwtper2(cA,cH,cV,cD,Lo_R,Hi_R,S)
Description
idwtper2 is a two-dimensional wavelet analysis function.
X = idwtper2(cA,cH,cV,cD,'wname') returns the single-level reconstructed approximation coefficients vector X based on approximation and details vectors cA, cH, cV, and cD at a given level, using the periodized inverse wavelet transform. 'wname' is a string containing the wavelet name (see wfilters).
Instead of giving the wavelet name, you can give the filters.
For X = idwtper2(cA,cH,cV,cD,Lo_R,Hi_R), Lo_R is the reconstruction low-pass filter and Hi_R is the reconstruction high-pass filter.
If sa = size(cA) = size(cH) = size(cV) = size(cD), then size(X) = 2*sa.
For X = idwtper2(cA,cH,cV,cD,'wname',S) or
X = idwtper2(cA,cH,cV,cD,Lo_R,Hi_R,S), S is the size of the result.
idwtper2 is the inverse function of dwtper2 in the sense the abstract statement idwtper2(dwtper2(X,'wname'),'wname') gets back to X.
Examples
% Set initial signal and get filters.
load tire
% X contains the loaded image.
sx = size(X)
sx =
205 232
w = 'db9';
[Lo_D,Hi_D,Lo_R,Hi_R] = wfilters(w);
% DWT with zero-padding image extension.
[ca0,ch0,cv0,cd0] = dwt2(X,w);
% The transform uses some extra coefficients.
sxtzp = 2*size(ca0)
sxtzp =
222 248
% Reconstruction.
x0 = idwt2(ca0,ch0,cv0,cd0,w,sx);
% Error with zero-padding.
err0 = max(max(abs(X-x0)))
err0 =
6.3292e-09
% Periodized DWT.
[cap,chp,cvp,cdp] = dwtper2(X,w);
% The transform uses a minimum of extra coefficients.
lxtp = 2*size(cap)
lxtp =
206 232
% Reconstruction.
xp = idwtper2(cap,chp,cvp,cdp,w,sx);
% Error with periodized DWT.
errp = max(max(abs(X-xp)))
errp =
6.7353e-09
Note: In general, the following abstract statement is not true: idwtper2(dwt2(X,'wname'),'wname') = X.
See Also
dwtper2
[ Previous | Help Desk | Next ]