localMaximum         package:MassSpecWavelet         R Documentation

_I_d_e_n_t_i_f_y _l_o_c_a_l _m_a_x_i_m_u_m _w_i_t_h_i_n _a _s_l_i_d_e _w_i_n_d_o_w.

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

     Find local maximum by transform the vector as matrix, then get the
     the maximum of each column. This operation is performed twice with
     vecctor shifted half of the winSize.

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

     localMaximum(x, winSize = 5)

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

       x: a vector represents a signal profile

 winSize: the slide window size, 5 by default.

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

     Instead of find the local maximum by a slide window, which slide
     all possible positions, we find local maximum by transform the
     vector as matrix, then get the the maximum of each column. This
     operation is performed twice with vecctor shifted half of the
     winSize. The main purpose of this is to increase the efficiency of
     the algorithm.

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

     Return a vector with the same length of the input x. The position
     of local maximum is set as 1, 0 else where.

_A_u_t_h_o_r(_s):

     Pan Du

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

     'getLocalMaximumCWT'

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

     x <- rnorm(200)
     lmax <- localMaximum(x, 5)
     maxInd <- which(lmax > 0)
     plot(x, type='l')
     points(maxInd, x[maxInd], col='red')

