Wavelet Packet Table

DESCRIPTION:
Computes wavelet packet table.

USAGE:
wp.table(x, cost.fun="entropy", wavelet="s8", n.levels=6,
         boundary=NULL, precondition=F, pdeg=0, pfrac=0,
         dual=F, analysis.filter=NULL, synthesis.filter=NULL,
         scale=NULL, thresh=NULL, p=2, prob=.5)
as.ptable(x)

REQUIRED ARGUMENTS:
x:
a time series or a numeric vector, or, for as.ptable only, an object of ptable, wpt, wp.molecule.

OPTIONAL ARGUMENTS:
cost.fun:
character string indicating which cost functional to use: "entropy", "threshold", "sure", and "lp" are available. See pcosts for details.
wavelet:
a character string giving the name of the wavelet, e.g. "d4", "s8". See wavelet for a list of all available wavelet names. For user-provided filter, input the values in analysis.filter and synthesis.filter below.
n.levels:
a non-negative integer specifying number of multi-resolution levels. If n.levels is bigger than ml, where ml is the maximum possible level, then n.levels is set to ml and a warning message is given. The max.level function is used to compute ml.
boundary:
a character string giving the boundary rules, e.g. "periodic", "infinite", "zero". See details below for a list of available boundary rules.
precondition:
logical flag: for boundary="interval" only. If TRUE, then a preconditioning transform will be applied to the the data. The preconditioning transformation preserves the vanishing moments property when the DWT is applied to polynomial signals. See Cohen, Daubechies, and Vial (1993) for details.
pdeg:
for "infinite"only: degree of polynomial used for boundary extension.
pfrac:
for boundary="infinite"only: fraction of data used to fit a polynomial of degree pdeg.
dual:
logical flag indicating if dual filter is used for analysis instead of synthesis. This argument only applies for biorthogonal wavelets. See wavelet for details.
analysis.filter:
for user-defined analysis filter. See filter argument in wave.filter for details.
synthesis.filter:
for user-defined synthesis filte. See filter argument in wave.filter for details. When analysis.filter is provided, then the default synthesis.filter is also analysis.filter.
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 wavelet packet table object with class "ptable" inheriting from classes "wp" and "crystal.vector" or "crystal.list". When boundary="infinite", the table is a list inheriting from class "crystal.list"; for other boundary rules, the table is a vector inheriting from class "crystal.vector". See crystal.list.object and crystal.vector.object for details.

Associated with a wavelet packet table is a table of wavelet packet costs, stored in the attribute pcosts. Additional information about the transform is stored in attribute dictionary.

as.ptable returns x, if x is an object of class which inherits from ptable, wpt, or wp.molecule.


DETAILS:
Wavelet packet analysis starts with construction of a wavelet packet table. Like the DWT, a wavelet packet table has coefficients at different resolution levels and translations. However, a wavelet packet table also has coefficients corresponding to different oscillations. At resolution level j, the table has wavelet packet coefficients with oscillation indices b = 0, 1, ..., 2^j-1. By contrast, for each resolution level, the DWT has coefficients at just one oscillation index (or two at the coarsest level).

The wavelet packet table has n.levels resolution levels. At resolution level j, a table has n coefficients. When you stack the J+1 resolution levels on top of one another, you get the (J+1)*n table of coefficients.

Each resolution level is divided into 2^j coefficient blocks corresponding to oscillations 0, 1, ..., 2^j-1. The coefficient blocks are called crystals, and have names of the form wj.b where j is the resolution level and b is the oscillation number.

The wp.table function stores a wavelet packet table by level in "sequency" order (increasing oscillation numbers): see Wickerhauser (1994) for details.

You can select wavelet transforms from a wavelet packet table using the best.basis, best.level, as.dwt functions and the Subscript operators.

Refer to the section "Wavelet Packet Tables" in the S+WAVELETS User's Manual for more details about wavelet packet tables.

The default optional arguments for wavelet, n.levels, boundary, precondition, pdeg, pfrac, dual 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.

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


SEE ALSO:
as.dwt , best.basis , best.level , crystal.names , max.level , pcosts, Subscript.ptable , ptable.object , wavelet.options .

EXAMPLES:
xx <- make.signal("twochirp", n=1024)
wp0 <- wp.table(xx, wavelet="s8", boundary="zero")
plot(wp0)

wpi <- wp.table(xx, wavelet="s8", boundary="periodic") plot(wpi)