Hi Data Logger Coders: I've been following the thread on the 60 sample evenly spaced - but my question is "Why evenly spaced samples?". What's the basic reason for sampling in this manner? If the intent is reconstruct a signal waveform, changing the sample interval by Nyquist theory will reduce the reconstructed waveform bandwidth directly with the increased time between samples. So what is the importance of even samples? Have I missed a post on the basics? Who or what is the signal observer and what is the signal source? Mike Keitz is right on the fundamentals of simple resampling - linear interpolation does work. You only need to use more complex DSP routines if you want to account for sampling aperture (sinc 1/fs rolloff) and sample resolution. If the human eye is the observer, 8 bits and linear resampling is transparent. However, if it is the human ear, 8 bits and linear resampling sounds good only if the original signal is oversampled by a factor 10 or more (CD playback chips use 16x or more with 6+ order elliptic DSP filters for 16 bit Hi Fi). PS: The term 'warping' when applied to voice or other sampled signals usually refers to changing the time or pace of the signal without a frequency shift or pitch change. -Wayne > ---------- > From: Ron Kreymborg[SMTP:ron@VORTEX.SHM.MONASH.EDU.AU] > Sent: Thursday, November 06, 1997 12:06 AM > To: PICLIST@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 >