Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

basis

Produce Boolean Vector from Wavelet Basis Names


Description

Produce a vector of zeros and ones from a vector of basis names.

Usage

basis(x, basis.names)

Arguments

x

Output from the discrete wavelet package transfrom (DWPT).

basis.names

Vector of character strings that describe leaves on the DWPT basis tree. See the examples below for appropriate syntax.

Details

None.

Value

Vector of zeros and ones.

See Also

Examples

data(acvs.andel8)
## Not run: 
x <- hosking.sim(1024, acvs.andel8[,2])
x.dwpt <- dwpt(x, "la8", 7)
## Select orthonormal basis from wavelet packet tree
x.basis <- basis(x.dwpt, c("w1.1","w2.1","w3.0","w4.3","w5.4","w6.10",
                           "w7.22","w7.23"))
for(i in 1:length(x.dwpt))
  x.dwpt[[i]] <- x.basis[i] * x.dwpt[[i]]
## Resonstruct original series using selected orthonormal basis
y <- idwpt(x.dwpt, x.basis)
par(mfrow=c(2,1), mar=c(5-1,4,4-1,2))
plot.ts(x, xlab="", ylab="", main="Original Series")
plot.ts(y, xlab="", ylab="", main="Reconstructed Series")

## End(Not run)

waveslim

Basic Wavelet Routines for One-, Two-, and Three-Dimensional Signal Processing

v1.8.2
BSD_3_clause + file LICENSE
Authors
Brandon Whitcher
Initial release
2020-02-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.