diff --git a/app/src/main/cpp/StepDetector.cpp b/app/src/main/cpp/StepDetector.cpp index 3765520..17441a6 100644 --- a/app/src/main/cpp/StepDetector.cpp +++ b/app/src/main/cpp/StepDetector.cpp @@ -24,7 +24,8 @@ StepDetector::StepDetector(StepListener *listener) : f_highpass(hpf_taps_b, hpf_taps_a), f_neg(1, 0, 0, std::vector {-1.0}), f_ssf(upslope_width), - f_ssd(len_refr) + f_ssd(len_refr), + f_sqi(upslope_width) {} #if (FPS != 60) @@ -38,7 +39,9 @@ void StepDetector::filter(std::vector values) { auto s2 = f_neg.filter(s1); auto s3 = f_ssf.filter(s2); auto s4 = f_ssd.filter(s3); - if(s4 > 0.0 && listener != nullptr) { + auto q5 = f_sqi.filter(s2, s3, s4); + // is step, step quality is OK, and we have a listener? + if(s4 > 0.0 && q5 > 0.0 && listener != nullptr) { listener->playBeat(); } } diff --git a/app/src/main/cpp/StepDetector.h b/app/src/main/cpp/StepDetector.h index 68a424e..66145dd 100644 --- a/app/src/main/cpp/StepDetector.h +++ b/app/src/main/cpp/StepDetector.h @@ -17,6 +17,7 @@ protected: Filt f_neg; SsfFilter f_ssf; SsfStepDetector f_ssd; + RunningQualityFilter f_sqi; public: StepDetector(StepListener *listener); diff --git a/app/src/main/cpp/libpasada b/app/src/main/cpp/libpasada index fe300da..ba923c5 160000 --- a/app/src/main/cpp/libpasada +++ b/app/src/main/cpp/libpasada @@ -1 +1 @@ -Subproject commit fe300dabd307fcfc9f22a05c95427e3c0e7b3ceb +Subproject commit ba923c53bdf1dc1b64f58dafdedcea1096fbdf92