getFeatureFlux: Get flux from features

View source: R/analyze_utilities.R

getFeatureFluxR Documentation

Get flux from features

Description

Internal soundgen function

Usage

getFeatureFlux(an, thres = 0.1, smoothing_ww = 1, plot = FALSE)

Arguments

an

dataframe of results from analyze()

thres

threshold used for epoch detection (0 - 1)

smoothing_ww

if > 1, medianSmoother is called on input dataframe

plot

if TRUE, plots the normalized feature matrix and epochs

Details

Calculates the change in acoustic features returned by analyze() from one STFT frame to the next. Since the features are on different scales, they are normalized depending on their units (but not scaled). Flux is calculated as mean absolute change across all normalized features. Whenever flux exceeds thres, a new epoch begins.

Value

Returns a data frame with flux per frame and epoch numbers.

Examples

an = analyze(soundgen(), 16000)
fl = soundgen:::getFeatureFlux(an$detailed, plot = TRUE)
## Not run: 
# or simply:
an = analyze(soundgen(sylLen = 500), 16000, plot = TRUE, ylim = c(0, 8),
             extraContour = 'flux', flux = list(smoothWin = 100, thres = .15))

## End(Not run)

soundgen documentation built on Sept. 29, 2023, 5:09 p.m.