putD.wd              package:wavethresh              R Documentation

_P_u_t_s _a _w_h_o_l_e _r_e_s_o_l_u_t_i_o_n _l_e_v_e_l _o_f _m_o_t_h_e_r _w_a_v_e_l_e_t _c_o_e_f_f_i_e_n_t_s _i_n_t_o _w_d _w_a_v_e_l_e_t _o_b_j_e_c_t.

_D_e_s_c_r_i_p_t_i_o_n:

     Makes a copy of the 'wd' object, replaces some mother wavelet
     coefficients data in the copy, and then returns the copy.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

      wd: Wavelet decomposition object into which you wish to insert
          the mother wavelet coefficients.

   level: the resolution level at which you wish to replace the mother
          wavelet coefficients.

       v: the replacement data, this should be of the correct length.

boundary: If 'boundary' is 'FALSE' then only "real" data is replaced.
          If boundary is 'TRUE' then the boundary (bookeeping) elements
          are replaced as well. Information about the lengths of the
          vectors can be found in the 'first.last' database function
          and Nason and Silverman, 1994.

   index: If index is 'TRUE' then the index numbers into the 1D array
          where the coefficient insertion would take place are
          returned. If index is 'FALSE' (default) then the modified
          'wavelet decomposition' object is returned.

     ...: any other arguments

_D_e_t_a_i_l_s:

     The function 'accessD' obtains the mother wavelet coefficients for
     a particular level. The function 'putD.wd' replaces father wavelet
     coefficients at a particular resolution level and returns a
     modified wd object reflecting the change.

     The need for this function is a consequence of the pyramidal
     structure of Mallat's algorithm and the memory efficiency gain
     achieved by storing the pyramid as a linear vector. 'PutD.wd'
     obtains information about where the smoothed data appears from the
     'fl.dbase' component of an 'wd.object', in particular the array 

     'fl.dbase$first.last.d'

     which gives a complete specification of index numbers and offsets
     for 

     'wd.object$D'.

     Note that this function is method for the generic function 'putD'.
     When the 'wd.object' is definitely a wd class object then you only
     need use the generic version of this function. 

     Note also that this function only puts information into 'wd' class
     objects. To extract coefficients from a 'wd' object you have to
     use the 'accessD' function (or more precisely, the 'accessD.wd'
     method).

_V_a_l_u_e:

     A 'wd' class object containing the modified mother wavelet
     coefficients.

_R_E_L_E_A_S_E:

     Version 3.5.3 Copyright Guy Nason 1994

_S_e_e _A_l_s_o:

     'putD', 'wd.object', 'wd', 'accessD','putD', 'first.last',

_E_x_a_m_p_l_e_s:

     #
     # Generate an EMPTY wd object:
     #
     #zero <- rep(0, 16)
     #zerowd <- wd(zero)
     #
     # Put some random father wavelet coefficients into the object at
     # resolution level 2. For the decimated wavelet transform there
     # are always 2^i coefficients at resolution level i. So we have to
     # insert 4 coefficients
     #
     #mod.zerowd <- putD( zerowd, level=2, v=rnorm(4))
     #
     # If you plot mod.zerowd you will see that there are only 
     # coefficients at resolution level 2 where you just put the coefficients.
     #
     # Now, for a time-ordered non-decimated wavelet transform object the
     # procedure is exactly the same EXCEPT that there are going to be
     # 16 coefficients at each resolution level. I.e.
     #
     # Create empty TIME-ORDERED NON-DECIMATED wavelet transform object
     #
     #zerowdS <- wd(zero, type="station")
     #
     # Now insert 16 random coefficients at resolution level 2
     #
     #mod.zerowdS <- putD(zerowdS, level=2, v=rnorm(16))
     #
     # Once more if you plot mod.zerowdS then there will only be
     # coefficients at resolution level 2.

