add: GravityFilter
This commit is contained in:
@@ -44,6 +44,8 @@ namespace pd_signal {
|
||||
double mean(const std::vector<double>& in);
|
||||
void diff(std::vector<double>& out, const std::vector<double>& in);
|
||||
|
||||
std::vector<double> gauss(size_t N, double mu, double sigma);
|
||||
|
||||
/**
|
||||
* Convolution of two polynomials given in ASCENDING power order.
|
||||
* If <c>p = p_0 + p_1 x + ... + p_{P-1} x^{P-1}</c> and likewise for q,
|
||||
|
||||
@@ -48,4 +48,17 @@ public:
|
||||
void primeFilters(double fps, std::vector<double> sig);
|
||||
};
|
||||
|
||||
/** mean-filter the gravity vector, then take acceleration downwards */
|
||||
class GravityFilter {
|
||||
size_t N;
|
||||
std::vector<double> gauss_taps;
|
||||
Filt gx;
|
||||
Filt gy;
|
||||
Filt gz;
|
||||
public:
|
||||
// 5 secs buffer, prime y with direction of gravity (for tests & faster init)
|
||||
GravityFilter(double fps);
|
||||
double filter(std::vector<float> values);
|
||||
};
|
||||
|
||||
#endif //PASADASUPERPROJECT_STEP_DETECTOR_H
|
||||
Reference in New Issue
Block a user