mirror of
https://github.com/cagnulein/qdomyos-zwift.git
synced 2026-02-17 16:07:43 +01:00
Fix HRV RMSSD calculation window size
Reduced RMSSD calculation window from 120 to 30 samples. The larger window was including heart rate transitions (rest to exercise), causing artificially high RMSSD values during exercise. A 30-sample window (~20-30 seconds) provides more accurate real-time HRV measurements.
This commit is contained in:
@@ -195,9 +195,11 @@ void bluetoothdevice::skinTemperature(double skinTemperature) { SkinTemperature.
|
||||
void bluetoothdevice::heatStrainIndex(double heatStrainIndex) { HeatStrainIndex.setValue(heatStrainIndex); }
|
||||
void bluetoothdevice::rrIntervalReceived(double rrInterval) {
|
||||
// RR-interval is in milliseconds
|
||||
// Add to buffer for RMSSD calculation (keep max 120 samples, approximately 2 minutes of data)
|
||||
// Add to buffer for RMSSD calculation (keep max 30 samples for real-time HRV display)
|
||||
// Using 30 samples (~20-30 seconds of data) gives more responsive and accurate HRV
|
||||
// than using longer windows which can include heart rate transitions
|
||||
rrIntervals.append(rrInterval);
|
||||
while (rrIntervals.size() > 120) {
|
||||
while (rrIntervals.size() > 30) {
|
||||
rrIntervals.removeFirst();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user