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-31 00:12:29 (GMT) |
| commit | 12e938959eb1e2146fdec3fee7b9a304aa6889d2 (patch) | |
| tree | f57f54615ad00327e8dc33c958ec67773c49f655 /src/components/heartrate/Ppg.h | |
| parent | ff68f91be9cce2fb27d3b3aea9ab26fa224ea0eb (diff) | |
with heart
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(); + }; + } +} |
