diff options
| author | JF002 <JF002@users.noreply.github.com> | 2021-01-20 20:11:56 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-20 20:11:56 +0000 |
| commit | a0f2fa8469f3a2c0f5f2f914ad174029da321cc0 (patch) | |
| tree | 4ac5f59cd088aea9af51d2d183376de279808e63 /src/components/heartrate/Ppg.h | |
| parent | 35d4f6d4875b68ff8fdecb436e3bc0a6f91099f3 (diff) | |
| parent | 68674cec53e2e2add1c0a0b109e5a0e7d9ed5479 (diff) | |
Merge pull request #169 from JF002/heartRateSensor
Heart rate sensor
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 |
