2021-01-10 16:57:26 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
#include "Biquad.h"
|
|
|
|
#include "Ptagc.h"
|
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
|
|
|
class Ppg {
|
2021-04-24 09:00:45 +00:00
|
|
|
public:
|
2021-01-10 16:57:26 +00:00
|
|
|
explicit Ppg(float spl);
|
|
|
|
|
2021-05-01 10:10:44 +00:00
|
|
|
int8_t Preprocess(float spl);
|
2021-01-10 16:57:26 +00:00
|
|
|
float HeartRate();
|
|
|
|
|
|
|
|
void SetOffset(uint16_t i);
|
2021-01-17 09:39:46 +00:00
|
|
|
void Reset();
|
2021-01-10 16:57:26 +00:00
|
|
|
|
2021-04-24 09:00:45 +00:00
|
|
|
private:
|
2021-05-01 10:10:44 +00:00
|
|
|
std::array<int8_t, 200> data;
|
2021-01-10 16:57:26 +00:00
|
|
|
size_t dataIndex = 0;
|
|
|
|
float offset;
|
|
|
|
Biquad hpf;
|
|
|
|
Ptagc agc;
|
|
|
|
Biquad lpf;
|
|
|
|
|
|
|
|
float ProcessHeartRate();
|
|
|
|
};
|
|
|
|
}
|
2021-05-01 10:10:44 +00:00
|
|
|
}
|