analyzeFrame: Analyze fft frame

View source: R/utilities_analyze.R

analyzeFrameR Documentation

Analyze fft frame

Description

Internal soundgen function.

Usage

analyzeFrame(
  frame,
  bin,
  freqs,
  autoCorrelation = NULL,
  samplingRate,
  scaleCorrection,
  loudness,
  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

bin

spectrogram bin width, Hz

freqs

frequency per bin of spectrogram

autoCorrelation

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

samplingRate

sampling rate (Hz)

loudness

a list of parameters passed to getLoudness for measuring subjective loudness, namely SPL_measured, Pref, spreadSpectrum. NULL = skip loudness analysis

cutFreq

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.

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, 'hps' = harmonic product spectrum, NULL = no pitch analysis

nCands

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

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 or "hps" method; see details and ?soundgen:::getPitchHps

pitchFloor, pitchCeiling

absolute bounds for pitch candidates (Hz)

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.

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.


soundgen documentation built on Aug. 14, 2022, 5:05 p.m.