File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,17 @@ The `HeartRateMonitor` class is designed to calculate heart rate from the raw se
40
40
41
41
## Example Usage
42
42
43
- python
44
- Copy code
45
- hr_monitor = HeartRateMonitor(sample_rate=100, window_size=150, smoothing_window=10)
43
+ For a complete example, see ` ./main.py ` .
46
44
47
45
``` python
46
+ # Initialize the heart rate monitor
47
+ hr_monitor = HeartRateMonitor(
48
+ # Select a sample rate that matches the sensor's acquisition rate
49
+ sample_rate = actual_acquisition_rate,
50
+ # Select a significant window size to calculate the heart rate (2-5 seconds)
51
+ window_size = int (actual_acquisition_rate * 3 ),
52
+ )
53
+
48
54
# Add samples in a loop (replace the sample polling with actual sensor data retrieval)
49
55
for _ in range (1000 ): # Example loop
50
56
sample = ... # Poll the MAX30102/5 sensor to get a new sample
You can’t perform that action at this time.
0 commit comments