View source: R/pitch_postprocessing.R
findVoicedSegments | R Documentation |
Internal soundgen function.
findVoicedSegments(
pitchCands,
shortestSyl,
shortestPause,
step,
minVoicedCands,
pitchMethods,
manualV = NULL,
manualTryToV = NULL,
manualUnv = NULL
)
pitchCands |
matrix of possible pitch values per column. One column is one fft frame, one row is one pitch candidate |
shortestSyl |
the smallest length of a voiced segment (ms) that constitutes a voiced syllable (shorter segments will be replaced by NA, as if unvoiced) |
shortestPause |
the smallest gap between voiced syllables (ms): large value = interpolate and merge, small value = treat as separate syllables separated by an unvoiced gap |
step |
you can override |
minVoicedCands |
a frame is considered to be voiced if at least this many pitch candidates are not NA. Defaults to 2: since dom is usually defined, in practice this means that we also want at least one other pitch candidate (autocor, cep or BaNa) |
pitchMethods |
methods of pitch tracking in analyze() |
manualV |
index of frames that should definitely be voiced (manual candidates) |
manualTryToV |
index of frames that should be treated as voiced as long as they have any candidates at all (even <minVoicedCands) |
manualUnv |
index of frames forced to be unvoiced |
Internal helper function for postprocessing of pitch contours. Merges voiced
segments at least shortestSyl
ms long and separated by less than
shortestPause
ms. Called by analyze
Returns a dataframe specifying where each voiced segment starts and ends (in fft frames, not ms!)
pitch = c(rep(NA, 5), rnorm(15, 300, 15), rep(NA, 7), rnorm(10, 400, 10), rep(NA, 6))
plot(pitch, type = 'b')
soundgen:::findVoicedSegments(
pitchCands = matrix(pitch, nr = 1),
shortestSyl = 20,
shortestPause = 60,
step = 10,
minVoicedCands = 1,
pitchMethods = 'blabla',
manualV = NULL,
manualTryToV = NULL,
manualUnv = NULL
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.