Skip to contents

Smooths x^2 with a energy_window_ms boxcar and flags samples where the smoothed energy crosses threshold_factor * median(energy). Hysteresis: returns to "off" only when energy drops below baseline.

Usage

morie_dsp_onset_detect(x, fs, energy_window_ms = 20, threshold_factor = 3)

Arguments

x

Numeric vector.

fs

Sampling frequency (Hz).

energy_window_ms

Smoothing window (ms). Default 20.

threshold_factor

Multiplier on baseline median. Default 3.

Value

Integer vector of onset indices.

References

Rangayyan & Krishnan (2015), Ch. 4, sec. 4.5.