look at ne567 IC
i have no idea, but would a analog in work?
NE567 is a good chip, although I am not sure how much it is used today, because it is so old. Analog is surely on option but I wondered if an AVR could handle this. The problem is, I now nothing about discrete math or DSP programming. And I wondeded if someone has tried something like this. "If you want to be cool, you have to use a controller." Not my exact opinion, but a microcontroller option is good to have.
Yes, Ain would probably work, and then some fancy math. Or something simpler with amplifier, smith trigger and digital input.
I have to stop now, another reply came