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')

