Cosine Packet Transform

DESCRIPTION:
Computes cosine packet transform.

USAGE:
cpt(x, crystal.names=NULL, basis=NULL, cost.fun="entropy",
    n.levels=6, taper="poly2", dct.type=2, boundary="periodic",
    n.taper=NULL, scale=NULL, thresh=NULL, p=2, prob=.5)
icpt(x)

REQUIRED ARGUMENTS:
x:
a time series or a numeric vector, should demean first, or, for icpt only, an object of class cpt.

OPTIONAL ARGUMENTS:
crystal.names:
a character vector of crystal names of the form "cj.b" where j is an integer giving the level and b is an integer from 0 to 2^j-1 giving the block number within level j. If crystal.names is supplied, then basis is ignored.
basis:
a character string specifying how the cosine packet basis is selected: "best.basis", "best.level", "block.dct", or "block.cpt". See the corresponding function for details.
cost.fun:
character string indicating which cost functional to use: "entropy", "threshold", "sure", and "lp" are available. Only used for "best.basis". See pcosts for details.
n.levels:
a non-negative integer specifying the blocking factor: x is divided into 2^n.levels blocks each of length length(x)/2^n.levels. For "best.basis", n.levels gives the blocking factor for the finest level. If n.levels is bigger than ml, where ml is the maximum possible level, computed from the max.level function, then n.levels is set to ml and a warning message is given.
dct.type:
one of 2 or 4 indicating which of DCT-II or DCT-IV should be used. See the function dct for details.
taper:
a character string, indicating the taper function: "boxcar", "poly1", "poly2", "poly3", "poly4", "poly5", or "trig". See the function cp.table for details.
boundary:
a character string, available boundary rules: "cp.reflect", "periodic" and "zero". See the function cp.table for details.
n.taper:
a non-negative integer. The length of the taper will be 2*n.taper. By default, n.taper is set to length(x)/2^(n.level+1), which is the maximum possible length at the finest blocking level.
scale:
scaling factor for computing the costs. The default depends on cost.fun. See the function pcosts for details.
p:
a number in the interval (0,2] giving the degree of the lpnorm when cost.fun is "lp". See the function pcosts for details.
thresh:
a non-negative number giving the threshold for when cost.fun is "threshold" or "sure". See the function pcosts for details.
prob:
a number in the interval (0,1) used to compute the threshold for when cost.fun is "threshold". See the function pcosts for details.

VALUE:
an object of class cpt, inheriting from the class crystal.vector.

icpt(x) performs the inverse transform from the cpt object x, as the generic function reconstruct does for cpt objects.


DETAILS:
The algorithms for the taper functions are given in the S+WAVELETS User's Manual, in the section "Cosine Packet Algorithms". They are discussed in greater depth in Wickerhauser (1994).

The default optional arguments n.levels, taper, dct.type, boundary can be reset using function wavelet.options, see wavelet.options for details.


REFERENCES:
Wickerhauser, M. V. (1994). Adapted Wavelet Analysis -- from theory to software.

SEE ALSO:
best.basis , best.level , block.dct , block.cpt , cp.table, max.level , pcosts , wavelet.options .

EXAMPLES:
x <- make.signal("linchirp")
bbx <- cpt(x, basis="best.basis")
eda.plot(bbx)