Olin Lathrop wrote: > N. T. wrote: >> That's a good point. And you could take not the first previous >> reading, but also, say, N-th previous reading, depending on the >> mechanical properties of the system. This would average readings on >> last N values. > > Not a good idea. =A0Now the timer must not wrap for at least N pulses. > Not a big deal do extend the timer in software. > What you are really describing is low pass filtering the series of pulse > periods, although you're not thinking about it that way. =A0Your average = of > the last N periods is a low pass filter, just not a particularly good one= .. > You may call it whatever you want, but it is "A simple moving average (SMA) is the unweighted mean of the previous n data points". It can be good and it is widely used in the industry. If you need 10 measurements per second and rotation is 100 per second, that is 400 pulses per second for 4 cylinder engine, why not taking a "simple moving average" over last 16 readings? It's cheap - you need just to shift the value 4 bits. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .