Create Crystal Names

DESCRIPTION:
Create crystal names for an object or extract crystal names from an existing object.

This function is generic (see Methods); method functions can be written to handle specific classes of data. Classes which already have methods for this function include:

atrous, cp.crystal, decompose, dwt, molecule, mra,, nd.dwt, rob.dwt, wp.crystal, wpt.2d.


USAGE:
crystal.names(x, J, Jrow=J, Jcol=Jrow, depth.first=F,
              style="pretty", case="lower")
is.2d.name(x)
is.pretty.names(x)
icrystal.names(x, J, Jrow=J, Jcol=Jrow, depth.first=F)

REQUIRED ARGUMENTS:
x:
a character string specifying the type of crystal names to be created (see below for details), or an object of class "atrous", "cp.crystal", "decompose", "dwt", "molecule", "mra", "nd.dwt", "rob.dwt", "wp.crystal", or "wpt.2d", in which case the crystal names will be extracted.
J:
resolution levels, needed only when x is a character string.

OPTIONAL ARGUMENTS:
Jrow:
horizontal resolution levels, for 2D crystal names only.
Jcol:
vertical resolution levels, for 2D crystal names only.
depth.first:
logical flag, if depth.first=TRUE, the output crystal names will be re-ordered in terms of frequency centers.
style:
crystal name styles: one of the character strings "pretty" or "filter", see below for details.
case:
one of the character strings "lower" or "upper" indicating lower or upper case letters to be used.

VALUE:
a character vector of crystal names.

is.2d.name returns TRUE if x is a vector of 2D crystal.names, and FALSE otherwise.

is.pretty.names returns TRUE if x is a vector of "pretty" crystal names, and FALSE otherwise.

icrystal.names returns the internal crystal names. This function is not intended for high-level use.


DETAILS:
When x is a character string, the corresponding type of crystal names will be created. Available crystal name types are: "cp", "wp", "dwt", "mra", "subband", "block.dct", "dwt.2d", "cp.quad", "wp.quad", "subband.2d", "block.dct.2d".

When x="cp", "block.dct", the crystal names are of the form: cj.b (if case="lower") or Cj.b (if case="upper"), where j is the resolution level, b is the block number and c (or C) stands for "cosine packet". Argument style is ignored.

When x="dwt" and style="pretty", the crystal names are of the form: sj, dj (if case="lower") or Sj, Dj (if case="upper"), where j is the resolution level, s (or S) stands for "smooth" and d (or D) stands for "detail".

When x="wp", "subband" and style="pretty", the crystal names are of the form: wj.b (if case="lower") or Wj.b (if case="upper"), where j is the resolution level, b is the block number (under "sequency" order) and w (or W) stands for "wavelet packet".

When x="mra" and style="pretty", the crystal names are of the form: Sj, where j is the resolution level. Argument case is ignored.

When style != "pretty", the crystal names will be strings of Ls and Hs, where L is for "low-pass" and H is for "high-pass". The length of the string equals to the resolution level and the combination of the Ls and Hs determines the block number.

When x="dwt.2d", "cp.quad", "wp.quad", "subband.2d", "block.dct.2d", 2D crystal names are created and of the form 1D.name-1D.name.


EXAMPLES:
x.dwt <- dwt(rnorm(64))
crystal.names(x.dwt)               # extract crystal names
crystal.names(x.dwt, "pretty")     # extract crystal names, in "pretty" style
crystal.names("wp", 3)             # create crystal names for wp table
crystal.names("block.dct.2d", 2)   # create crystal names for 2D block.dct