min_detect function

Detect and filter out all minima in a signal