oscillo               package:seewave               R Documentation

_S_h_o_w _a _t_i_m_e _w_a_v_e _a_s _a_n _o_s_c_i_l_l_o_g_r_a_m

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

     This graphical function displays a time wave as an oscillogram in
     a single or  multi-frame plot. The envelope of the wave can also
     be shown.

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

     oscillo(wave, f, from = FALSE, to = FALSE, zoom = FALSE,
     k=1, j=1, labels = TRUE, byrow = TRUE, env = FALSE, smooth = 0,
     identify = FALSE, plot = TRUE, colwave = "black", 
     colbg = "white", coltitle = "black", collab = "black", 
     cexlab = 1, fontlab = 1, colline = "black", 
     colaxis = "black", coly0 = "grey47",
     title = FALSE, bty = "l")

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

    wave: data describing a time wave.

       f: sampling frequency of 'wave'.

    from: start of the oscillogram (in s).

      to: end of the oscillogram (in s).

    zoom: time zoom in with start and end points chosen on the
          oscillogram with a cursor.

       k: number of horizontal sections (by default =1).

       j: number of vertical sections (by default =1).

  labels: if 'TRUE' plots time and amplitude labels (by default
          'TRUE').

   byrow: logical, if 'TRUE', the sections are filled by rows,
          otherwise the sections are filled by colmuns (by default
          'TRUE').

     env: logical, if 'TRUE' plots the envelope of the time wave
          instead  (by default 'FALSE').

  smooth: if 'env' is 'TRUE' then smoothes the envelope  by averaging
          the number of points selected.

identify: returns the time coordinate of points chosen on the
          oscillogram with a cursor.

    plot: logical, if 'TRUE' returns an oscillographic or envelope plot
          of 'wave'(by default 'TRUE').

 colwave: colour of the oscillogram or of the envelope.

   colbg: background colour.

coltitle: if 'title' is 'TRUE', colour of the title.

  cexlab: character size for axes title.

 fontlab: font for axes title.

  collab: colour of axes title.

 colline: colour of axes line.

 colaxis: colour of the axes.

   coly0: colour of the y=0 line.

   title: logical, if 'TRUE' plots the title  with information on time
          and 'f' (by default 'FALSE').

     bty: the type of box to be drawn around the oscillogram.

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

     Data are returned as one-column matrix if 'plot' is 'FALSE'.
     'identify' returns a numeric object with the time coordinate  of
     points successively chosen on the oscillogram.

_N_o_t_e:

     'zoom' is similar to but more visual than 'from' and/or 'to'.
     'zoom' and 'identify' do work with a single-frame window only (_i.
     e._ with 'k' = 1 and 'j' = 1).
      Press 'Stop' button of the tools bar after choosing the
     appropriate points on the oscillogram.

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

     Jrme Sueur jerome.sueur@ibaic.u-psud.fr and  Caroline
     Simonis-Sueur csimonis@mnhn.fr.

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

     'cutw', 'pastew', 'timer'.

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

     data(tico)
     # a simple oscillogram of a bird song
     oscillo(tico,f=22050)
     # zoom in
     op<-par(mfrow=c(4,1),mar=c(4.5,4,2,2))
     oscillo(tico,22050,cexlab=0.75)
     oscillo(tico,22050,from=0.5,to=0.9,cexlab=0.75)
     oscillo(tico,22050,from=0.65,to=0.75,cexlab=0.75)
     oscillo(tico,22050,from=0.68,to=0.70,cexlab=0.75)
     par(op)
     # the same divided in four lines
     oscillo(tico,f=22050,k=4,j=1)
     # the same divided in different numbers of lines and columns
     oscillo(tico,f=22050,k=4,j=4)
     oscillo(tico,f=22050,k=2,j=2,byrow=TRUE)
     oscillo(tico,f=22050,k=2,j=2,byrow=FALSE)
     # envelope representation without and with smoothing
     oscillo(tico,f=22050,env=TRUE)
     oscillo(tico,f=22050,env=TRUE,smooth=80)
     # overplot of oscillographic and envelope representation
     env<-oscillo(tico,f=22050,env=TRUE,plot=FALSE,smooth=40)
     ticonorm<-tico/max(tico)
     envnorm<-env/max(env)
     oscillo(ticonorm,f=22050)
     par(new=TRUE)
     plot(envnorm,type="l",col="red",xaxs="i",yaxs="i",ann=FALSE,xaxt="n",yaxt="n",
         ylim=range(ticonorm),bty="l",lwd=2)
     legend(x=4, y=1,"smoothed envelope", col="red",lty=1,lwd=2,bty="n",cex=0.75)
     # full colour modifications in a two-frame oscillogram
     oscillo(tico,f=22050,k=4,j=1,title=TRUE,colwave="black",colbg="grey",
         coltitle="yellow",collab="red",colline="white",
         colaxis="blue",coly0="grey50")
     # change the title
     data(orni)
     oscillo(orni,f=22050,title=FALSE)
     mtext("The song of a famous cicada",side=3,line=2,font=2,col="red",cex=1.5)

