We have implemented a way of approximating a data set with the following lines of code based on the dx/dt of wikipedia of leaky integrator.
dy = -A * y_previous + C
y_current = y_previous + dy*delta_t
However, I am uncertain if we are allowed to call the following truly a leaky integrator. I was a bit confused how to get the general solution with Laplace transforms from the wikipage with this because of the delta_t
in our implementation. I have to add that I am slightly familiar with Laplace, but not with z-transformations and I was told I needed this since it's discrete.
With delta_t
being the difference in time between t_current and t_previous, which is a constant value. I think we may have created a leaky integrator due to delta_t
being a constant, if I would for instance call delta_t
(alpha), C
to x_t
, and rewrite it a bit, it seems more similar to sources I found online (1, 2, 3):
So then with the z-transform I have determined the transfer function:
My questions are:
- Is in this case indeed the
delta_t
kind of similar to the cited sites? - So is this indeed a leaky integrator?
- What can I say about the values A and can be for stability of the leaky integrator? Should indeed hold: