interpolate: Interpolate

View source: R/utilities_pitch_postprocessing.R

interpolateR Documentation

Interpolate

Description

Internal soundgen function.

Usage

interpolate(
  pitchCands,
  pitchCert,
  pitchSource,
  pitchCenterGravity,
  interpolWin_bin = 3,
  interpolTol = 0.3,
  interpolCert = 0.3
)

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

pitchCenterGravity

numeric vector giving the mean of all pitch candidates per fft frame weighted by our certainty in each of these candidates

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

manualUnvoiced

a vector with indices of frames that are manually specified as unvoiced and should not be interpolated

Details

Interpolation: if a frame has no pitch candidate at all (NA) or no candidate between the most likely candidates for the adjacent frames, add such a candidate with some (low) certainty.

Value

Returns a modified pitchCands matrix.


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