To avoid repetitive extrema, we select at most one maximum and minimum in each sliding window of 10 Hz.
if there are multiple minima or maxima in one sliding window, we select a winner based on amplitude and discard the others.