cogpy.detect.utils

Detection utilities (v2.6.4).

Note: keep heavy deps (SciPy) as local imports so this module can be imported under minimal interpreters. The supported runtime is the cogpy conda env.

Functions

bandpass_filter(data, low, high, *[, order, ...])

Bandpass filter using cogpy.preprocess.filtering.bandpassx.

bout_duration_summary(bouts)

Summary statistics of bout durations.

bout_occupancy(bouts, total_duration)

Fraction of total_duration occupied by bouts.

dual_threshold_events_1d(x, t, *, low, high)

Dual-threshold detection on a 1D array.

find_true_runs(mask)

Find contiguous True runs in a 1D boolean mask.

hilbert_envelope(data, *[, time_dim])

Compute Hilbert envelope (magnitude of analytic signal).

merge_intervals(intervals, *, gap)

Merge 1D intervals whose gap is <= gap samples.

score_to_bouts(score, times, *, low, high[, ...])

Convert a 1D score time series to event bouts via dual threshold.

zscore_1d(x)

Z-score a 1D array with safe std handling.