Skip to content

Commit 0b6bfc6

Browse files
V0.7.3
1 parent cfa016e commit 0b6bfc6

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

README.md

-11
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ Please find the documentation on readthedocs:
1111
https://embedded-heart-rate-analysis-toolkit.readthedocs.io/en/latest/
1212

1313

14-
### AVR
15-
- Simple logger
16-
- Simple logger with outlier filtering
17-
- Logger with peak position output
18-
- Raw data logger with full functionality
19-
20-
### ARM
21-
- Simple logger
22-
- Simple logger with outlier filtering
23-
- Logger with peak position output
24-
- Raw data logger with full functionality
2514

2615
## To-do:
2716
- See Changelog

docs/source/implementations.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ The **SD logger** starts as soon as power is applied to it. If no SD card is pre
129129

130130
Time Series Analysis
131131
====================
132-
This implementation is a basic heart rate analysis toolkit for both AVR and ARM chipsets. It functions like the peak detector, but will also output the described under :ref:`timeseries` every beat.
132+
This implementation is a basic heart rate analysis toolkit for both AVR and ARM chipsets. It functions like the peak detector, but will also output the described under :ref:`timeseries` every beat. For now the logger is locked at 100Hz, which makes it a lot less accurate than the ARM full implementation!
133133

134134
By default it will output only RR-interval of the last two peaks, and the absolute position in samples-since-start of the last detected peak.
135135

implementations/AVR/Timeseries_Analysis_AVR_USB/Timeseries_Analysis_AVR_USB.ino

+9-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// -------------------- User Settable Variables --------------------
2929
int8_t hrpin = 0; //Whatever analog pin the sensor is hooked up to
3030
int8_t Verbose = 1; //Whether to report measures + description (1) or just measures (0); See docs.
31-
int8_t report_hr = 1; //if 1, reports raw heart rate and peak threshold data as well, else set to 0 (default 0)
31+
int8_t report_hr = 0; //if 1, reports raw heart rate and peak threshold data as well, else set to 0 (default 0)
3232
int8_t thresholding = 1; //Whether to use thresholding, can cause incorrect rejections in conditions of high variability
3333
float max_bpm = 180; //The max BPM to be expected, used in error detection (default 180)
3434
float min_bpm = 45; //The min BPM to be expected, used in error detection (default 45)
@@ -323,7 +323,7 @@ void validatePeak(struct workingDataContainer &workingData)
323323
{
324324
if(workingData.curRR < workingData.upper_threshold &&
325325
workingData.curRR > workingData.lower_threshold &&
326-
abs(workingData.curRR - workingData.lastRR) < 500)
326+
abs(workingData.curRR - workingData.lastRR) < 600)
327327
{
328328
updatePeak(workingData);
329329
} else {
@@ -368,7 +368,13 @@ void calcRRMeasures(struct workingDataContainer &workingData)
368368
//function to calculate RR differences and squared differences
369369
for(int i = 0; i < 19; i++)
370370
{
371-
rrDiff = abs(workingData.recent_RR[i+1] - workingData.recent_RR[i]);
371+
int8_t pointer = workingData.RR_pos + i;
372+
int8_t pointerNext = workingData.RR_pos + i + 1;
373+
374+
if(pointer >= 20) pointer = pointer - 20;
375+
if(pointerNext >= 20) pointerNext = pointerNext - 20;
376+
377+
rrDiff = abs(workingData.recent_RR[pointerNext] - workingData.recent_RR[pointer]);
372378
workingData.RRDiff[i] = rrDiff;
373379
workingData.RRSqDiff[i] = rrDiff * rrDiff;
374380
}

0 commit comments

Comments
 (0)