How to handle a logarithmic term in Kalman filter?

I am trying to implement a Kalman filter for an echo pulse detection application as similar to this paper. (an open source version is here (pg 16))

The measurement variable is $$h(x,t)=A_0 (\dfrac{t-\tau}{T})^\alpha \cdot \text{exp}{(\dfrac{t-\tau}{T})}$$ and the state vector is $$x=[A_0 \; \text{ } \alpha \; \text{ } T \text{ } \; \tau \text{ }]^T$$.

In order to compute the measurement sensitivity matrix $$H_k=\frac{\partial h}{\partial x}\Bigr|_{\substack{x=\hat{x}_{k^-}}}$$, we need to compute the partial derivative with respect to $$\alpha$$. I obtain it as $$\frac{\partial h}{\partial \alpha}=h \cdot log(\dfrac{t-\tau}{T})$$.

$$\tau$$ would correspond to the start of the envelope of the pulse so it will be greater than first couple of time steps practically speaking. When I iterate the Kalman filter initialized with a real $$\tau$$ for example, then this partial derivative term becomes undefined for the start values of iterations because at $$t=0, 1 \; time step, 2 \; time step \cdots$$etc and so on are smaller than $$\tau$$ and the logarithm is undefined for negative values.

– Ben
Commented Feb 23, 2021 at 19:48
• @Ben please have a look at derivative step. no mistake Commented Feb 23, 2021 at 20:11
• A function like $(-2)^x$ is defined only for integer arguments. It is not defined for real numbers...
– Ben
Commented Feb 23, 2021 at 20:56
• I think the expression should be $A(t) = A_0(\frac{t-\tau}{T})^\alpha\dot e(\frac{t-\tau}{T}) u(t-\tau)$ Basically, A(t) should be 0 for $t < \tau$
– Ben
Commented Feb 23, 2021 at 21:12
• @Ben: that's the answer, feel free to put it down there. Commented Feb 23, 2021 at 21:38

First of all, you're trying to evaluate the derivative of an exponential. If the base of the exponential is positive, the derivative exists. However, if the base is negative, the derivative does not exist. It would be pointless to use a Kalman filter when you have an exponential with a negative base.

Secondly, your model of the echo envelope is $$A(t) = A_0(\frac{t-\tau}{T})^{\alpha}e(\frac{t-\tau}{T})$$

However, since it is an echo, it does not make sense for the echo envelope to be something else than 0 for $$t < \tau$$ where $$\tau$$ is the time of flight

You could add a unit step to the equation to make sure that A(t) = 0 for t < $$\tau$$ $$A(t) = A_0(\frac{t-\tau}{T})^{\alpha} e(\frac{t-\tau}{T}) u(t-\tau)$$

• While one may not implement it as a filter, the derivative of a negative base exponential very much exists. Commented Apr 5, 2021 at 12:11
• @OverLordGoldDragon : Doesn't the derivative of a negative base exponential involve complex numbers?
– Ben
Commented Apr 5, 2021 at 12:13
• Yes, but "does not exist" seldom if ever implies "has imaginary" in mathematics; "isn't real-valued" is more apt. Also my filter statement is per unfamiliarity with Kalman's, may be off; there's complex in RLC circuits for example. Commented Apr 5, 2021 at 12:17
• How about "The derivative of an exponential is not defined for real numbers" ?
– Ben
Commented Apr 5, 2021 at 12:25
• Might imply it's undefined for real inputs; I'd go with "The derivative of a negative base exponential isn't real-valued." Commented Apr 5, 2021 at 20:50