2
$\begingroup$

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})$. enter image description here

$\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.

$\endgroup$
7
  • $\begingroup$ I'm pretty sure you made a mistake in your derivative $\endgroup$
    – Ben
    Feb 23, 2021 at 19:48
  • 1
    $\begingroup$ @Ben please have a look at derivative step. no mistake $\endgroup$
    – aadil095
    Feb 23, 2021 at 20:11
  • 1
    $\begingroup$ A function like $(-2)^x$ is defined only for integer arguments. It is not defined for real numbers... $\endgroup$
    – Ben
    Feb 23, 2021 at 20:56
  • 1
    $\begingroup$ 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$ $\endgroup$
    – Ben
    Feb 23, 2021 at 21:12
  • 2
    $\begingroup$ @Ben: that's the answer, feel free to put it down there. $\endgroup$
    – TimWescott
    Feb 23, 2021 at 21:38

1 Answer 1

4
$\begingroup$

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) $$

$\endgroup$
5
  • 1
    $\begingroup$ While one may not implement it as a filter, the derivative of a negative base exponential very much exists. $\endgroup$ Apr 5, 2021 at 12:11
  • $\begingroup$ @OverLordGoldDragon : Doesn't the derivative of a negative base exponential involve complex numbers? $\endgroup$
    – Ben
    Apr 5, 2021 at 12:13
  • 1
    $\begingroup$ 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. $\endgroup$ Apr 5, 2021 at 12:17
  • $\begingroup$ How about "The derivative of an exponential is not defined for real numbers" ? $\endgroup$
    – Ben
    Apr 5, 2021 at 12:25
  • 1
    $\begingroup$ Might imply it's undefined for real inputs; I'd go with "The derivative of a negative base exponential isn't real-valued." $\endgroup$ Apr 5, 2021 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.