2026-03-12 20:34:54 +01:00
|
|
|
//
|
|
|
|
|
// Created by david on 11.03.2026.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#ifndef PASADASUPERPROJECT_TEST_HELPERS_H
|
|
|
|
|
#define PASADASUPERPROJECT_TEST_HELPERS_H
|
|
|
|
|
|
|
|
|
|
#include "npy.hpp"
|
|
|
|
|
#include "ssf_filter.h"
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
template <typename T> static std::vector<double> apply_filter(T& filter, std::vector<double>& x) {
|
|
|
|
|
std::vector<double> y;
|
|
|
|
|
y.resize(x.size());
|
|
|
|
|
for (int i = 0; i < x.size(); i++) {
|
|
|
|
|
y[i] = filter.filter(x[i]);
|
|
|
|
|
}
|
|
|
|
|
return y;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void npy_save(std::string path, std::vector<double>& x);
|
2026-03-12 21:28:50 +01:00
|
|
|
void npy_save(std::string path, std::vector<bool>& x);
|
2026-03-12 20:34:54 +01:00
|
|
|
|
|
|
|
|
std::vector<double> fetch_y_axis(npy::npy_data<double>& acc);
|
|
|
|
|
|
|
|
|
|
/** Returns the ssf_threshold as the filter output for debugging. */
|
|
|
|
|
class DebugSsfStepDetectorThreshold : public SsfStepDetector {
|
|
|
|
|
public:
|
|
|
|
|
DebugSsfStepDetectorThreshold(size_t len_refr);
|
|
|
|
|
double filter(double val);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif //PASADASUPERPROJECT_TEST_HELPERS_H
|