I need to calculate an exponential moving average for a series of data. The intended sampling interval is fixed (say 1s) but the data stream has varying intervals (data intervals vary from 0.01s to 10s or so). The data is somewhat noisy (a random data sample would virtually never be on the average).
My impression is that I cannot thus just take the most recent data sample at each interval, as that could easily lead to a misleading stat. I reckon I can somehow just calculate the average for each period and take that as the sample, but I'm not positive.
Is there a standard algorithm that manages an exponential moving average on a time-variable data stream?
I need to program this for a real-time system where it won't be possible to store a sample history. Nonetheless, I'm sure I can adapt any non-streaming algorithm to the streaming form.