From c22e30a4a6ef014c7a5086ad47eaab7740a75ff2 Mon Sep 17 00:00:00 2001 From: Ceimour <113631258+Ceimour@users.noreply.github.com> Date: Sun, 30 Apr 2023 08:50:18 -0500 Subject: 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). --- src/components/heartrate/Biquad.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/components/heartrate/Biquad.cpp (limited to 'src/components/heartrate/Biquad.cpp') 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; -} -- cgit v1.2.3-70-g09d2