At 04:05 PM 2/15/01 -0600, you wrote: >Is there a "standard" algorithm for counting the number of cycles in a >signal based on the peaks and valleys in that signal? In analog electronics, this could be done by low-pass filtering the signal, AC coupling it, and applying a zero-crossing detector with some hysteresis. You can do the same thing digitally, assuming the frequency isn't too high. If the signal has multiple humps in it or is otherwise strange, you may have to do a bit more work. Best regards, =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu