plotGram: Plot Spectrogram or Cepstrogram

View source: R/plotGram.R

plotGramR Documentation

Plot Spectrogram or Cepstrogram

Description

Plots either a spectrogram or cepstrogram and also overlays whistle or cepstral contours from the binary files

Usage

plotGram(
  x,
  evNum = 1,
  start = NULL,
  end = NULL,
  channel = 1,
  wl = 512,
  hop = 0.25,
  mode = c("spec", "ceps"),
  detections = c("cepstrum", "click", "whistle"),
  detCol = c("red", "blue", "blue"),
  sr = NULL
)

Arguments

x

an AcousticStudy object

evNum

if x is a study, the event index number to calculate the average spectra for. Note that this is the index in the order that they appear in the AcousticStudy object, not the actual event number. Alternatively full event names can be used

start

start time of the plot, either POSIXct or seconds from the start of the event

end

end time of the plot, either POSIXct or seconds from the start of the event.

channel

channel to plot

wl

window length of FFT to use for creating plot

hop

hop value of FFT to use for creating plot, either as a percentage of wl or number of samples

mode

one of 'spec' or 'ceps' to plot either spectrogram or cepstrogram

detections

vector containing any of 'cepstrum', 'click', and/or 'whistle' indicating which detections to overlay on the plot

detCol

vector containing colors to use for plotting detections. Order matches order of detections (default alphabetical - cepstrum, click, whistle)

sr

sample rate

Value

nothing, just plots

Author(s)

Taiki Sakai taiki.sakai@noaa.gov

Examples


data(exStudy)
recs <- system.file('extdata', 'Recordings', package='PAMpal')
exStudy <- updateFiles(exStudy,
                       bin=system.file('extdata', 'Binaries', package='PAMpal'),
                       db = system.file('extdata', 'Example.sqlite3', package='PAMpal'))
exStudy <- addRecordings(exStudy, folder=recs, log=FALSE, progress=FALSE)
# No detections will appear on plot because included recordings are heavily decimated
plotGram(exStudy)


PAMpal documentation built on Aug. 12, 2023, 1:06 a.m.