> ----------
> From: Ron Kreymborg[SMTP:
@spam@ronKILLspam
VORTEX.SHM.MONASH.EDU.AU]
> Sent: Thursday, November 06, 1997 12:06 AM
> To:
KILLspamPICLISTKILLspam
MITVMA.MIT.EDU
> Subject: Re: Data Logging
>
> The requirement was that the buffer contents always represent the time
> series being sampled from the BEGINNING of the sample period. Thus for
> example, if it starts sampling at 1 second intervals, after one hour,
> each
> entry should represent a sample in each of the last 60 minutes.
>
> Still can't see for the life of me how to CONTINOUSLY maintain a valid
> set
> of 60 samples in place, but Steve's oversampling suggestion led to my
> best
> solution so far. It requires a little post processing:
>
> 1. Set aside a 120 entry buffer, indexed from 1 to 120.
>
> 2. Set a buffer pointer to point to location 1.
>
> 3. Set the sample period to the initial value (1 second perhaps?).
>
> 4. Set a decrementing sample counter to 120.
>
> 5. Sample at current period until sample counter reaches zero,
> incrementing the buffer pointer after each sample.
>
> 6. Discard every even sample in the buffer, so that locations
> 1,2,3,...59,60 contain the old values 1,3,5,...117,119.
>
> 7. Set the data pointer to point at location 61.
>
> 8. Double the sample period.
>
> 9. Set the sample counter to 60.
>
> 10. Goto 5.
>
> You can see that after step 6, the first 60 locations now represent
> the
> time series to date sampled at what will be the new period.
>
> The sample counter and sample period are also recorded in eeprom. When
> the
> unit is switched off there will be between 60 and 120 samples in the
> buffer, and the sample counter will define those that are valid at the
> last sample period. These entries can then be read from the eeprom and
> interpolated or resampled to produce the required 60 samples in some
> more
> powerful computer. Need to be sure it can't be switched off during
> step 6.
>
> Haven't tested it yet but seems to work on paper.
>
> Ron
>
> > As far as I can see, you need to be oversampling to some extent and
> that
> > would depend on both the resolution of the result you want and the
> step
> > size of this continually moving window.
> >
> (snip)
> >
> > Steve.
> >
> > > If the operator can turn the logger off at ANY given time how
> could
> > > there be 60 samples waiting for you when the logging interval was
> > > never known?
> > >
> (snip)
> > >
> > > Tony
>