GenW               package:wavethresh               R Documentation

_G_e_n_e_r_a_t_e (_i_n_v_e_r_s_e) _d_i_s_c_r_e_t_e _w_a_v_e_l_e_t _t_r_a_n_s_f_o_r_m _m_a_t_r_i_x.

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

     This function generates a matrix that can perform the discrete
     wavelet transform (useful for understanding the DWT but use the
     fast algorithm coded in 'wd' for general use). The function
     returns the matrix for the inverse transform. Since the matrix is
     orthogonal transpose the matrix to obtain the forward transform
     matrix.

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

     GenW(n=8, filter.number=10, family="DaubLeAsymm", bc="periodic")

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

       n: The order of the DWT matrix will be n times n. n should be a
          power of two.

filter.number: This selects the smoothness of wavelet that you want to
          use in the decomposition. By default this is 10, the
          Daubechies least-asymmetric orthonormal compactly supported
          wavelet with 10 vanishing moments.

  family: specifies the family of wavelets that you want to use. The
          options are "DaubExPhase" and "DaubLeAsymm".

      bc: boundary conditions to use. This can be 'periodic' or
          'symmetric' depending on whether you want the returned matrix
          to assume periodic or symmetric end-reflection boundary
          conditions.

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

     The discrete wavelet transform is usually computed using the fast
     pyramid algorithm of Mallat. However, the transform can be written
     in a matrix form and this is useful for understanding what the
     fast transform does. One wouldn't normally use the matrix for
     performing the transform but use the fast transform function 'wd'
     instead. 

     The matrix returned by this function represents the inverse DWT.
     Since the matrix (and transform) is orthogonal one can obtain the
     matrix representation of the forward transform simply by
     transposing the matrix using the 't' function in S-Plus. 

     The returned matrix is organised as follows. The first column
     always corresponds to the linear combination corresponding to the
     scaling function coefficient (so the column is constant. The next
     'n/2' columns correspond to the finest scale wavelet coefficients;
     the next 'n/4' columns to the next finest scale and so on until
     the last column which corresponds to the coarsest scale wavelet
     coefficients. 

     The matrix is computed by performing successive fast DWTs on unit
     vectors.

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

     A matrix of order 'n' that contains the inverse discrete wavelet
     transform.

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

     Version 3.2 Copyright Guy Nason 1998

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

     'wd', 'wr'.

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

     #
     # Generate the wavelet transform matrix corresponding to the Haar wavelet
     # transform of order 8
     #
     #haarmat <- GenW(8, filter.number=1, family="DaubExPhase")
     #
     # Let's look at this matrix
     #
     #haarmat
     #          [,1]       [,2]       [,3]       [,4]       [,5] [,6] [,7]       [,8] 
     #[1,] 0.3535534  0.7071068  0.0000000  0.0000000  0.0000000  0.5  0.0  0.3535534
     #[2,] 0.3535534 -0.7071068  0.0000000  0.0000000  0.0000000  0.5  0.0  0.3535534
     #[3,] 0.3535534  0.0000000  0.7071068  0.0000000  0.0000000 -0.5  0.0  0.3535534
     #[4,] 0.3535534  0.0000000 -0.7071068  0.0000000  0.0000000 -0.5  0.0  0.3535534
     #[5,] 0.3535534  0.0000000  0.0000000  0.7071068  0.0000000  0.0  0.5 -0.3535534
     #[6,] 0.3535534  0.0000000  0.0000000 -0.7071068  0.0000000  0.0  0.5 -0.3535534
     #[7,] 0.3535534  0.0000000  0.0000000  0.0000000  0.7071068  0.0 -0.5 -0.3535534
     #[8,] 0.3535534  0.0000000  0.0000000  0.0000000 -0.7071068  0.0 -0.5 -0.3535534
     #
     # As noted above the first column is the l.c. corresponding to the scaling
     # function coefficient and then the l.c.s corresponding to the wavelet
     # coefficients from the finest to the coarsest.
     #
     # The above matrix represented the inverse DWT. Let's compute the forward
     # transform matrix representation:
     #
     #t(haarmat)
     #          [,1]       [,2]       [,3]       [,4]       [,5]       [,6]       [,7]       [,8] 
     #[1,] 0.3535534  0.3535534  0.3535534  0.3535534  0.3535534  0.3535534  0.3535534  0.3535534
     #[2,] 0.7071068 -0.7071068  0.0000000  0.0000000  0.0000000  0.0000000  0.0000000  0.0000000
     #[3,] 0.0000000  0.0000000  0.7071068 -0.7071068  0.0000000  0.0000000  0.0000000  0.0000000
     #[4,] 0.0000000  0.0000000  0.0000000  0.0000000  0.7071068 -0.7071068  0.0000000  0.0000000
     #[5,] 0.0000000  0.0000000  0.0000000  0.0000000  0.0000000  0.0000000  0.7071068 -0.7071068
     #[6,] 0.5000000  0.5000000 -0.5000000 -0.5000000  0.0000000  0.0000000  0.0000000  0.0000000
     #[7,] 0.0000000  0.0000000  0.0000000  0.0000000  0.5000000  0.5000000 -0.5000000 -0.5000000
     #[8,] 0.3535534  0.3535534  0.3535534  0.3535534 -0.3535534 -0.3535534 -0.3535534 -0.3535534
     #
     #

