Online algorithm for discrete time serie derivate

16 Views Asked by At

I'm looking for an algorithm to compute the numeric derivative $\dot x_i$ of a discrete time serie $(x_i, t_i)$.

  • It runs in realtime, hence $\dot x_i$ can only depend on $x_{j<=i}$.

  • The memory resource is scarce, ideally it only access the passed sample and andother value (either state or a sample), eventually more sample and more states can be used if this proves useful.

  • The result should be robust to $x_i$ integer, especially then the derivative is close to zero and the $x_i$ serie has consecutive identical values.

For now I'm using and empirical method:

$$ \dot x_i = \begin{cases} \dot x_{-1}=0 & \text{for } i = 0 \\ ( 1 - q )\dot x_{i-1} + q \dfrac{ x_i - x_{i-1}}{t_i - t_{i-1}} & \text{with } q \in [0, 1] \end{cases} $$

With $q = 1$ this is the instant derivate.

With $q < 1$ it takes into account the past samples by anoly accessing the previous sample and the previous derivate.

What are the existing mathematically founded methods that could be applied?