basis: Produce Boolean Vector from Wavelet Basis Names

Description Usage Arguments Details Value See Also Examples

View source: R/dwpt.R

Description

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

Usage

1
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

dwpt.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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)

neuroconductor-devel/waveslim documentation built on May 3, 2021, 5:31 a.m.