feat: iterate on SsfStepDetector

* use SSF signal instead of accelerometer signal
* use higher BEAT_CORR_THR_{12} for SSF signal
* add absolute SSF_THRESHOLD to ignore small accelero bumps
* compute ssf_threshold according to detected SSF peaks, not the mean (more robust vs. noise)
This commit is contained in:
2026-03-11 20:47:53 +01:00
parent 95d1fee44d
commit 90f8943930
8 changed files with 103 additions and 27 deletions

View File

@@ -13,7 +13,7 @@
class Buf {
protected:
std::vector<double> data;
size_t size;
size_t N;
size_t n;
public:
Buf(size_t N);
@@ -21,7 +21,7 @@ public:
};
/** Running filter base. */
class Filt : Buf {
class Filt : public Buf {
protected:
std::vector<double> taps;
size_t shift;
@@ -31,6 +31,9 @@ public:
double filter(double val);
double peek();
void push(double val);
/** prime the filter by overwriting the entire buffer with 'val' */
void prime(double val);
size_t size();
};
/** Running IIR filter. */

View File

@@ -6,6 +6,7 @@
#define PASADASUPERPROJECT_SIGNAL_H
#include <vector>
#include <deque>
namespace pd_signal {
/** `num` evenly spaced numbers over interval [start,stop] */
@@ -33,6 +34,8 @@ namespace pd_signal {
/** two-dimensional mean of a collection of signals */
void mean(std::vector<double> &out, std::vector<std::vector<double> >& m);
/** two-dimensional mean of a collection of signals */
void mean(std::vector<double> &out, std::deque<std::vector<double> >& m);
}

View File

@@ -37,10 +37,12 @@ protected:
const size_t LEN_TH_WIN;
size_t num_samples;
double ssf_threshold;
double ssf_threshold_nm1;
Filt f_ssf_threshold_smoothing;
size_t len_refr;
size_t n_refr;
bool is_refr;
double nm1_ssf;
double ssf_nm1;
Filt f_ssf_mean;
public:
/**