2D Wavelet Packet Transform

DESCRIPTION:
Computes 2D wavelet packet transform.

USAGE:
wpt.2d(x, crystal.names=NULL, basis=NULL, cost.fun="entropy",
       wavelet="s8", n.levels=4, boundary="periodic", precondition=F,
       dual=F, analysis.filter=NULL, synthesis.filter=NULL,
       scale=NULL, thresh=NULL, p=2, prob=.75)
iwpt.2d(x)

REQUIRED ARGUMENTS:
x:
an image or a matrix, or, for iwpt.2d only, an object of wpt.2d.

OPTIONAL ARGUMENTS:
crystal.names:
a character vector of crystal names, see crystal.names for details. If crystal.names is supplied, then basis is ignored.
basis:
a character string specifying how the cosine packet basis is selected: "best.basis" or "dwt.2d". See the respective help files for details.
cost.fun:
character string indicating which cost functional to use: "entropy", "threshold", "sure", and "lp" are available. Only used for "best.basis". See wp.costs.2d for details.
wavelet:
a character string or a character vector of length two, which gives the name(s) of the wavelet(s). If the length of wavelet is one, the same wavelet is used for both rows and columns. See wavelet.packet for a list of all available wavelet names.
n.levels:
a non-negative integer specifying the blocking factor: x is divided into 2^(2*n.levels) nrow(x)/2^n.levels by ncol(x)/2^n.levels blocks. For "best.basis", n.levels gives the blocking factor for the finest level. When both crystal.names and basis are missing, 2D subband basis of n.levels is computed. If n.levels is bigger than ml, where ml is the maximum possible level, computed from the max.level function, then n.levels is set to ml and a warning message is given.
boundary:
a character string or a character vector of length two giving the name(s) of boundary rule(s). If the length of boundary is one, the same boundary rule is used for both row and column. All the boundary rules listed for dwt are available except for "infinite" and "polynomial". See dwt for the definitions of these rules.
precondition:
logical vector of length one or two: for boundary="interval" only. See dwt for details.
dual:
logical vector of length one or two indicating if dual filter is used for analysis instead of synthesis.
scale:
scaling factor for computing the costs. The default depends on cost.fun. See the function cp.costs.2d for details.
p:
a number in the interval (0,2] giving the degree of the lp norm when cost.fun is "lp". See the function cp.costs.2d for details.
thresh:
a non-negative number giving the threshold for when cost.fun is "threshold" or "sure". See the function cp.costs.2d for details.
prob:
a number in the interval (0,1) used to compute the threshold for when cost.fun is "threshold". See the function cp.costs.2d for details.

VALUE:
an object of class wpt.2d, inheriting from the class crystal.matrix. The object is a matrix of the same size as x with crystal names as an attribute.

iwpt.2d returns an image if x is an object of class wpt.2d.


DETAILS:
The default optional arguments n.levels, taper, dct.type, boundary can be reset using function wavelet.options. See wavelet.options for details.

REFERENCES:
Wickerhauser, M. V. (1994). Adapted Wavelet Analysis -- from theory to software.

SEE ALSO:
best.basis , dwt.2d , max.level , reconstruct , wavelet.options, wp.costs.2d .

EXAMPLES:
xx <- phone-mean(phone)
par(mfrow=c(1,2))
thresh <- rep(3.7, 16)
dd2 <- dwt.2d(xx, wavelet="s8", n.levels=3)
ss1 <- shrink(dd2, thresh)
zz1 <- reconstruct(ss1)
image(zz1)                     # reconstructed by DWT

cc2 <- wpt.2d(xx, basis="best.basis", wavelet="s8", n.levels=3) ss2 <- shrink(cc2, thresh) zz2 <- reconstruct(ss2) image(zz2) # reconstructed by best basis