>> Is there a way to do an n sample moving average without storing n samples? >> I want to do a 20 sample moving average. Do I need to set aside 20 locations/variables for this task? >> Is there a slicker way? >>Robert Mash > If you are willing to implement an exponential filter (exactly analogous to an RC hardware filter), > you can do much better. From Z transform theory, a one stage recursive filter can be modelled > as > y(n) = x(n) + alpha * y(n-1) I think I made a mistake in the normalization of this formula. It should be y(n) = (1 - alpha) * x(n) + alpha * y(n-1) John Power -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.