> - Keep last average of individual square values and > corresponding square root; > - Calculate the difference between new average and > that last average of individual square values. > - Divide the difference by 2 (do you remember what's > the derivative of square function?) Typo, sorry. It should be "Divide the difference by 2 multiplied by old square root"; For example: - old average of individual square values = 40000 - old square root 200 - new average of individual square values = 41000 41000-40000=1000 1000/(2*200)=2.5 202.5*202.5=41006.25 41006.25 is almost equal to 41000 Thus 202.5 should be taken as square root of 41000 New voltage 202.5 has been found in one cycle. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist