Learn R Programming

soundgen (version 2.4.0)

getFeatureFlux: 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

Value

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

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.

Examples

Run this code
# NOT RUN {
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))
# }

Run the code above in your browser using DataLab