worked on FIR-Convolution and LocalMaxima detection
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "../../Assertions.h"
|
||||
#include "../../math/MovingAverageTS.h"
|
||||
#include "../../math/dsp/FIRComplex.h"
|
||||
|
||||
|
||||
/**
|
||||
@@ -145,88 +146,6 @@ public:
|
||||
|
||||
}
|
||||
|
||||
|
||||
//private:
|
||||
|
||||
// /** low pass acc-magnitude */
|
||||
// float avg1 = 0;
|
||||
|
||||
// /** even-more low-pass acc-magnitude */
|
||||
// float avg2 = 0;
|
||||
|
||||
//private:
|
||||
|
||||
// class Stepper {
|
||||
|
||||
// private:
|
||||
|
||||
// /** block for 300 ms after every step */
|
||||
// const Timestamp blockTime = Timestamp::fromMS(300);
|
||||
|
||||
// /** the threshold for detecting a spike as step */
|
||||
// const float threshold = 0.30;
|
||||
|
||||
// /** block until the given timestamp before detecting additional steps */
|
||||
// Timestamp blockUntil;
|
||||
|
||||
|
||||
// public:
|
||||
|
||||
// /** is the given (relative!) magnitude (mag - ~9.81) a step? */
|
||||
// bool isStep(const Timestamp ts, const float mag) {
|
||||
|
||||
// // still blocking
|
||||
// if (ts < blockUntil) {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// // threshold reached? -> step!
|
||||
// if (mag > threshold) {
|
||||
|
||||
// // block x milliseconds until detecting the next step
|
||||
// blockUntil = ts + blockTime;
|
||||
|
||||
// // we have a step
|
||||
// return true;
|
||||
|
||||
// }
|
||||
|
||||
// // no step
|
||||
// return false;
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// };
|
||||
|
||||
// Stepper stepper;
|
||||
|
||||
//public:
|
||||
|
||||
// /** does the given data indicate a step? */
|
||||
// bool add(const Timestamp ts, const AccelerometerData& acc) {
|
||||
|
||||
// avg1 = avg1 * 0.91 + acc.magnitude() * 0.09; // short-time average [filtered steps]
|
||||
// avg2 = avg2 * 0.97 + acc.magnitude() * 0.03; // long-time average [gravity]
|
||||
|
||||
// // average maginitude must be > 9.0 to be stable enough to proceed
|
||||
// if (avg2 > 9) {
|
||||
|
||||
// // gravity-free magnitude
|
||||
// const float avg = avg1 - avg2;
|
||||
|
||||
// // detect steps
|
||||
// return stepper.isStep(ts, avg);
|
||||
|
||||
// } else {
|
||||
|
||||
// return false;
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user