I'm working with a variable reluctance sensor to measure RPMs. The sensor produces an ac pulse in the shape shown below, once per revolution, so let's say about 5 to 10 pulses per second for this purpose. Each pulse is maybe 2 milliseconds in length total. I am using a cool little chip, the MAX9926, to take that raw signal and turn it into square digital pulses that I can use to drive an interrupt on a microcontroller. All of that is working great, no problem. Here is my challenge: depending on the direction of the wheel (and/or the polarity of the wiring), the pulse will either start on the upslope (as shown on top) or will start on the downslope (as shown on the bottom). The MAX9926 will trigger the same either way it seems, so I am trying to think of an approach that will let me detect whether it is starting on the upslope or downslope. The raw pulse can spike with much higher voltage than is safe for an interrupt pin on a microcontroller, so it seems to me I need some circuitry that will go high or low depending on the pulse, but I'm wondering if there is a traditional way to do this and/or if anyone has suggestions? Thanks!