diff options
| author | Ceimour <113631258+Ceimour@users.noreply.github.com> | 2023-04-30 08:50:18 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-30 15:50:18 +0200 |
| commit | c22e30a4a6ef014c7a5086ad47eaab7740a75ff2 (patch) | |
| tree | 5afdf4ed624a8b41dc4aea723a8c8f38d726545a /src/components/heartrate/Biquad.cpp | |
| parent | 40f7e1c7be6882e01058b5ccf64d5005c6105346 (diff) | |
Refactored Ppg for frequency based algorithm. (#1486)
New implementation of the heart rate sensor data processing using a frequency based PPG algorithm.
The HRS3300 settings are fine-tuned for better signal to noise at 10Hz.
The measurement delay is now set to 100ms.
Enable and use the ambient light sensor.
FFT implementation based on ArduinoFFT (https://github.com/kosme/arduinoFFT, GPLv3.0).
Diffstat (limited to 'src/components/heartrate/Biquad.cpp')
| -rw-r--r-- | src/components/heartrate/Biquad.cpp | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/components/heartrate/Biquad.cpp b/src/components/heartrate/Biquad.cpp deleted file mode 100644 index b7edd403..00000000 --- a/src/components/heartrate/Biquad.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - SPDX-License-Identifier: LGPL-3.0-or-later - Original work Copyright (C) 2020 Daniel Thompson - C++ port Copyright (C) 2021 Jean-François Milants -*/ - -#include "components/heartrate/Biquad.h" - -using namespace Pinetime::Controllers; - -/** Original implementation from wasp-os : https://github.com/daniel-thompson/wasp-os/blob/master/wasp/ppg.py */ -Biquad::Biquad(float b0, float b1, float b2, float a1, float a2) : b0 {b0}, b1 {b1}, b2 {b2}, a1 {a1}, a2 {a2} { -} - -float Biquad::Step(float x) { - auto v1 = this->v1; - auto v2 = this->v2; - - auto v = x - (a1 * v1) - (a2 * v2); - auto y = (b0 * v) + (b1 * v1) + (b2 * v2); - - this->v2 = v1; - this->v1 = v; - - return y; -} |
