The Las Vegas Clip Function

Coded in the airport at Las Vegas, this new clip function uses the cycle
finder to detect maxima and minima, and deals with the case where peaks
and troughs are closer than the duration period.