Internal soundgen function.
getPitchSpec(
frame,
bin,
freqs,
specSmooth,
specHNRslope,
HNR = NULL,
specThres,
specPeak,
specSinglePeakCert,
pitchFloor,
pitchCeiling,
specMerge,
nCands
)
the abs spectrum of a frame, as returned by
fft
the width of spectral bin in frame
, Hz
the width of window for detecting peaks in the spectrum, Hz
harmonics-to-noise ratio returned by getPitchAutocor
voicing threshold (unitless, ~0 to 1)
when looking for putative harmonics in
the spectrum, the threshold for peak detection is calculated as
specPeak * (1 - HNR * specHNRslope)
(0 to 1) if F0 is calculated based on a single
harmonic ratio (as opposed to several ratios converging on the same
candidate), its certainty is taken to be specSinglePeakCert
absolute bounds for pitch candidates (Hz)
absolute bounds for pitch candidates (Hz)
pitch candidates within specMerge
semitones are
merged with boosted certainty
maximum number of pitch candidates per method (except for
dom
, which returns at most one candidate per frame), normally 1...4
Returns either NULL or a dataframe of pitch candidates.
Attempts to find F0 of a frame by calculating ratios of putative harmonics (frequency domain analysis, ~ modified BaNa algorithm). See Ba et al. (2012) "BaNa: A hybrid approach for noise resilient pitch detection." Statistical Signal Processing Workshop (SSP), 2012 IEEE.