addPitchCands: Plot pitch candidates

View source: R/pitch_postprocessing.R

addPitchCandsR Documentation

Plot pitch candidates

Description

Internal soundgen function.

Usage

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],
  ...
)

Arguments

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

Details

Plots pitch candidates or adds them to a spectrogram.

Examples

## Not run: 
s = soundgen()
a = analyze(s, 16000, windowLength = 25, step = 25,
            summary = 'extended', plot = FALSE)
spectrogram(s, 16000, windowLength = 25, step = 5)
addPitchCands(pitchCands = a$pitchCands,
              pitchCert = a$pitchCert,
              pitchSource = a$pitchSource,
              pitch = a$result$pitch)

## End(Not run)

soundgen documentation built on Sept. 12, 2024, 6:29 a.m.