InfiniTime/src/components/heartrate/Ppg.h

30 lines
472 B
C
Raw Normal View History

#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:
Ppg();
int8_t Preprocess(float spl);
float HeartRate();
void SetOffset(uint16_t i);
void Reset();
2021-04-24 09:00:45 +00:00
private:
std::array<int8_t, 200> data;
size_t dataIndex = 0;
float offset;
Biquad hpf;
Ptagc agc;
Biquad lpf;
float ProcessHeartRate();
};
}
}