diff options
author | The King <27705324+jlukanc1@users.noreply.github.com> | 2021-01-24 16:01:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-24 16:01:14 -0500 |
commit | 8c3df5f0211e0cc31de90039a73fe48b9a9aafe0 (patch) | |
tree | 88fc0671a629b27793a418df76f543c7913b644a /src/components/heartrate/Ppg.h | |
parent | 51c8cadcb78bdbe9013f5aace629c96ed3dfd06f (diff) | |
parent | 80838d1e42e83b50188d6237d16c81cfa27781a6 (diff) |
Merge branch 'develop' into upstream-dev
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 |