Is there a way to modify the exponential smoothing function to account for varying sample rates?

212 Views Asked by At

I am using a simple exponential smoothing formula to smooth a signal.

X(n) = a * S(n) + ( 1 - a ) * X(n-1)

However on certain setups, the sample rate is much higher than others. This causes the high sample rate to adjust quicker to a change than the low sample rate.

For example in the diagram below the red sample rate is constantly half the blue sample rate. It reacts to the step function in twice the time.

enter image description here

How can I modify the exponential smoothing factor, a, so that it accounts for how long it has been since the last sample? I.e. to bring the red and blue lines together.

1

There are 1 best solutions below

0
On BEST ANSWER

The system's impulse response is

$$h(n)=a(1-a)^n$$

If you want the same time constant for different sampling intervals you need to transform the smoothing constant in this way:

$$1-a'=(1-a)^{T'/T}$$

where $a$ is the constant corresponding to sampling interval $T$, and $a'$ corresponds to sampling interval $T'$.