Internal soundgen function.
analyzeFrame(
frame,
bin,
freqs,
autoCorrelation = NULL,
samplingRate,
cutFreq,
trackPitch = TRUE,
pitchMethods = c("dom", "autocor"),
nCands,
pitchDom = list(),
pitchAutocor = list(),
pitchCep = list(),
pitchSpec = list(),
pitchHps = list(),
pitchFloor,
pitchCeiling
)
Returns a list with two components: $pitchCands_frame contains pitch candidates for the frame, and $summaries contains other acoustic predictors like HNR, specSlope, etc.
the abs spectrum of a frame, as returned by
fft
spectrogram bin width, Hz
frequency per bin of spectrogram
pre-calculated autocorrelation of the input frame (computationally more efficient than to do it here)
sampling rate (Hz)
if specified, spectral descriptives (peakFreq, specCentroid,
specSlope, and quartiles) are calculated only between cutFreq[1]
and
cutFreq[2]
, Hz. If a single number is given, analyzes frequencies
from 0 to cutFreq
. For ex., when analyzing recordings with varying
sampling rates, set to half the lowest sampling rate to make the spectra
more comparable. Note that "entropyThres" applies only to this frequency
range, which also affects which frames will not be analyzed with
pitchAutocor.
if TRUE, attempt to find F0 in this frame (FALSE if entropy
is above some threshold - specified in analyze
)
methods of pitch estimation to consider for determining pitch contour: 'autocor' = autocorrelation (~PRAAT), 'cep' = cepstral, 'spec' = spectral (~BaNa), 'dom' = lowest dominant frequency band, 'hps' = harmonic product spectrum, NULL = no pitch analysis
maximum number of pitch candidates per method, normally 1...4
(except for dom
, which returns at most one candidate per frame)
a list of control parameters for pitch tracking using the
lowest dominant frequency band or "dom" method; see details and
?soundgen:::getDom
a list of control parameters for pitch tracking using the
autocorrelation or "autocor" method; see details and
?soundgen:::getPitchAutocor
a list of control parameters for pitch tracking using the
cepstrum or "cep" method; see details and ?soundgen:::getPitchCep
a list of control parameters for pitch tracking using the
BaNa or "spec" method; see details and ?soundgen:::getPitchSpec
a list of control parameters for pitch tracking using the
harmonic product spectrum or "hps" method; see details and
?soundgen:::getPitchHps
absolute bounds for pitch candidates (Hz)
This function performs the heavy lifting of pitch tracking and acoustic analysis in general: it takes the spectrum of a single fft frame as input and analyzes it.