R/plot.sound.R

# Copyright (c) 2015 Santiago Barreda
# All rights reserved.


plot.sound = function (x, ...){
  if (!exists("xlab")) xlab = 'Time (s)'
  if (!exists("ylab")) ylab = 'Amplitude'

  if (!inherits(x$sound,'ts')) plot ((1:length(x$sound))/x$fs, x$sound, xlab=xlab, 
                                  ylab=ylab, xaxs = 'i', type = 'l', ...)
  if (inherits(x$sound,'ts')) plot (x$sound, xlab=xlab, ylab=ylab, xaxs = 'i', ...)
}

Try the phonTools package in your browser

Any scripts or data that you put into this service are public.

phonTools documentation built on Nov. 21, 2023, 1:07 a.m.