peter green ha scritto: > A FFT is overkill unless you actually want to measure the harmonics. indeed, I guess that's true > Trying to detect the peak value and scale that is IMO a bad idea because > a single brief spike could throw the reading way off. that's true, even if I could perform some averaging here and there. > Taking the average of the magnitude and scaling it would probablly be a > reasonable option. True RMS is also pretty easy to calculate (square the > individual values, average them and take the square root at the end) ok > Ideally for stable values you should detect the zero crossings and do > your averaging (whether true RMS or average of the magnitude) over a > whole number of half-cycles. yeah, point taken, will try to use it. > Also 100Hz is about the worst choice of sampling rate you could pick. > Combine that with a 50Hz waveform and you may miss all the peaks! If you > want good results from simple algorithms within a single cycle i'd > suggest at least 1KHz. If you are averaging over many cycles and can't > afford to sample quickly make sure you select a sample rate that is NOT > a multiple or subdivision of the supply frequency! yeah :) I definitely wrote 100Hz but of course had my mind set elsewhere :) I agree in that. The device has actually "plenty of time" to perform even a lot of reading, since (as I wrote in my other reply) the response time is in the order of seconds. thank you Peter -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist