ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
KalmanFilter.h
Go to the documentation of this file.
1/**
2 * @file KalmanFilter.h
3 * @brief Provides a template-based implementation of a Kalman Filter.
4 *
5 * The Kalman Filter is used for estimating the state of a system in the presence
6 * of noise. It is widely used in signal processing, control systems, and navigation.
7 *
8 * @date 22/12/2024
9 * @version 1.0
10 * @author Coela Can't
11 */
12
13#pragma once
14
15/**
16 * @class KalmanFilter
17 * @brief Implements a generic Kalman Filter for 1D data.
18 *
19 * This class provides a template-based implementation of a Kalman Filter
20 * for filtering noisy data. It estimates the true value by accounting for
21 * process noise and sensor noise.
22 *
23 * @tparam T The numeric type for the filter (e.g., `float`, `double`).
24 */
25template<typename T>
27private:
28 T processNoise; ///< The process noise variance.
29 T sensorNoise; ///< The sensor noise variance.
30 T estimation; ///< The current estimation of the value.
31 T errorCovariance; ///< The error covariance of the estimation.
32
33public:
34 /**
35 * @brief Constructs a `KalmanFilter` with specified noise parameters.
36 *
37 * @param processNoise The process noise variance.
38 * @param sensorNoise The sensor noise variance.
39 * @param errorCovariance The initial error covariance.
40 */
42
43 /**
44 * @brief Filters the given input value using the Kalman Filter algorithm.
45 *
46 * @param value The noisy input value to be filtered.
47 * @return The filtered estimate of the value.
48 */
49 T Filter(T value);
50};
51
52#include "KalmanFilter.tpp" // Includes the implementation of the template.
Implements a generic Kalman Filter for 1D data.
KalmanFilter(T processNoise, T sensorNoise, T errorCovariance)
Constructs a KalmanFilter with specified noise parameters.
T processNoise
The process noise variance.
T Filter(T value)
Filters the given input value using the Kalman Filter algorithm.
T estimation
The current estimation of the value.
T sensorNoise
The sensor noise variance.
T errorCovariance
The error covariance of the estimation.