dwt(x, wavelet="s8", n.levels=6, boundary=NULL, precondition=F, pdeg=0, pfrac=0, dual=F, analysis.filter=NULL, synthesis.filter=NULL) as.dwt(x) idwt(x)
as.dwt coerces a ptable object to a dwt object.
idwt applies the inverse DWT to the transform coefficients to reconstruct the original signal.
The default boundary rule is set based on sample size, filter length in the following way: if n.levels can be achieved by "periodic" boundary rule (i.e. sample size is divisible by 2^n.levels), then the boundary is set to be "periodic"; otherwise, the boundary is set to be either "reflection" (for biorthogonal symmetric/anti-symmetric wavelets), or "zero".
All the default optional arguments can be reset using function wavelet.options. See wavelet.options for details.
Cohen, A., Daubechies, I. and Vial, P. (1993). Wavelets on the Interval and Fast Wavelet Transforms, Applied and Computational Harmonic Analysis, Vol 1, 54-81.
xx <- make.signal("doppler", 512, snr=5) # a noisy doppler siganl par(mfrow=c(2,2)) plot(xx, type="l", xlab="") yy <- dwt(xx, wavelet="s8", boundary="periodic", n.levels=4) plot(yy)yy[c("d1","d2","d3")] <- 0 # set finer level coefficients 0 x2 <- reconstruct(yy) # reconstructed doppler plot(x2, type="l", xlab="")
yy[["d4"]][-(6:9)] <- 0 # assign 0's to all but the 6-9th coefficients x3 <- reconstruct(yy) # reconstructed doppler plot(x3, type="l", xlab="", ylab="")