updated method with which frame preceding spike is found. originally, i was doing something rather complicated, involving min(abs(something)). now it is just summing a logical array, which gives the index immediately, and is about 2x faster.