diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-03-30 20:50:42 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-03-30 20:50:42 (GMT) |
| commit | 5db030547eeb0aae422447ddb63f0bd2f9d5f384 (patch) | |
| tree | 648bdc9654a3d826eaef1cefaa4b329495016569 /src/components/heartrate/Ppg.h | |
| parent | e1cb4f64097a7d084f178f762546cecb5bd3c6be (diff) | |
Revert "sans heart"ultraredux-heart
This reverts commit 6ef420d2407a4685b56a233f6b0f849e90c6cf49.
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 0000000..7000c87 --- /dev/null +++ b/src/components/heartrate/Ppg.h @@ -0,0 +1,31 @@ +#pragma once + +#include <array> +#include <cstddef> +#include <cstdint> +#include "components/heartrate/Biquad.h" +#include "components/heartrate/Ptagc.h" + +namespace Pinetime { + namespace Controllers { + class Ppg { + public: + Ppg(); + int8_t Preprocess(float spl); + float HeartRate(); + + void SetOffset(uint16_t i); + void Reset(); + + private: + std::array<int8_t, 200> data; + size_t dataIndex = 0; + float offset; + Biquad hpf; + Ptagc agc; + Biquad lpf; + + float ProcessHeartRate(); + }; + } +} |
