First implementation of the HR sensor using 100% foss code (ported from waspos)
This commit is contained in:
30
src/components/heartrate/Ppg.h
Normal file
30
src/components/heartrate/Ppg.h
Normal 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();
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user