getPitchHps: Harmonic product spectrum

View source: R/pitchTrackers.R

getPitchHpsR Documentation

Harmonic product spectrum

Description

Internal soundgen function.

Usage

getPitchHps(
  frame,
  freqs,
  bin,
  hpsThres,
  hpsNum,
  hpsNorm,
  hpsPenalty,
  pitchFloor,
  pitchCeiling
)

Arguments

frame

the abs spectrum of a frame, as returned by fft

freqs

frequency per bin of spectrogram

bin

spectrogram bin width, Hz

hpsThres

voicing threshold (unitless, ~0 to 1)

hpsNum

the number of times the spectrum is downsampled

hpsNorm

the amount of inflation of hps pitch certainty (0 = none)

hpsPenalty

the amount of penalizing hps candidates in low frequencies (0 = none)

pitchFloor, pitchCeiling

absolute bounds for pitch candidates (Hz)

Details

Estimates pitch per frame using the harmonic product spectrum. Algorithm: downsample the spectrum repeatedly padding with 0 to the original length, then multiply the resulting scaled spectra. This has the effect of emphasizing f0, which should hopefully become the highest spectral peak. See https://cnx.org/contents/i5AAkZCP@2/Pitch-Detection-Algorithms

Value

Returns either NULL or a dataframe of pitch candidates.


tatters/soundgen documentation built on Aug. 22, 2023, 4:24 p.m.