Internal soundgen function.
analyzeFrame(
frame,
bin,
freqs,
autoCorrelation = NULL,
samplingRate,
scaleCorrection,
cutFreq,
trackPitch = TRUE,
pitchMethods = c("dom", "autocor"),
nCands,
pitchDom = list(),
pitchAutocor = list(),
pitchCep = list(),
pitchSpec = list(),
pitchHps = list(),
pitchFloor,
pitchCeiling
)
the abs spectrum of a frame, as returned by
fft
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 under cutFreq
. Recommended
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 ('' or NULL = no pitch analysis)
maximum number of pitch candidates per method (except for
dom
, which returns at most one candidate per frame), normally 1...4
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 ("hps") method; see details and
?soundgen:::getPitchHps
absolute bounds for pitch candidates (Hz)
absolute bounds for pitch candidates (Hz)
Returns a list with two components: $pitchCands_frame contains pitch candidates for the frame, and $summaries contains other acoustic predictors like HNR, specSlope, etc.
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.