wr {wavethresh}R Documentation

Discrete wavelet transform (reconstruction).

Description

This function performs the reconstruction stage of Mallat's pyramid algorithm, i.e., the discrete inverse wavelet transform.

Usage

wr(wd, start.level = 0, verbose = getOption("verbose"),
   bc = wd$bc, return.object = FALSE,
   filter.number = wd$filter$filter.number, family = wd$filter$family)

Arguments

wd A wavelet decomposition object as returned by wd, see wd.object.
start.level integer; the level at which to start reconstruction. This is usually the first (level 0).
bc, filter.number, family by default part of the wd object, but can specified differently by the ``knowing''.
verbose logical, controlling the printing of ``informative'' messages whilst the computations progress. Such messages are generally annoying so it is turned off by default.
return.object logical; If this is FALSE then the top level of the reconstruction is returned (this is the reconstructed function at the highest resolution). Otherwise if it is T the whole wd reconstructed object is returned.

Details

The code implements Mallat's pyramid algorithm (Mallat 1989). In the reconstruction the quadrature mirror filters G and H are supplied with c0 and d0, d1, .., d(m-1) (the wavelet coefficients) and rebuild c1, .., cm.

If wd was obtained directly from wd() then the original function can be reconstructued exactly as cm and can be sought with accessC(wd.object, level=wd.object$levels).

Usually, the wd object has been modified in some way, for example, some coefficients set to zero by threshold. Wr then reconstructs the function with that set of wavelet coefficients.

Value

Either a vector containing the top level reconstruction or an object of class wd containing the results of the reconstruction, details to be found in the documentation for wd.object.

RELEASE

Release 2.2 Copyright Guy Nason 1993

References

see wd for a list.

See Also

wd, accessC, accessD, filter.select, threshold.

Examples

# Decompose and then exactly reconstruct test.data
example(wd)#-> wds has wd() ressult
rec.wds <- wr(wds)
rec.wds.obj <- wr(wds, return.object = TRUE)
rec.wds2 <- accessC(rec.wds.obj, level=rec.wds.obj$nlevels)
all(rec.wds == rec.wds2)# since wr() internally uses accessC()

# Look at accuracy of reconstruction
summary(abs(rec.wds - y)) #~ 10^-11

# Reconstruct a hard.thresholded object, look at the wavelet coefficients
summary(thr.wds <- wr(threshold(wds, type="hard") ))

[Package wavethresh version 2.2-9 Index]