From 891d50d6481796bb7126d8a31be596d0fab677c0 Mon Sep 17 00:00:00 2001 From: schneider <schneider@blinkenlichts.net> Date: Sun, 26 Apr 2020 01:06:44 +0200 Subject: [PATCH] fix(spo2): Increase minimum peak distance for max 200 bpm --- lib/vendor/Maxim/rd117_mbed/RD117_MBED/algorithm/algorithm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vendor/Maxim/rd117_mbed/RD117_MBED/algorithm/algorithm.c b/lib/vendor/Maxim/rd117_mbed/RD117_MBED/algorithm/algorithm.c index b42b941a2..52764522c 100644 --- a/lib/vendor/Maxim/rd117_mbed/RD117_MBED/algorithm/algorithm.c +++ b/lib/vendor/Maxim/rd117_mbed/RD117_MBED/algorithm/algorithm.c @@ -168,7 +168,9 @@ void maxim_heart_rate_and_oxygen_saturation(uint32_t *pun_ir_buffer, int32_t n_ } n_th1= n_th1/ ( BUFFER_SIZE-HAMMING_SIZE); // peak location is acutally index for sharpest location of raw signal since we flipped the signal - maxim_find_peaks( an_dx_peak_locs, &n_npks, an_dx, BUFFER_SIZE-HAMMING_SIZE, n_th1, 8, 5 );//peak_height, peak_distance, max_num_peaks + // 100 sps / (200 bpm / 60 spm) + int n_min_distance = 100. / (200. / 60.); + maxim_find_peaks( an_dx_peak_locs, &n_npks, an_dx, BUFFER_SIZE-HAMMING_SIZE, n_th1, n_min_distance, 5 );//peak_height, peak_distance, max_num_peaks n_peak_interval_sum =0; if (n_npks>=2){ -- GitLab