I tried your method against method 1 and 2 in the linked thread, and they are very close.
Yes, I can see they would be, since they are my method with nmax = 1.· Or so it apppears to me, but I'm tired.· I imagine this general algorithm, with various values for nmax, has been invented thousands of times -- it's a fairly obvious approach, after all, not much creativity required.
It's nice to know it has at least one name, even two.· Algorithms are like Kzinti -- better off with names.
Question: what happens to the moving average if you calculated an average every five minutes (300 samples)? Thus, for an hour's moving average, you'd only have to average 12 values. Offhand it seems to me to be both easier and more accurate.
Fred Hawkins said...
Question: what happens to the moving average if you calculated an average every five minutes (300 samples)? Thus, for an hour's moving average, you'd only have to average 12 values. Offhand it seems to me to be both easier and more accurate.
I don't think it would be easier.· You would have the added task of keeping track of time, or of counting samples, with no compensating simplification that I can see.
I don't think it would be more accurate either.· Perhaps it would be asaccurate at the five-minute points, but in between times you would·have allowed the error to grow bigger·when you weren't looking.
As Phil pointed out earelier with his posted calculation all of this becomes very simple 32 bit shifts, adds, and subtractions if you use the right number of samples for the desired average. Pick the right number of samples and even writing the blocks to eeprom becomes simple. Unfortunately most of the time we don't get to choose those numbers.
Comments
It's nice to know it has at least one name, even two.· Algorithms are like Kzinti -- better off with names.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net
I don't think it would be more accurate either.· Perhaps it would be as accurate at the five-minute points, but in between times you would·have allowed the error to grow bigger·when you weren't looking.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net