|$\Delta x$ =|
So how does this line-segment trick help handle nonlinear relationships in our Kalman Filter? Consider a very simple filter with the following linear equation for its sensor: \[ z_k = 3 x_k +2 \] This equations says that the sensor reading is always three times the corresponding state value, plus two: no matter what the state value, the sensor reading is always three times that value plus two. Now consider a nonlinear sensor equation: \[ z_k = log_2(x_k)\] This equation says that the sensor reading is the logarithm (to the base 2) of the state value: a typical relationship, for example, in our sensation of pitch as a function of frequency. Even if you've never heard of a logarithm before, a quick look a the following table of approximate values shows that the relationship between the state $x_k$ and the sensor reading $z_k$ is not as straightforward as the previous one:
Here, you can see that there are no constants $a$ and such that $z_k = a x_k + b$. We can, however, use our line-segment insight from above to derive a different set of values $a_k$ and $b_k$, one for each timestep, that approximates such a relationship. If you studied calculus, you may remember that we can compute the first derivative of many nonlinear functions ($log$, $sin$, $cos$, etc.) directly. If you didn't study calculus, don't feel bad: the first derivative of a function is really just the best linear (line-segment) approximation to that function at each given point. A little Googling reveals that the first derivative of $log_2(x)$ is approximately $1 / 0.693x$, which makes sense: as $x$ increases, the value of $log_2(x)$ goes up more and more gradually.
Previous: Nonlinearity Next: A Nonlinear Kalman Filter