spectro               package:seewave               R Documentation

_2_D-_s_p_e_c_t_r_o_g_r_a_m _o_f _a _t_i_m_e _w_a_v_e

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

     This functions returns a two-dimension spectrographic
     representation of a time wave. The function corresponds to
     short-term Fourier transform. An amplitude contour plot can be
     overlaid.

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

     spectro(wave, f, wl, zp = 0, ovlp = 0, plot = TRUE,
     grid = TRUE, osc = FALSE, scale = TRUE, cont = FALSE,
     collevels = seq(-30, 0, 1), palette = spectro.colors,
     contlevels = seq(-30, 0, 10), colcont = "black", colgrid = "black",
     plot.title = title(main = "", xlab = "Time (s)",
     ylab = "Frequency (kHz)"), scalelab = "Amplitude\n(dB)",
     scalefontlab = 1, axisX = TRUE, axisY = TRUE,
     ...)

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

    wave: data describing a time wave.

       f: sampling frequency of 'wave'.

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

      zp: zero-padding (even number of points), see 'Details'.

    ovlp: overlap between two successive windows (in %).

    plot: logical, if 'TRUE' plots the spectrogram (by default 'TRUE').

    grid: logical, if 'TRUE' plots a y-axis grid (by default 'TRUE').

     osc: logical, if 'TRUE' plots an oscillogram beneath the
          spectrogram (by default 'FALSE').

   scale: logical, if 'TRUE' plots a dB colour scale on the right side
          of the spectrogram (by default 'TRUE').

    cont: logical, if 'TRUE' overplots contour lines on the spectrogram
          (by default 'FALSE').

collevels: a set of levels which are used to partition the amplitude
          range of the spectrogram (in dB).

 palette: a color palette function to be used to assign colors in the
          plot, see 'Details'.

contlevels: a set of levels which are used to partition the amplitude
          range for contour overplot (in dB).

 colcont: colour for 'cont' plotting.

 colgrid: colour for 'grid' plotting.

plot.title: statements which add titles to the plot.

scalelab: amplitude scale label.

scalefontlab: font of the amplitude scale label.

   axisX: logical, if 'TRUE' plots X-axis (by default 'TRUE').

   axisY: logical, if 'TRUE' plots Y-axis (by default 'TRUE').

     ...: other 'contour' and 'oscillo' graphical parameters.

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

     A Hanning function is applied to the analysis window.
      'zp' adds 0 values on both sides of the analysis window. This
     increases frequency resolution without altering time resolution.
      Any colour palette can be used. In particular, it is possible to
     use other palettes coming with 'seewave': 'rev.heat.colors',
     'rev.terrain.colors', 'rev.topo.colors', 'rev.cm.colors'
     corresponding to the reverse of 'heat.colors',  'terrain.colors',
     'topo.colors', 'cm.colors'.
      Use 'locator' to identify  points.

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

     If 'plot' is 'FALSE', this function returns a matrix. Each column
     corresponds to a Fourier transform of length 'wl'.

_N_o_t_e:

     This function is based on 'fft', 'contour' and 'filled.contour'

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

     Jrme Sueur jerome.sueur@ibaic.u-psud.fr and  Caroline
     Simonis-Sueur csimonis@mnhn.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:

     'spectro3D', 'oscillo', 'dBscale', 'fft'.

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

     data(tico)
     data(peewit)
     data(pellucens)
     data(alauda)
     # simple plots
     spectro(tico,f=22050,wl=512)
     spectro(tico,f=22050,wl=512,osc=TRUE)
     spectro(tico,f=22050,wl=512,scale=FALSE)
     spectro(tico,f=22050,wl=512,osc=TRUE, scale=FALSE)
     # manipulating wl
     op<-par(mfrow=c(2,2))
     spectro(tico,f=22050,wl=256,scale=FALSE)
     title("wl = 256")
     spectro(tico,f=22050,wl=512,scale=FALSE)
     title("wl = 512")
     spectro(tico,f=22050,wl=1024,scale=FALSE)
     title("wl = 1024")
     spectro(tico,f=22050,wl=4096,scale=FALSE)
     title("wl = 4096")
     par(op)
     # manipulating ovlp
     op<-par(mfrow=c(2,1))
     spectro(alauda,f=22050,wl=512,scale=FALSE)
     title("ovlp = 0")
     spectro(alauda,f=22050,wl=512,ovlp=95,scale=FALSE)
     title("ovlp = 95")
     par(op)
     # a full plot
     pellu2<-cutw(pellucens,f=22050,from=1,to=nrow(pellucens)/22050,plot=FALSE)
     spectro(pellu2,f=22050,wl=512,ovlp=85,zp=16,osc=TRUE,
         cont=TRUE,contlevels=seq(-30,0,20),colcont="red",
         lwd=1.5,lty=2,palette=rev.terrain.colors)
     # black and white spectrogram 
     spectro(pellu2,f=22050,wl=512,ovlp=85,zp=16,
         palette=rev.gray.colors)
     # colour modifications
     spectro(pellu2,f=22050,wl=512,ovlp=85,zp=16,
     palette=rev.cm.colors,osc=TRUE,colwave="orchid1") 
     op<-par(bg="black",col="white")
     spectro(pellu2,f=22050,wl=512,ovlp=85,zp=16,osc=TRUE,palette=rev.heat.colors,
     colgrid="white", colwave="white",colaxis="white",collab="white",
     colline="white")
     par(op)

