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.

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.
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'$.