tests/filter: Moving average
@@ -20,6 +20,23 @@ tests/test-filter-median2: index filter extract nrmse repmat
rm *.ra ; cd .. ; rmdir $(TESTS_TMP)
touch $@
+tests/test-filter-movingavg: ones zeros join scale filter nrmse
+ set -e; mkdir $(TESTS_TMP) ; cd $(TESTS_TMP) ;\
+ $(TOOLDIR)/ones 3 4 2 1 O.ra ;\
+ $(TOOLDIR)/zeros 3 4 2 1 Z.ra ;\
+ $(TOOLDIR)/join 0 O.ra Z.ra O.ra Z.ra j.ra ;\
+ $(TOOLDIR)/ones 3 1 2 1 o.ra ;\
+ $(TOOLDIR)/scale 0.75 o.ra o75.ra ;\
+ $(TOOLDIR)/scale 0.5 o.ra o5.ra ;\
+ $(TOOLDIR)/scale 0.25 o.ra o25.ra ;\
+ $(TOOLDIR)/scale 0 o.ra o0.ra ;\
+ $(TOOLDIR)/join 0 o.ra o75.ra o5.ra o25.ra o0.ra o25.ra o5.ra o75.ra o.ra o75.ra o5.ra o25.ra o0.ra j_syn.ra ;\
+ $(TOOLDIR)/filter -a 0 -l4 j.ra j_filt.ra ;\
+ $(TOOLDIR)/nrmse -t 0. j_syn.ra j_filt.ra ;\
+ rm *.ra ; cd .. ; rmdir $(TESTS_TMP)
+ touch $@
+
+
-TESTS += tests/test-filter-median tests/test-filter-median2
+TESTS += tests/test-filter-median tests/test-filter-median2 tests/test-filter-movingavg
