covspectro              package:seewave              R Documentation

_C_o_v_a_r_i_a_n_c_e _b_e_t_w_e_e_n _t_w_o _s_p_e_c_t_r_o_g_r_a_m_s

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

     This function tests the similarity between two spectrograms by
     returning their maximal covariance and the time shift related to
     it.

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

     covspectro(wave1, wave2, f, wl, n, plot = TRUE, plotval = TRUE,
     method = "spearman", col = "black", colval = "red", cexval = 1,
     fontval = 1, xlab = "Time (s)",
     ylab = "Normalised covariance (cov)", ...)

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

   wave1: data describing a first time wave.

   wave2: data describing a second time wave.

       f: sampling frequency of 'wave1' and 'wave2'.

      wl: length of the window for the analysis (even number of
          points).

       n: number of covariances computed between 'wave1' and 'wave2'
          when sliding 'wave2' along 'wave1'.

    plot: logical, if 'TRUE' plots r values against frequency shift (by
          default 'TRUE').

 plotval: logical, if 'TRUE' adds to the plot maximum R value and
          frequency offset (by default 'TRUE').

  method: a character string indicating which correlation coefficient
          is to be computed ("pearson", "spearman", or "kendall") (see
          'cor').

     col: colour of r values.

  colval: colour of r max and frequency offset values.

  cexval: character size of r max and frequency offset values.

 fontval: font of r max and frequency offset values.

    xlab: title of the frequency axis.

    ylab: title of the r axis.

     ...: other 'plot' graphical parameters.

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

     Successive covariances between the spectrogram of 'wave1' and the
     spectrogram of 'wave2' are computed when regularly sliding forward
     and backward 'wave2' along 'wave1'.
      The maximal covariance is obtained at a particular shift (time
     offset).  This shift may be positive or negative.
       'n' sets in how many steps 'wave2'will be slided along 'wave1'.
     Time process can be then decreased by setting low 'n' value.
      Inverting 'wave1' and 'wave2' may give slight different results.

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

     If 'plot' is 'FALSE', 'covspectro' returns a list containing three
     components: 

     cov: the successive covariance values between 'wave1' and 'wave2'.

  covmax: the maximum covariance between 'wave1' and 'wave2'.

       t: the time offset corresponding to 'cov'.

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

     Jrme Sueur jerome.sueur@ibaic.u-psud.fr

_R_e_f_e_r_e_n_c_e_s:

     Hopp, S. L., Owren, M. J. and Evans, C. S. (Eds) 1998. _Animal
     acoustic  communication_. Springer, Berlin, Heidelberg.

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

     'corspec', 'corenv', 'spectro', 'cor',

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

     # covariance between two echemes of a cicada calling song
     data(orni)
     orni1<-cutw(orni,f=22050,from=0,to=0.1,plot=FALSE)
     orni2<-cutw(orni,f=22050,from=0.15,to=0.25,plot=FALSE)
     covspectro(orni1,orni2,f=22050,wl=512,n=37,type="l")

