summaryrefslogtreecommitdiffstats
path: root/test/kalman_filter.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/kalman_filter.c')
-rw-r--r--test/kalman_filter.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/kalman_filter.c b/test/kalman_filter.c
new file mode 100644
index 0000000..188ae82
--- /dev/null
+++ b/test/kalman_filter.c
@@ -0,0 +1,26 @@
+#include "ts.h"
+
+bool ts_test_kalman_filter( void )
+{
+ fp_t const x0[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+
+ fp_t const e0[] = {
+ 1.0,
+ 1.5024875621890548,
+ 2.0099009900990099,
+ 2.5245821283270429,
+ 3.0487331327055625,
+ 3.5843788460830162,
+ 4.1333360364582399,
+ 4.6971903124447723,
+ 5.2772810678708257,
+ 5.8746943630334316
+ };
+
+ fp_t const * const x[] = { x0 };
+ fp_t const * const e[] = { e0 };
+
+ struct { fp_t Q; fp_t R; } c = { 0.01, 1.0 };
+
+ return ts_test(ts_kalman_filter, ts_kalman_filter_offset, x, e, 10, (ts_constant_t *)&c, &ts_kalman_filter_p);
+}