you can calculate the absolute difference between adjacent values, and then maybe slightly adjust things using a sliding window, and then find areas where the smoothed absolute difference values ββare at 50% of the maximum value.
using python (you have python in the tags), it will look like this:
a = ( 10, 11, 9, 10, 18, 5, 20, 6, 15, 10, 9, 11 ) diffs = [abs(i[0]-i[1]) for i in zip(a,a[1:])] # [1, 2, 1, 8, 13, 15, 14, 9, 5, 1, 2] maximum = max(diffs) # 15 result = [i>maximum/2 for i in diffs] # [False, False, False, True, True, True, True, True, False, False, False]
lenik
source share