modified version of a Canny edge detector in 1D to identify on/off transitions