diff options
Diffstat (limited to 'src/components/heartrate/Ppg.h')
-rw-r--r-- | src/components/heartrate/Ppg.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/components/heartrate/Ppg.h b/src/components/heartrate/Ppg.h new file mode 100644 index 00000000..747ae019 --- /dev/null +++ b/src/components/heartrate/Ppg.h @@ -0,0 +1,31 @@ +#pragma once + +#include <array> +#include "Biquad.h" +#include "Ptagc.h" + +namespace Pinetime { + namespace Controllers { + class Ppg { + public: + explicit Ppg(float spl); + + int Preprocess(float spl); + float HeartRate(); + + void SetOffset(uint16_t i); + void Reset(); + + private: + std::array<int, 200> data; + size_t dataIndex = 0; + float offset; + Biquad hpf; + Ptagc agc; + Biquad lpf; + + + float ProcessHeartRate(); + }; + } +}
\ No newline at end of file |