Data Processing

Generic signal and index manipulation — consecutive runs, chunk detection, interval arithmetic.

When to use which

Task

Use

Group contiguous true / equal runs in a vector

consecutive_runs()

Find the index of the nearest value

findclosest()

Detect chunks (valid vs NaN / flat stretches)

get_chunks()

Intersect two sets of time intervals

interval_intersect()

Rolling percentile filter

percentile_filt()

Slice a signal by a list of [start end] intervals

pick_from_time_segments()

Reference