Clipping is the main program. There are three inputs: y is the time record, threshhold_value is the clipping threshhold, and threshhold_samples is the number of consecutive data points exceeding the threshhold_value to indicate that the data is clipped.
The program returns two cells arrays (clipped_max, clipped_min) indicating the length and indices of the clipped data. clipped_max indicates data chunks greater than threhhold_value.
clipped_min indicates data chunks less than -1*threhhold_value.
Fixed bug in listing the clipped indices. Number of consecutive values can now be 1.