Learn R Programming

soundgen (version 1.7.0)

analyzeFrame: Analyze fft frame

Description

Internal soundgen function.

Usage

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
)

Arguments

frame

the abs spectrum of a frame, as returned by fft

autoCorrelation

pre-calculated autocorrelation of the input frame (computationally more efficient than to do it here)

samplingRate

sampling rate (Hz)

cutFreq

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.

trackPitch

if TRUE, attempt to find F0 in this frame (FALSE if entropy is above some threshold - specified in analyze)

pitchMethods

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)

nCands

maximum number of pitch candidates per method (except for dom, which returns at most one candidate per frame), normally 1...4

pitchDom

a list of control parameters for pitch tracking using the lowest dominant frequency band or "dom" method; see details and ?soundgen:::getDom

pitchAutocor

a list of control parameters for pitch tracking using the autocorrelation or "autocor" method; see details and ?soundgen:::getPitchAutocor

pitchCep

a list of control parameters for pitch tracking using the cepstrum or "cep" method; see details and ?soundgen:::getPitchCep

pitchSpec

a list of control parameters for pitch tracking using the BaNa or "spec" method; see details and ?soundgen:::getPitchSpec

pitchHps

a list of control parameters for pitch tracking using the harmonic product spectrum ("hps") method; see details and ?soundgen:::getPitchHps

pitchFloor

absolute bounds for pitch candidates (Hz)

pitchCeiling

absolute bounds for pitch candidates (Hz)

Value

Returns a list with two components: $pitchCands_frame contains pitch candidates for the frame, and $summaries contains other acoustic predictors like HNR, specSlope, etc.

Details

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.