Learn R Programming

wavethresh (version 2.2-3)

putD: Put Wavelet Coefficients Into Wavelet Structure

Description

Makes a copy of the wd object, replaces some wavelet coefficients into the copy, and then returns the copy.

Usage

putD(wd, level, v, boundary=FALSE)

Arguments

wd
object of class wd that is to be copied and have wavelet coefficients replaced.
level
integer; the level at which the replacement is to take place.
v
the replacement coefficients which should be of the correct length.
boundary
logical; if FALSE then only the "real" coefficients are replaced (and it is easy to predict the required length of v, just the correct power of 2). If boundary is TRUE, then you can replace the boundary

Value

  • A wd class object containing the replaced coefficients, see wd.object.

RELEASE

Release 2.2 Copyright Guy Nason 1993

Details

The function accessDobtains the wavelet coefficients for a particular level. This function, putD replaces coefficients at a particular level and returns a modified wd object reflecting the change.

As opposed to the utility of putC, the putD function is actually quite useful. It is fun to replace coefficients, since then you can dream up your own functions, get pictures of the wavelets etc. etc.

See Also

wd.object, accessD, draw

Examples

Run this code
example(wd)

## Set all the wavelet coefficients to zero
for(i in 0:(wds$nlevels - 1))
  wds <- putC(wds, level=i, v=rep(0,2^i))

## and now see what you've done
plot(wds)
matplot(x, cbind(wr(wd(y)), wr(wds)), type = 'l')

Run the code above in your browser using DataLab