View source: R/pitch_postprocessing.R
| addPitchCands | R Documentation | 
Internal soundgen function.
addPitchCands(
  pitchCands,
  pitchCert,
  pitchSource,
  pitch,
  timestamps = NULL,
  candPlot = list(),
  pitchPlot = list(),
  extraContour = NULL,
  extraContour_pars = list(),
  priorMean = NULL,
  priorSD = NULL,
  pitchFloor = NULL,
  pitchCeiling = NULL,
  addToExistingPlot = TRUE,
  showLegend = TRUE,
  y_Hz = FALSE,
  yScale = c("orig", "bark", "mel")[1],
  ...
)
| pitchCands,pitchCert,pitchSource | matrices of pitch candidates, their certainty, and pitch tracking method used as generated internally by analyze(); columns = STFT frames, rows = candidates | 
| pitch | best guess at pitch contour; length = ncol(pitchCands) | 
| candPlot,pitchPlot | lists of graphical settings for plotting candidates and pitch contour, respectively | 
| extraContour | another contour to add to the plot, such as harmHeight, Hz | 
| addToExistingPlot | if TRUE, assumes that a spectrogram is already plotted; if FALSE, sets up a new plot | 
| showLegend | if TRUE, shows a legend | 
| y_Hz | if TRUE, plot in Hz, otherwise in kHz | 
| ... | other graphical parameters used for creating a new plot if addToExistingPlot = FALSE | 
Plots pitch candidates or adds them to a spectrogram.
s = soundgen()
a = soundgen:::.analyze(soundgen:::readAudio(s, samplingRate = 16000),
 windowLength = 25, step = 25,
 returnPitchCands = TRUE, plot = FALSE)
spectrogram(s, 16000, windowLength = 25, step = 5, ylim = c(0, 1), osc = FALSE)
soundgen:::addPitchCands(
  pitchCands = a$pitchCands$freq,
  pitchCert = a$pitchCands$cert,
  pitchSource = a$pitchCands$source,
  pitch = a$result$pitch,
  timestamps = a$result$time / 1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.