Skip to content

Commit

Permalink
Bug fix, motivated by issue #11
Browse files Browse the repository at this point in the history
Although the n_last_peak_interval variable (the one that determines calculated heart rate) was properly initialized to the INIT_INTERVAL parameter, the first failure of the rf_signal_periodicity() routine was resetting it back to the FS value (a remnant of older code). For this reason, changing TYPICAL_HR to any other value than the 60 bpm default might have not resulted in desired effect.
  • Loading branch information
aromring authored Apr 13, 2020
1 parent ae6f246 commit 72d8988
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion algorithm_by_RF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void rf_heart_rate_and_oxygen_saturation(uint32_t *pun_ir_buffer, int32_t n_ir_b
*pn_heart_rate = (int32_t)(FS60/n_last_peak_interval);
*pch_hr_valid = 1;
} else {
n_last_peak_interval=FS;
n_last_peak_interval=INIT_INTERVAL;
*pn_heart_rate = -999; // unable to calculate because signal looks aperiodic
*pch_hr_valid = 0;
*pn_spo2 = -999 ; // do not use SPO2 from this corrupt signal
Expand Down

0 comments on commit 72d8988

Please sign in to comment.