putD               package:wavethresh               R Documentation

_P_u_t _W_a_v_e_l_e_t _C_o_e_f_f_i_c_i_e_n_t_s _I_n_t_o _W_a_v_e_l_e_t _S_t_r_u_c_t_u_r_e

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

     Makes a copy of the wd object, replaces some wavelet coefficients
     into the copy, and then returns the copy.

_U_s_a_g_e:

     putD(wd, level, v, boundary=FALSE)

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

      wd: object of class `wd' that is to be copied and have wavelet
          coefficients replaced.

   level: integer; the level at which the replacement is to take place.

       v: the replacement coefficients which should be of the correct
          length.

boundary: logical; if `FALSE' then only the "real" coefficients are
          replaced (and it is easy to predict the required length of
          `v', just the correct power of 2). 
          If boundary is `TRUE', then you can replace the boundary
          coefficients as well (but it is hard to predict the required
          length of `v', and the information has to be extracted from
          the `first.last' database component of `wd').

          `boundary' has no meaning if `wd' was obtained with the
          periodic boundary handling method (`bc').

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

     The function `accessD'obtains the wavelet coefficients for a
     particular level.  This function, `putD' replaces coefficients at
     a particular level and returns a modified wd object reflecting the
     change.

     As opposed to the utility of `putC', the `putD' function is
     actually quite useful.  It is fun to replace coefficients, since
     then you can dream up your own functions, get pictures of the
     wavelets etc. etc.

_V_a_l_u_e:

     A `wd' class object containing the replaced coefficients, see
     `wd.object'.

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

     Release 2.2 Copyright Guy Nason 1993

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

     `wd.object', `accessD', `draw'

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

     example(wd)

     ## Set all the wavelet coefficients to zero
     for(i in 0:(wds$nlevels - 1))
       wds <- putC(wds, level=i, v=rep(0,2^i))

     ## and now see what you've done
     plot(wds)
     matplot(x, cbind(wr(wd(y)), wr(wds)), type = 'l')

