I need to calculate the slope of a temperature (Kelvin/s) from a temperature sensor.
The solution today is an Kalman filter with static kalman gain. This filter gives wery smooth derivative/slope. But it causes a phase shift of the derivative.
I don't know how to fine tune the Kalman gain.
Is there another method for calculating slope in real time?
I can't just take (T - T(n-1)) / sampletime. It gets too noisy. And if I filter the temperature first it gets a phase shift.
So you need a noise rejection filter and you have a sampling rate which has a maximal signal bandwidth that can exceed the Shannon sampling theorem rate.
But you are only interested in real-time rate changes of temperature but know that phase shift with filtering causes time delay or group delay.
Can you model a raised cosine filter on the sensor data in KF at 1/2 the sampling rate? ( don't ask me)