Hey ericgibbs,
I've done the simulation with op-s, and everything works fine.
I wanted to use a comparator because I thought they are more precise.
They are designed as comparators not OPA's so you are correct.
Thanks a lot for the above circuit. One more question: Which is the max voltage that I can connect to the Vin input of LM393 in the above circuit?
Do I have to change anything in the scheme if the amplitude of the sines is 5V, 12V or 15V?
Thanks for everything