Skip to main content

extrema

Function extrema 

Source
pub fn extrema(values: &[f64], buckets: usize) -> Vec<usize>
Expand description

Keeps the lowest and highest sample of each of buckets equal spans.

The envelope reduction: up to two indices per bucket, in sample order, so a waveform drawn from the answer still touches every extreme the full run touched. A bucket whose lowest and highest are the same sample contributes it once.