> > Is is rather straightforward to calculate from for example the last
> > 100 arrival times but a moving average algorithm would be preferred to
> > reduce CPU load. Do anybody have any ideas?
> 
> If the average is over 64 or 128 samples, then the divide is reduced to
> a 6 or 7 bit rightshift. Or does your chosen micro have hardware divide
> of sufficient length?

Average of 64 or 128 samples probably make no difference for the algorithm. I 
am not sure if there is hardware for division but unless there are to many of 
them it will work anyway although right shift for division may be a good choice 
anyway.

> To average the samples, they need to be stored, I figure, but the long
> summation need not be performed each time. I'd be tempted to store them
> in a circular buffer, then subtract the oldest from the running sum, add
> the new sample, save the result as the new running sum, then divide by
> 64 or 128, using what's fastest to provide the moving average. Writing
> the new sample to the circular buffer overwrites the oldest.

I used this many time for averaging although for times it could be made even 
simpler since times between the first and the last just jitter around in the 
middle of the calculation but make no difference for the final value.

The real problem is moving average phase or arrival calculation.

> Erik


Nicklas Karlsson

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to