Learn R Programming

wavethresh (version 2.2-6)

wr: 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 = FALSE,
   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.

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 help for "wd.object".

Side Effects

The appropriate C object code is loaded if it isn't.

code

accessC(wd.object, level=wd.object$levels)

RELEASE

Release 2.2 Copyright Guy Nason 1993

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, ...

References

see wd for a list.

See Also

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

Examples

Run this code
# 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") ))

Run the code above in your browser using DataLab