Learn R Programming

wavelets (version 0.3-0.2)

align: Align Wavelet Transform Coefficients

Description

Aligns both wavelet (high pass) and scaling (low pass) coefficients of objects of class dwt, modwt, dwpt, and modwpt using phase shift values computed by wt.filter.shift.

Usage

align(wt, coe=FALSE, inverse=FALSE)

Arguments

wt

An object of class dwt, modwt, dwpt, or modwpt.

coe

Logical value indicating whether to use center of energy method in computing phase shifts.

inverse

Logical value indicating whether to shift wavelet and scaling coefficients of an aligned object back to their original positions.

Value

Either an aligned or unaligned object of the same class as wt (see Details above).

Details

An object of class dwt, modwt, is characterized as 'unaligned' if the value in the aligned slot is FALSE. Similarly, these objects are classified as 'aligned' if the value in the aligned slot is TRUE. Thus, align will only operate on an 'unaligned' wavelet transform object if inverse = FALSE and on an 'aligned' wavelet transform object if inverse = TRUE.

The argument coe is passed to the wt.filter.shift function to determine what method to use for computing phase shifts (see documentation for wt.filter.shift).

References

Percival, D. B. and A. T. Walden (2000) Wavelet Methods for Time Series Analysis, Cambridge University Press.

See Also

wt.filter.shift, dwt, modwt.

Examples

Run this code
# NOT RUN {
# obtain the two series listed in Percival and Walden (2000), page 42
X1 <- c(.2,-.4,-.6,-.5,-.8,-.4,-.9,0,-.2,.1,-.1,.1,.7,.9,0,.3)
X2 <- c(.2,-.4,-.6,-.5,-.8,-.4,-.9,0,-.2,.1,-.1,.1,-.7,.9,0,.3)

# combine them and compute DWT
newX <- cbind(X1,X2)
wt <- dwt(newX, n.levels=3, boundary="reflection", fast=FALSE)

# align
wt.aligned <- align(wt)
# }

Run the code above in your browser using DataLab