# Characterizing real-time sampled signal

I have a signal which is sampled in real-time. At every time interval I receive a value. I need to characterize this signal as active or inactive (to take priority in the control actions). By active it means that we observe big changes over a specific time-window.

One way to do it as I consider, is to keep a history of N samples and calculate the mean value and the standard deviation with an update algorithm. Based on the std I can say if it is inactive or not. The problem is that I have tens of thousands of signals and the sampling period is not the same on all of them. So, keeping a variable length sample history for all the signals will be difficult.

For the mean value I can use averaging with forgetting factor. The forgetting factor can be connected to the sampling period of each signal to have a similar observation window on all signals.

## Now the question:

Is there any metric similar to averaging with forgetting factor that can give me the same information as std? It has to be low on memory usage and computationally light (since it's a real-time operation).

Any papers, books or references are welcome!

$\begin{eqnarray} \mu(n) &=& (1 - \alpha_1) \mu(n) + \alpha_1 x(n) \\ \bar{x}(n) &=& x(n) - \mu(n) \\ s(n) &=& (1 - \alpha_2) s(n) + \alpha_2 \bar{x}(n)^2 \\ \sigma(n) &=& \sqrt{s(n)} \\ \end{eqnarray}$
This is equivalent to sending your input signal to a 1-pole DC blocking high-pass filter with a pole at $\alpha_1$, then sending the result to a RMS detector whose response time is set by $\alpha_2$ - to measure how much the signal is wiggling once its central trend has been removed.
Observe that $\sigma(n)$ is consistent with the definition of the standard deviation.