Learn R Programming

wavethresh (version 4.7.3)

draw.wp: Draw wavelet packet associated with a wp object.

Description

This function draws a wavelet packet associated with a wp.object.

Usage

# S3 method for wp
draw(wp, level, index, plot.it=TRUE, main, sub, xlab, ylab, ...)

Value

If the plot.it argument is set to TRUE then nothing is returned. Otherwise, if plot.it is set to FALSE the coordinates of what would have been plotted are returned.

Arguments

wp

The wp class object whose associated wavelet packet you wish to draw.

level

The resolution level of wavelet packet in the wavelet packet decomposition that you wish to draw (corresponds to scale).

index

The packet index of the wavelet packet in the wavelet packet decomposition that you wish to draw (corresponds to number of oscillations).

plot.it

If TRUE then the wavelet packet is plotted on the active graphics device. If FALSE then the y-coordinates of the packet are returned. Note that x-coordinates are not returned (the packet is periodic on its range anyway).

main

The main argument for the plot

sub

The subtitle for the plot

xlab

The labels for the x axis

ylab

The labels for the y axis

...

Additional arguments to pass to the drawwp.default function which does the drawing. In particular, arguments can be set to choose between drawing the mother wavelet and scaling function, to set the resolution of the plot, to choose between drawing one and two dimensional pictures.

RELEASE

Version 3.9.6 Copyright Guy Nason 1998

Author

G P Nason

Details

This function extracts the filter component from the wp object (which is constructed using the filter.select function) to decide which wavelet packet family to draw. Once decided the drawwp.default function is used to actually do the drawing.

See Also

filter.select, wp, wp.object, drawwp.default.

Examples

Run this code
#
# Generate some test data
#
test.data <- example.1()$y
if (FALSE) ts.plot(test.data)
#
# Now do the wavelet packet transform of the data using the Daubechies
# least-asymmetric wavelet N=10 (the default arguments in
# wp).
#
tdwp <- wp(test.data)
#
# What happens if we try to draw this new tdwp object?
#
if (FALSE) draw(tdwd, level=4, index=12)

Run the code above in your browser using DataLab