Cosine Packet Table

DESCRIPTION:
Computes cosine packet (local cosine) table.

USAGE:
cp.table(x, cost.fun="entropy", n.levels=6, taper="poly2",
         dct.type=2, boundary="periodic", n.taper=NULL,
         scale=NULL, thresh=NULL, p=2, prob=.5)
as.ptable(x)

REQUIRED ARGUMENTS:
x:
a vector or univariate time series, or, for as.ptable only, an object of ptable, cpt, cp.molecule. When x is a vector or univariate time series, the length of x should be divisible by 2^n.levels and should demean first.

OPTIONAL ARGUMENTS:
cost.fun:
character string indicating which cost functional to use: "entropy", "threshold", "sure", and "lp" are available. See pcosts for details.
n.levels:
a non-negative integer specifying the blocking factor at the finest level in the cosine packet table: at the finest level, x is divided into 2^n.levels blocks each of length length(x)/2^n.levels. 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 details below for the definitions of these tapers.
boundary:
a character string, available boundary rules: "cp.reflect", "periodic" and "zero". See details below for the definitions of these rules.
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 pcosts for details.
p:
a number in the interval (0,2] giving the degree of the lpnorm when cost.fun is "lp". See pcosts for details.
thresh:
a non-negative number giving the threshold for when cost.fun is "threshold" or "sure". See pcosts for details.
prob:
a number in the interval (0,1) used to compute the threshold for when cost.fun is "threshold". See pcosts for details.

VALUE:
a cosine packet table as a numeric vector of cosine packet coefficients ranging from levels 0 to n.levels. The attribute pcosts is a numeric vector of length 2^(n.levels+1)-1 of "costs" based on cost.fun. Additional information about the transform is stored in attribute dictionary.

The returned cosine packet table has class ptable, inheriting from classes cp, and crystal.vector. See crystal.vector.object for details about the data structure.

as.ptable returns x, if x is an object of ptable or cpt.


DETAILS:
A cosine packet table is a redundant non-invertible transform of the data. Invertible orthogonal transforms can be selected from a packet table using the best.basis function and the Subscript operators.

The jth level of a cosine packet table is equivalent to result from the block.cpt function with n.levels=j. A cosine packet crystal corresonds to the DCT applied to a tapered block of the original signal.

Overall, a cosine packet table contains 2^(n.levels+1)-1 cosine packet crystals. Each crystal has a crystal.name of the form cj.b where j is the level and b is the block within level. You can subscript an entire level of a cosine packet table, or you can subscript sets of crystals either by position or name.

Available tapers:

Available boundary rules:

See the chapter on "Cosine Packet Analysis" of S+WAVELETS User's Manual for more details about cp.table and cosine packet analysis.

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


REFERENCES:
Coifman, R., Meyer, Y., Quake, S. and Wickerhauser, M. V. (1990). Signal processing and compression with wavelet packets. Technical report, Yale University.

Coifman, R. and Wickerhauser, V. (1992). Entropy-based algorithms for best basis selection. IEEE Transactions on Information Theory Vol. 38(2), pages 713-718.

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


SEE ALSO:
best.basis , best.level , dct , eda.plot , pcosts , ptable.object, max.level , wavelet.options .

EXAMPLES:
xx <- make.signal("linchirp", 512)
yc <- cp.table(xx, taper="trig", n.levels=4)
eda.plot(yc)