Time Averaging?
vseli
Hi there, I'm a fairly novice IGOR user--I've gone through all of the Guided Tours but I can't seem to figure out how to do a time average.
I currently have 1 minute data that I would like to average to 5 minutes. Is there an IGOR function that can do this, or procedure out there that is available?
Thanks!
Have at look at Resample/DOWN=5 data. That might be what you are looking for.
November 2, 2018 at 12:54 pm - Permalink
In reply to Have at look at <igor… by olelytken
The original question is vague. I interpreted it to mean that the data wave is sampled at one-minute intervals, and a running average over 5 samples is desired. If this is the case, I would suggest that Smooth would be appropriate
DisplayHelpTopic "Smooth"
For single-pass boxcar (sliding average) smoothing, the command would look like
Smooth/B 5, myDataWave
November 2, 2018 at 01:25 pm - Permalink
In reply to Have at look at <igor… by olelytken
This is exactly what I needed, thank you!
November 2, 2018 at 02:02 pm - Permalink
Using a boxcar smoothing can be incorrect, because you end up with 5x more data points than actual information. You should at least set every value which is not a multiple of 5 points to NaN, in the above example.
Alternatively, the Histogram function can be exploited to retrieve time averages very quickly. The downside is that it doesn't provide uncertainties for the averages. I have a fancier function for uncertainties if you are interested.
make /o averagedWave; histogram /C /W=INPUT_DATA /B={date2secs(2015,09,07) + 10*3600 + 50*60, 20, 1000} INPUT_TIMES OUTPUT_AVG
OUTPUT_AVG /= TMP_COUNTS
November 9, 2018 at 06:34 am - Permalink
In reply to Using a boxcar smoothing can… by jcor
Joel,
I fail to understand your argument. Attached is a simple example of linear data with Gaussian noise, and its Smooth result
wave0 = x + gnoise(4)
duplicate/O wave0, wave00
smooth/B 5, wave0
A resulting graph is attached. Both waves have 500 points.
November 9, 2018 at 11:49 am - Permalink
In reply to Joel, I fail to understand… by s.r.chinn
I think Joel is making the case that the result of 5 point averaging should be condensed (decimated) into a wave that is only 1/5th the length, with each point representing the average of the 5-point window.
The Decimate procedure does this:
#include <Decimation>
Contains the Decimate procedure which creates an output wave by averaging every n points of the input wave down to a one point in the output wave.
November 9, 2018 at 02:34 pm - Permalink
Jim,
Thanks for that interpretation. Is there a quantifiable figure-of-merit that argues for one method over the other? In a counter-example (probably not appropriate to the slow 1-s sampling originally requested), rapidly sampled data is best smoothed by a matched filter to optimize signal-to-noise. Also, box-car averaging using hardware has been a well-known experimental technique for repetitive signals, using commercial instruments.
Perhaps Vanessa should consider using binomial smoothing with Smooth/BLPF[=roundMode ] if she has any idea about which high-frequencies are to be rejected from her data.
November 10, 2018 at 06:19 am - Permalink