Let the cutoff also work for negative pulses

Extend the working of the left and right cutoff to make it work for both
the positive and negative pulses i.e. if a negative pulse happens before
a positive one, set the left cutoff to the negative point which first
crosses the baselineThreshold
Update the test array in test_static to test the cutoff handling for negative pulses