View source: R/pitchTrackers.R
getPitchSpec | R Documentation |
Internal soundgen function.
getPitchSpec(
frame,
bin,
freqs,
specMethod = c("commonFactor", "BaNa")[1],
specRatios,
specSmooth,
specThres,
specMerge,
specPeak,
specHNRslope,
HNR = NULL,
specSinglePeakCert,
pitchFloor,
pitchCeiling,
nCands
)
frame |
the abs spectrum of a frame, as returned by
|
bin |
the width of spectral bin in |
freqs |
frequency per bin of spectrogram |
specMethod |
"commonFactor" = highest common factor of putative harmonics, "BaNa" = ratio of putative harmonics |
specRatios |
for method = "commonFactor", the number of harmonics AND integer fractions to consider |
specSmooth |
the width of window for detecting peaks in the spectrum, Hz |
specThres |
voicing threshold (unitless, ~0 to 1) |
specMerge |
pitch candidates within |
specPeak , specHNRslope |
when looking for putative harmonics in
the spectrum, the threshold for peak detection is calculated as
|
HNR |
harmonics-to-noise ratio returned by |
specSinglePeakCert |
(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 |
pitchFloor , pitchCeiling |
absolute bounds for pitch candidates (Hz) |
nCands |
number of pitch candidates pre frame (specMethod = "commonFactor" always returns a single candidate) |
Attempts to find F0 of a frame by detecting several putative harmonics and either finding their highest common factor (specMethod = "commonFactor") or comparing their ratios (specMethod = "BaNa"). For the highest common factor method, see Howard & Angus (2017) "Acoustics and psychoacoustics" (section 3.2.1). For BaNa, see Ba et al. (2012) "BaNa: A hybrid approach for noise resilient pitch detection." Statistical Signal Processing Workshop (SSP), 2012 IEEE.
Returns either NULL or a dataframe of pitch candidates.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.