summaryrefslogtreecommitdiff
path: root/include/SimpleKalmanFilter.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/SimpleKalmanFilter.h')
-rw-r--r--include/SimpleKalmanFilter.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/SimpleKalmanFilter.h b/include/SimpleKalmanFilter.h
new file mode 100644
index 0000000..61b682e
--- /dev/null
+++ b/include/SimpleKalmanFilter.h
@@ -0,0 +1,32 @@
+/*
+ * SimpleKalmanFilter - a Kalman Filter implementation for single variable models.
+ * Created by Denys Sene, January, 1, 2017.
+ * Released under MIT License - see LICENSE file for details.
+ */
+
+#ifndef SimpleKalmanFilter_h
+#define SimpleKalmanFilter_h
+
+class SimpleKalmanFilter
+{
+
+public:
+ SimpleKalmanFilter(float mea_e, float est_e, float q);
+ float updateEstimate(float mea);
+ void setMeasurementError(float mea_e);
+ void setEstimateError(float est_e);
+ void setProcessNoise(float q);
+ float getKalmanGain();
+ float getEstimateError();
+
+private:
+ float _err_measure;
+ float _err_estimate;
+ float _q;
+ float _current_estimate = 0;
+ float _last_estimate = 0;
+ float _kalman_gain = 0;
+
+};
+
+#endif