Characterizing real-time sampled signal
Try something like this:

$\begin{eqnarray}
\mu(n) &amp;=&amp; (1 - \alpha_1) \mu(n) + \alpha_1 x(n) \\
\bar{x}(n) &amp;=&amp; x(n) - \mu(n) \\
s(n) &amp;=&amp; (1 - \alpha_2) s(n) + \alpha_2 \bar{x}(n)^2 \\
\sigma(n) &amp;=&amp; \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.