find_peaks function

Find local or global maxima (peaks) or minima (valleys)