Is it possible to represent or approximate the moving average $m(t) = \frac{1}{w}\int_{t-w}^t x(\tau) d\tau$ of a function $x(t)$ as a set of ordinary differential equations $\dot{y} = \ldots$?
I am wondering this because I would like to understand if it is possible to encode the moving average (or a suitable approximation) in state space form.
Thanks for your input.
If you apply the fundamental theorem of calculus, you will find that $$ \frac{dm}{dt} = \frac1w x(t) - \frac1w x(t-w). $$ This is a delay differential equation, not an ODE.
Perhaps you might find it easier to deal with an exponentially-weighted moving average. If $$ m(t) = \frac1w \int_{-\infty}^{t} x(\tau)e^{-(t-\tau)/w}\,d\tau. $$ Then $$ \frac{dm}{dt} = \frac1w x(t)-\frac1w m(t), $$ which might work depending on what you want if you make $m(t)$ also a state variable.