\HeaderA{mwr}{Multiple discrete wavelet transform (reconstruction).}{mwr}
\keyword{manip}{mwr}
\begin{Description}\relax
This function performs the reconstruction stage of Mallat's pyramid algorithm adapted for multiple wavelets (see Xia et al.(1996)), i.e. the discrete inverse \emph{multiple} wavelet transform.
\end{Description}
\begin{Usage}
\begin{verbatim}
mwr(mwd, prefilter.type = mwd$prefilter, verbose = FALSE, start.level = 0,
        returnC = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{mwd}] A multiple wavelet decomposition object as returned by \code{\LinkA{mwd}{mwd}}.
\item[\code{prefilter.type}] Usually best not to change this (i.e. not to use a different prefilter on the reconstruction to the one used on decomposition).
\item[\code{verbose}] Controls the printing of "informative" messages whilst the computations progress. Such messages are generally annoying so it is turned off by default.
\item[\code{start.level}] The level you wish to start reconstruction at. The is usually the first (level 0).
\item[\code{returnC}] If this is FALSE then a vector of the same length as the argument data supplied to the function \code{\LinkA{mwd}{mwd}} that constructed the supplied \code{\LinkA{mwd.object}{mwd.object}}. is returned, Ie. the reconstructed data. If true then the last level (highest resolution) C coefficients are returned in matrix form. This matrix has not been postprocessed. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The code implements Mallat's pyramid algorithm adapted for multiple wavelet decompositions (Xia et al. 1996). In the reconstruction the quadrature mirror filters G and H are supplied with C0 and D0, D1, ... D(J-1) (the wavelet coefficients) and rebuild C1,..., CJ. 

The matrix CJ is postprocessed which returns the full reconstruction 

If \code{\LinkA{mwd.object}{mwd.object}} was obtained directly from \code{\LinkA{mwd}{mwd}} then the original function can be reconstructued exactly. Usually, the \code{\LinkA{mwd.object}{mwd.object}} has been modified in some way, for example, some coefficients set to zero by \code{\LinkA{threshold}{threshold}}. Mwr then reconstructs the function with that set of wavelet coefficients. 

See also Downie and Silverman, 1998
\end{Details}
\begin{Value}
Either a vector containing the final reconstruction or a matrix containing unpostprocessed coefficients.
\end{Value}
\begin{Section}{RELEASE}
Version 3.9.6 (Although Copyright Tim Downie 1996)
\end{Section}
\begin{SeeAlso}\relax
\code{\LinkA{accessC.mwd}{accessC.mwd}}, \code{\LinkA{accessD.mwd}{accessD.mwd}}, \code{\LinkA{draw.mwd}{draw.mwd}}, \code{\LinkA{mfirst.last}{mfirst.last}}, \code{\LinkA{mfilter.select}{mfilter.select}}, \code{\LinkA{mwd}{mwd}}, \code{\LinkA{mwd.object}{mwd.object}}, \code{\LinkA{plot.mwd}{plot.mwd}}, \code{\LinkA{print.mwd}{print.mwd}}, \code{\LinkA{putC.mwd}{putC.mwd}}, \code{\LinkA{putD.mwd}{putD.mwd}}, \code{\LinkA{summary.mwd}{summary.mwd}}, \code{\LinkA{threshold.mwd}{threshold.mwd}}, \code{\LinkA{wd}{wd}}, \code{\LinkA{wr.mwd}{wr.mwd}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
#
# Decompose and then exactly reconstruct test.data
#
#tdecomp <- mwd(test.data)
#trecons <- mwr(tdecomp)
#
# Look at accuracy of reconstruction
# max(abs(trecons - test.data))
#[1] 2.266631e-12
#
# See also the example of using this-is-escaped-codenormal-bracket68bracket-normal or mwr in
# the this-is-escaped-codenormal-bracket70bracket-normal section of
# the help for this-is-escaped-codenormal-bracket72bracket-normal.
\end{ExampleCode}
\end{Examples}

