pub fn local_maxima(x: &[f64]) -> (Vec<usize>, Vec<usize>, Vec<usize>)Expand description
Local maxima of x, with the left and right edges of each plateau. A flat run counts once,
at its middle sample (rounded down), when the samples on both sides of it are lower. The end
samples are never peaks.