moving average/rolling average
yarisboy
Posts: 245
Hi,
I searched the OBEX and this forum for a simple five sample simple moving average routine. I found one object that was way off the deep end for complexity. I would think some clever trick with absolute address space may be in order but I've never tried that yet with the Prop. Thoughts?
I searched the OBEX and this forum for a simple five sample simple moving average routine. I found one object that was way off the deep end for complexity. I would think some clever trick with absolute address space may be in order but I've never tried that yet with the Prop. Thoughts?
Comments
error := SomeValue
Darray[2] := error - PrevError
Daverage := (Darray[0] + Darray[1] + Darray[2])/3
PrevError := error
John Abshier
I will need. THANKS!!!
I won't have it in the EEPROM until Friday. I'll be able to see the effect on the tachometer DRO on the commute to work on Saturday. Switching to cat 5 cable and tightening the connections to the breadboard already killed some of the display jitter. jw_freqin is working well at 5 samples per second.
Stan
As spoon-feeding is demanded, let the spoon-feeding begin.... <grin>
The attached demo uses PST to display the array values as well as the average. The display is refreshed after each new entry.
Way cool! I now have two data streams to smooth because this evening I got the programmable speedometer read out working in concert with the tachometer. 90% of the software is the same. The breadboard and coding stage of the project now stands at 50% complete.