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
     #
     #

