Skip to content

Commit ff1d352

Browse files
committed
Reapply "Fix HRV RMSSD calculation window size"
This reverts commit f7951b4.
1 parent f7951b4 commit ff1d352

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/devices/bluetoothdevice.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,11 @@ void bluetoothdevice::skinTemperature(double skinTemperature) { SkinTemperature.
195195
void bluetoothdevice::heatStrainIndex(double heatStrainIndex) { HeatStrainIndex.setValue(heatStrainIndex); }
196196
void bluetoothdevice::rrIntervalReceived(double rrInterval) {
197197
// RR-interval is in milliseconds
198-
// Add to buffer for RMSSD calculation (keep max 120 samples, approximately 2 minutes of data)
198+
// Add to buffer for RMSSD calculation (keep max 30 samples for real-time HRV display)
199+
// Using 30 samples (~20-30 seconds of data) gives more responsive and accurate HRV
200+
// than using longer windows which can include heart rate transitions
199201
rrIntervals.append(rrInterval);
200-
while (rrIntervals.size() > 120) {
202+
while (rrIntervals.size() > 30) {
201203
rrIntervals.removeFirst();
202204
}
203205

0 commit comments

Comments
 (0)