First implementation of the HR sensor using 100% foss code (ported from waspos)

This commit is contained in:
Jean-François Milants
2021-01-10 17:57:26 +01:00
parent 50ae0ae5e0
commit 1a582815ba
23 changed files with 714 additions and 12 deletions

View File

@@ -0,0 +1,30 @@
#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);
private:
std::array<int, 200> data;
size_t dataIndex = 0;
float offset;
Biquad hpf;
Ptagc agc;
Biquad lpf;
float ProcessHeartRate();
};
}
}