V G gmail.com> writes: >=20 > On Sat, Apr 7, 2012 at 7:36 PM, Sergey Dryga dryga.us> wrote= : >=20 > > Getting a clean pulse: use comparator, it will give you a clean digita= l > > signal. > > It's possible to use a comparator in a PIC and do processing using the > > same PIC. > > > > Extracting frequency is more problematic, but can be done in e.g. dsPIC= , as > > others suggested. If you need to detect a specific frequency, LM565 > > phase-locked loop is good for audio frequencies. > > >=20 > I was thinking about the comparator, but since the amplitude of the signa= l > gradually falls over a period of a few seconds, how would I constantly > follow and update the cutoff? >=20 Set the trigger level at some low value which you would still consider to b= e 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 signal (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 lev= el just above the noise.=20 Sergey Dryga http://beaglerobotics.com --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .