Q                  package:seewave                  R Documentation

_R_e_s_o_n_a_n_c_e _q_u_a_l_i_t_y _f_a_c_t_o_r _o_f _a _f_r_e_q_u_e_n_c_y _s_p_e_c_t_r_u_m

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

     This function estimates the frequency pureness of a time wave by
     returning the resonant quality factor Q at a specific dB level.

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

     Q(x, range, level = -3, plot = TRUE, colval = "red",
     cexval = 1, fontval = 1, flab = "Frequency (kHz)",
     alab = "Relative amplitude (dB)",...)

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

       x: a data set resulting of a spectral analysis obtained with
          'spec', or 'meanspec' (in dB).

   range: range of 'x' (in kHz).

   level: frequency bandwidth set by an amplitude value relative to
          'spectrum' (in dB).

    plot: logical, if 'TRUE' returns the spectrum  with Q plotted (by
          default 'TRUE').

  colval: colour of plotting Q.

  cexval: character size of plotting Q.

 fontval: font of plotting Q.

    flab: title of the frequency axis.

    alab: title of the ampltiude axis.

     ...: other 'plot' graphical parameters.

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

     A high Q value indicates a highly resonant system.

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

     Q is returned as a single numeric data.

_N_o_t_e:

     This function is based on 'fft'.

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

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

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

     'spec', 'meanspec', 'corspec', 'fft'.

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

     # bird song
     data(tico)
     t<-spec(tico,f=22050,wl=512,at=1.1,plot=FALSE,dB=TRUE)
     op<-par(mfrow=c(2,1),las=1)
     Q(t,range=c(0,11.025),type="l")
     Q(t,range=c(0,11.025),type="l",xlim=c(3.8,4.2),ylim=c(-60,0))
     title("zoom in")
     par(op)
     # cricket, changing the dB level
     data(pellucens)
     p<-spec(pellucens,f=11025,wl=512,at=0.5,plot=FALSE,dB=TRUE)
     op<-par(mfrow=c(3,1))
     Q(p,range=c(0,11.25/2),type="l",xlim=c(1.8,2.6),ylim=c(-70,0))
     title("level = - 3 (default value)",col.main="red")
     Q(p,range=c(0,11.25/2),type="l",level=-6,
         xlim=c(1.8,2.6),ylim=c(-70,0),colval="blue")
     title("level = - 6",col.main="blue")
     Q(p,range=c(0,11.25/2),type="l",level=-9,
         xlim=c(1.8,2.6),ylim=c(-70,0),colval="green")
     title("level = - 9",col.main="green")
     par(op)

