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)
Run the code above in your browser using DataLab