\HeaderA{draw.wp}{Draw wavelet packet associated with a wp object.}{draw.wp}
\keyword{hplot}{draw.wp}
\begin{Description}\relax
This function draws a wavelet packet associated with a \code{\LinkA{wp.object}{wp.object}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
draw.wp(wp, level, index, plot.it=TRUE, main, sub, xlab, ylab, ...)

\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{wp}] The \code{\LinkA{wp}{wp}} class object whose associated wavelet packet you wish to draw. 
\item[\code{level}] The resolution level of wavelet packet in the wavelet packet decomposition that you wish to draw (corresponds to scale).
\item[\code{index}] The packet index of the wavelet packet in the wavelet packet decomposition that you wish to draw (corresponds to number of oscillations).
\item[\code{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). 
\item[\code{main}] 
\item[\code{sub}] 
\item[\code{xlab}] 
\item[\code{ylab}] 
\item[\code{...}] Additional arguments to pass to the \code{\LinkA{drawwp.default}{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. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function extracts the filter component from the \code{\LinkA{wp}{wp}} object (which is constructed using the \code{\LinkA{filter.select}{filter.select}} function) to decide which wavelet packet family to draw. Once decided the \code{\LinkA{drawwp.default}{drawwp.default}} function is used to actually do the drawing.
\end{Details}
\begin{Value}
If the \code{plot.it} argument is set to \code{TRUE} then nothing is returned. Otherwise, if \code{plot.it} is set to \code{FALSE} the coordinates of what would have been plotted are returned.
\end{Value}
\begin{Section}{RELEASE}
Version 3.9.6 Copyright Guy Nason 1998
\end{Section}
\begin{SeeAlso}\relax
\code{\LinkA{filter.select}{filter.select}}, \code{\LinkA{wp}{wp}}, \code{\LinkA{wp.object}{wp.object}}, \code{\LinkA{drawwp.default}{drawwp.default}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
#
# Generate some test data
#
#test.data <- example.1()$y
#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?
#
#draw(tdwd, level=4, index=12)

\end{ExampleCode}
\end{Examples}

