I just did a design that used a Maxim part: http://www.maxim-ic.com/datasheet/index.mvp/id/5822 It uses a threshold that is a proportion of the output of a peak detector. Neat idea, this part makes it easy. MAX9924. Bob On Mon, Apr 9, 2012, at 07:07 AM, V G wrote: > On Mon, Apr 9, 2012 at 1:04 AM, Sergey Dryga wrote: >=20 > > Set the trigger level at some low value which you would still consider > > to be a > > signal. Anything above that level will produce "1", below - "0". This > > way you > > eliminate the problem of decay in the amplitude. For an AC-coupled sig= nal > > (through a capacitor) the level can be 1/2 V+. Essentially, this will = be a > > zero-crossing detector. If the noice is too high, increase the trigger > > level > > just above the noise. > > >=20 > I thought about this too, but the signal is not a clean sin wave. It's > unpredictable and has lots of different signals mixed in, so a > fluctuation > mid-period from a wave other than the fundamental frequency can cause a > false trigger. >=20 > If I had my camera with me, I'd take a picture of the oscilloscope. > --=20 > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.fastmail.fm - Choose from over 50 domains or use your own --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .