| Despite some saying this is not a Kalman filter I'd argue that it is, although a quite simple stationary Kalman filter. I'm not saying calling it a low-pass filter or IIR is wrong, but that there is not a clear distinction in this case. Hear me out: The general model for a linear system is:
x(t+1) = A * x(t) + B * u(t) + v1(t)
y(t) = C * x(t) + D * u(t) + v2(t) Generally, x (state), y (measurement) and u (input) are vectors, A,B,C,D matrices and v1, v2 noise. The optimal Kalman estimate for this system is:
xhat(t+1|t) = A * xhat(t|t-1) + B * u(t) + K(y(t) - C * x(t|t-1) where K is the Kalman gain which might be calculated for each update step or in the case of a stationary Kalman filter will be calculated to a fix value. The idea behind using a fix value is that generally, K(t) will converge as the filter runs. Now say the state x is scalar, the model is that x is always the same and unaffected by input (A = 1, B = 0) and that we measure the state directly and that also the measurement is unaffected by input (C = 1, D = 0). Let's also say K = 0.04, it might well be. Then:
xhat(t+1|t) = xhat(t|t-1) + 0.04 * (y(t) - x(t|t-1) <=> display_temp += 0.04 * (adc_temp - display_temp) Thus for the model that
1) the oven temperature is constant and
2) unaffected (at least not quickly affected) by the temperature control and
3) that we measure temperature directly and
4) the assumption that the stationary Kalman gain is 0.04,
this is a (stationary) Kalman filter. |