pathfinder: Pathfinder

View source: R/utilities_pitch_postprocessing.R

pathfinderR Documentation

Pathfinder

Description

Internal soundgen function.

Usage

pathfinder(
  pitchCands,
  pitchCert,
  pitchSource,
  step,
  manual = NULL,
  certWeight = 0.5,
  pathfinding = c("none", "fast", "slow")[2],
  annealPars = list(maxit = 5000, temp = 1000),
  interpolWin_bin = 3,
  interpolTol = 0.05,
  interpolCert = 0.3,
  manualCert = 1,
  snakeStep = 0.05,
  snakePlot = FALSE
)

Arguments

pitchCands

a matrix of multiple pitch candidates per fft frame. Each column is one fft frame, each row is one candidate (the last row is always "manual")

pitchCert

a matrix of the same dimensionality as pitchCands specifying our certainty in pitch candidates

step

you can override overlap by specifying FFT step, ms (NB: because digital audio is sampled at discrete time intervals of 1/samplingRate, the actual step and thus the time stamps of STFT frames may be slightly different, eg 24.98866 instead of 25.0 ms)

certWeight

(0 to 1) in pitch postprocessing, specifies how much we prioritize the certainty of pitch candidates vs. pitch jumps / the internal tension of the resulting pitch curve

pathfinding

method of finding the optimal path through pitch candidates: 'none' = best candidate per frame, 'fast' = simple heuristic, 'slow' = annealing. See soundgen:::pathfinder

annealPars

a list of control parameters for postprocessing of pitch contour with SANN algorithm of optim. This is only relevant if pathfinding = 'slow'

interpolWin_bin

when interpolating pitch candidates, the median is calculated over plus-minus interpolWin_bin

interpolTol

when interpolating pitch candidates, the criterion for needing to interpolate is the absence of pitch candidates with values within 1 plus-minus interpolTol of the median of pitch center of gravity over the interpolation window. For ex., if interpolTol is .05, we look for values from 0.95 to 1.05 time the median value over interpolation window.

interpolCert

when interpolating pitch candidates, all generated pitch candidates are assigned a certainty equal to interpolCert

manualCert

the certainty in manually added pitch candidates

snakeStep

optimized path through pitch candidates is further processed to minimize the elastic force acting on pitch contour. To disable, set snakeStep = 0

snakePlot

if TRUE, plots the snake

Details

Internal helper function for postprocessing pitch contour. Starts with a reasonable guess and computes the more-or-less optimal pitch contour (not quite the very optimal - too computationally expensive).

Value

Returns a numeric vector of pitch values representing the best found path through pitch candidates.


soundgen documentation built on Aug. 14, 2022, 5:05 p.m.