

wr(wavethresh)                               R Documentation

_D_i_s_c_r_e_t_e _w_a_v_e_l_e_t _t_r_a_n_s_f_o_r_m _(_r_e_c_o_n_s_t_r_u_c_t_i_o_n_)_.

_D_e_s_c_r_i_p_t_i_o_n_:

     This function performs the reconstruction stage of Mal-
     lat's pyramid algorithm, i.e., the discrete inverse
     wavelet transform.

_U_s_a_g_e_:

     wr(wd.object, start.level=0, verbose=FALSE, return.object=FALSE)

_A_r_g_u_m_e_n_t_s_:

wd.object: A wavelet decomposition object as returned by
          `wd', see `wd.object'.

start.level: integer; the level at which to start recon-
          struction.  This is usually the first (level 0).

 verbose: logical, controlling the printing of "informative"
          messages whilst the computations progress.  Such
          messages are generally annoying so it is turned
          off by default.

return.object: logical; If this is FALSE then the top level
          of the reconstruction is returned (this is the
          reconstructed function at the highest resolution).
          Otherwise if it is T the whole wd reconstructed
          object is returned.

_D_e_t_a_i_l_s_:

     The code implements Mallat's pyramid algorithm (Mallat
     1989).  In the reconstruction the quadrature mirror
     filters G and H are supplied with c0 and d0, d1, ...{}
     d(m-1) (the wavelet coefficients) and rebuild c1,...{},
     cm.

     If wd.object was obtained directly from wd then the
     original function can be reconstructued EXACTLY as cm
     and can be sought with

     `accessC(wd.object, level=wd.object$levels)'

     Usually, the wd.object has been modified in some way,
     for example, some coefficients set to zero by thresh-
     old. Wr then reconstructs the function with that set of
     wavelet coefficients.

_V_a_l_u_e_:

     Either a vector containing the top level reconstruction
     or an object of class "wd" containing the results of
     the reconstruction, details to be found in help for
     "wd.object".

_S_i_d_e _E_f_f_e_c_t_s_:

     The appropriate C object code is loaded if it isn't.

_R_E_L_E_A_S_E_:

     Release 2.2 Copyright Guy Nason 1993

_R_e_f_e_r_e_n_c_e_s_:

     see `wd' for a list.

_S_e_e _A_l_s_o_:

     `wd', `accessC', `accessD', `filter.select', `thresh-
     old'.

_E_x_a_m_p_l_e_s_:

     # Decompose and then exactly reconstruct test.data
     example(wd)#-> wds has wd() ressult
     rec.wds <- wr(wds)
     rec.wds.obj <- wr(wds, return.object = TRUE)
     rec.wds2 <- accessC(rec.wds.obj, level=rec.wds.obj$nlevels)
     all(rec.wds == rec.wds2)# since wr() internally uses accessC()

     # Look at accuracy of reconstruction
     summary(abs(rec.wds - y)) #~ 10^-11

     # Reconstruct a hard.thresholded object, look at the wavelet coefficients
     summary(thr.wds <- wr(threshold(wds, type="hard") ))

