getPitchSpec: BaNa pitch tracker

View source: R/pitchTrackers.R

getPitchSpecR Documentation

BaNa pitch tracker

Description

Internal soundgen function.

Usage

getPitchSpec(
  frame,
  bin,
  freqs,
  specMethod = c("commonFactor", "BaNa")[1],
  specRatios,
  specSmooth,
  specThres,
  specMerge,
  specPeak,
  specHNRslope,
  HNR = NULL,
  specSinglePeakCert,
  pitchFloor,
  pitchCeiling,
  nCands
)

Arguments

frame

the abs spectrum of a frame, as returned by fft

bin

the width of spectral bin in frame, Hz

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 specMerge semitones are merged with boosted certainty

specPeak, specHNRslope

when looking for putative harmonics in the spectrum, the threshold for peak detection is calculated as specPeak * (1 - HNR * specHNRslope)

HNR

harmonics-to-noise ratio returned by getPitchAutocor

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 specSinglePeakCert

pitchFloor, pitchCeiling

absolute bounds for pitch candidates (Hz)

nCands

number of pitch candidates pre frame (specMethod = "commonFactor" always returns a single candidate)

Details

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.

Value

Returns either NULL or a dataframe of pitch candidates.


soundgen documentation built on Sept. 12, 2024, 6:29 a.m.