putD {wavethresh} | R Documentation |
Makes a copy of the wd object, replaces some wavelet coefficients into the copy, and then returns the copy.
putD(wd, level, v, boundary=FALSE)
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
coefficients as well (but it is hard to predict the required length
of v , and the information has to be extracted from the
first.last database component of wd ).
|
The function accessD
obtains 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.
A wd
class object containing the replaced coefficients, see
wd.object
.
Release 2.2 Copyright Guy Nason 1993
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')