Learn R Programming

seewave (version 1.6.3)

oscillo: Show a time wave as an oscillogram

Description

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.

Usage

oscillo(wave, f, from = NULL, to = NULL, scroll = NULL,
zoom = FALSE, k=1, j=1, labels = TRUE, byrow = TRUE,
identify = FALSE, plot = TRUE, colwave = "black", 
coltitle = "black", cextitle = 1.2,
fonttitle = 2, collab = "black",
cexlab = 1, fontlab = 1, colline = "black", 
colaxis = "black", cexaxis = 1, coly0 = "lightgrey",
tcl = 0.5, title = FALSE, xaxt="s", yaxt="n", type="l", bty = "l")

Arguments

Value

  • Data are returned as one-column matrix if plot is FALSE. identify returns a two-column matrix with the time and amplitude coordinates of points successively chosen on the oscillogram.

See Also

dynoscillo, oscilloST, cutw, pastew, timer

Examples

Run this code
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)
# overplot of oscillographic and envelope representations
oscillo(tico,f=22050)
par(new=TRUE)
env(tico,f=22050,colwave=2)
# full colour modifications in a two-frame oscillogram
op<-par(bg="grey")
oscillo(tico,f=22050,k=4,j=1,title=TRUE,colwave="black",
    coltitle="yellow",collab="red",colline="white",
    colaxis="blue",coly0="grey50")
par(op)
# change the title
data(orni)
oscillo(orni,f=22050,title="The song of a famous cicada")
# move along the signal using scroll
require(rpanel)
oscillo(tico,f=22050,scroll=8)

Run the code above in your browser using DataLab