Generalized Cosine Packet Transform

DESCRIPTION:

Computes a generalized cosine packet transform

USAGE:

gcpt(x, partition, taper = "poly2", n.taper=8, boundary="periodic")
igcpt(x)

REQUIRED ARGUMENTS:

x
a time series or a numeric vector, or, for igcpt only, an object of class gcpt.
partition
a vector specifying the partition of the input x. The cosine packets are computed for each specified partition. The end of points of the partition vector are 0 and length(x) and need not be specified. See below for details.

OPTIONAL ARGUMENTS:

taper
a character string, indicating the taper function: "boxcar", "poly1", "poly2", "poly3", "poly4", "poly5", or "trig". See the function cp.table for details.
n.taper
a non-negative integer. The length of the taper will be 2*n.taper.
boundary
a character string, available boundary rules: "cp.reflect", "periodic" and "zero". See the function cp.table for details.

VALUE:

an object of class gcpt.

DETAILS:

This algorithm is a generalized version of the Cosine Packet Transform (See cpt ). Whereas in cpt the only kinds of partitions that can be defined are dyadic partitions (partitions corresponding to powers of 2), in this function any kind of partition (not neccesarily dyadic) can be defined. Only the Type IV DCT is supported for generalized Cosine Packet Transforms. In case the partitions are dyadic, the resulting transform will be identical to the Cosine Packet Transform. 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 taper, 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. A. K. Peters Ltd, Wellesley, MA.

SEE ALSO:

EXAMPLES:

lc <- make.signal("linchirp", n=1024)
# compute the generalized cosine packet transform for a dyadic partition
lc.gcpt <- gcpt(lc, partition=c(256, 512, 768), n.taper=8)
# the above transform is the same as obtained by the following cpt function
lc.cpt  <- cpt(lc, n.levels=2, n.taper=8, dct.type=4)
# to reconstruct the signal apply the igcpt function
recon <- igcpt(lc.gcpt)
# we can also compute the gcpt for a non-dyadic partition
lc.gcpt <- gcpt(lc, partition=c(25, 47, 100, 717, 930), n.taper=8)