max_detect function

Detect and filter out all maxima in a signal