Nope! You don't really need Kalman filtering in this context!
To perform outliers rejection, there are other techniques that you can apply successfully and more easily without the bother of dealing with the Kalman filter's requirements.
Kalman filtering can be demonstrated to be the optimal stochastic filter when we have:
- a linear model of our process.
- Gaussian noise affecting the measurements.
In reality, neither condition 1 nor condition 2 are ever verified, as the model cannot encapsulate the whole knowledge of our physical system and the noise is never perfectly Gaussian. Anyway, engineers do not tend to get scared about that and keep applying Kalman filtering and its variants everywhere regardless of the extent to which those conditions are true.
If we think about it, the same applies to PID controllers, which are linear systems and as such can be used only paired with linear processes. There exists no single linear process in nature. What the heck? Well, who cares, we keep on using both PID and Kalman estimator, which do work really great!
In this digression, I have purposely exaggerated the context, as engineers are pretty much careful to gauge the limits of applicability of these useful linear tools (the extent I mentioned earlier). To this end, they study the model of the process at hand together with its relevant properties, which is often the very first step of the analysis.
Do you have a model for your process and a rough estimate of the noise statistics? If the answer is yes, you could continue to have a deeper look and make attempts to characterize this model (identification) and work out a good first guess for the noise and process variance to then run some tests to verify your hypotheses. However, this would entail that you sit down and put in a non-negligible effort.
Want to try out something simpler, where resorting to heuristics is – so to speak – more reasonable and sound than betting with Kalman parameters? Well, make use of Median Filtering!
Median filtering is a very simple nonlinear technique that does its best with outliers removal without introducing significant lag in the response.
You can appreciate the 1D median filter at work here: