Shop OBEX P1 Docs P2 Docs Learn Events
Newbie question about EEPROM usage for 12,000 data points on a "rolling average" - Page 2 — Parallax Forums

Newbie question about EEPROM usage for 12,000 data points on a "rolling average"

2»

Comments

  • Carl HayesCarl Hayes Posts: 841
    edited 2009-04-14 03:52
    Beau Schwabe (Parallax) said...

    Here is another thread that discusses averaging moving data....

    http://forums.parallax.com/showthread.php?p=759589



    Carl Hayes,

    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.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2009-04-14 04:19
    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.
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-04-14 04:39
    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 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
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-04-14 04:54
    You also have to take into account the block size of the eeprom when writing your data

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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 HayesCarl Hayes Posts: 841
    edited 2009-04-14 05:42
    Cluso99 said...
    You also have to take into account the block size of the eeprom when writing your data

    Many of them (24LC256, for example) have both page write (64 byte block)·and byte write (single byte)·modes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • kwinnkwinn Posts: 8,697
    edited 2009-04-14 06:12
    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.
Sign In or Register to comment.