|
| KalmanFilter (float process_noise=0.01f, float measurement_noise=1.0f) |
| Construct a new Kalman Filter object.
|
|
void | addMeasurement (float measurement) |
| Updates the filter with a new measurement and returns the filtered value.
|
|
bool | begin () |
| Reset the filter state to zero, keeping the current noise parameters.
|
|
bool | begin (float process_noise, float measurement_noise) |
| reset the filter with new parameters
|
|
float | calculate () |
| Returns the current estimated value.
|
|
void | end () |
| End or clear the filter (sets the estimate to zero).
|
|
Simple 1D Kalman Filter for smoothing measurements.
This class implements a basic one-dimensional Kalman filter for smoothing noisy measurements. It is useful for sensor data fusion and signal processing applications where noise reduction is required.
The Kalman filter uses two main parameters:
- process_noise (Q): Represents the expected process variance. A typical default is 0.01.
- measurement_noise (R): Represents the expected measurement variance. A typical default is 1.0.
Lower values for Q make the filter trust the model more (less responsive to changes), while higher values for R make the filter trust the measurements less (more smoothing).
- Note
- Reasonable defaults for many sensor applications are Q = 0.01 and R = 1.0, but these should be tuned for your specific use case.
- Author
- Phil Schatzmann