The Kalman filter makes an estimate of the future value of the measurement, and then compares the actual value by a statistical analysis to compensate for the error in future measurements.
In its general version involves the performance of complex calculations, for Arduino is a simpler filter called complementary filter. A simplification of the Kalman filter that completely dispenses with statistical analysis.