draw.wp {wavethresh} | R Documentation |
Draw wavelet packet associated with a wp object.
Description
This function draws a wavelet packet associated with a wp.object
.
Usage
## S3 method for class 'wp'
draw(wp, level, index, plot.it=TRUE, main, sub, xlab, ylab, ...)
Arguments
wp |
The |
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 |
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.
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.
RELEASE
Version 3.9.6 Copyright Guy Nason 1998
Note
If the plot.it
argument is TRUE
(which it is by default) a plot of the appropriate wavelet packet is plotted on the active graphics device.
Author(s)
G P Nason
See Also
filter.select
, wp
, wp.object
, drawwp.default
.
Examples
#
# Generate some test data
#
test.data <- example.1()$y
## Not run: 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?
#
## Not run: draw(tdwd, level=4, index=12)