Skip to content

Commit

Permalink
split and move sma and freq analyzers
Browse files Browse the repository at this point in the history
  • Loading branch information
rtlopez committed Nov 7, 2024
1 parent 244de0e commit 658b910
Show file tree
Hide file tree
Showing 12 changed files with 344 additions and 288 deletions.
153 changes: 0 additions & 153 deletions lib/Espfc/src/Math/FFTAnalyzer.h

This file was deleted.

79 changes: 0 additions & 79 deletions lib/Espfc/src/Math/FreqAnalyzer.h

This file was deleted.

48 changes: 0 additions & 48 deletions lib/Espfc/src/Math/Sma.h

This file was deleted.

1 change: 0 additions & 1 deletion lib/Espfc/src/ModelState.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "Utils/Timer.h"
#include "Utils/Stats.h"
#include "Device/SerialDevice.h"
#include "Math/FreqAnalyzer.h"
#include "Connect/Msp.h"

namespace Espfc {
Expand Down
4 changes: 4 additions & 0 deletions lib/Espfc/src/Sensor/GyroSensor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

#include "GyroSensor.h"
#include "Utils/FilterHelper.h"
#include "Utils/Sma.ipp"
#ifdef ESPFC_DSP
#include "Utils/FFTAnalyzer.ipp"
#endif

#define ESPFC_FUZZY_ACCEL_ZERO 0.05
#define ESPFC_FUZZY_GYRO_ZERO 0.20
Expand Down
14 changes: 7 additions & 7 deletions lib/Espfc/src/Sensor/GyroSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#include "BaseSensor.h"
#include "Model.h"
#include "Device/GyroDevice.h"
#include "Math/Sma.h"
#include "Utils/Sma.hpp"
#ifdef ESPFC_DSP
#include "Math/FFTAnalyzer.h"
#include "Utils/FFTAnalyzer.hpp"
#else
#include "Math/FreqAnalyzer.h"
#include "Utils/FreqAnalyzer.hpp"
#endif

#define ESPFC_FUZZY_ACCEL_ZERO 0.05
Expand All @@ -32,8 +32,8 @@ class GyroSensor: public BaseSensor
private:
void calibrate();

Math::Sma<VectorFloat, 8> _sma;
Math::Sma<VectorFloat, 8> _dyn_notch_sma;
Utils::Sma<VectorFloat, 8> _sma;
Utils::Sma<VectorFloat, 8> _dyn_notch_sma;
size_t _dyn_notch_denom;
size_t _dyn_notch_count;
bool _dyn_notch_enabled;
Expand All @@ -50,9 +50,9 @@ class GyroSensor: public BaseSensor
Device::GyroDevice * _gyro;

#ifdef ESPFC_DSP
Math::FFTAnalyzer<128> _fft[3];
Utils::FFTAnalyzer<128> _fft[3];
#else
Math::FreqAnalyzer _freqAnalyzer[3];
Utils::FreqAnalyzer _freqAnalyzer[3];
#endif

};
Expand Down
Loading

0 comments on commit 658b910

Please sign in to comment.