This is my repo for the Heart Rate Monitor project
Author: Howard Li: https://github.com/HL232/bme590hrm
Version: 1.0
License: GNU General Public License v3.0
test_data
folder with the ECG data CSV files.gitignore
file for what to ignore when working with Git.travis.yml
file for setting up Travis CIFunctional Block Diagram.dox
a functional block diagram (that's really just a list) that I used for this projectHeartRateMonitor.py
This is the main python code. Simply run this file to run my project. This file includes all the functions and the logic for reading the ECG data sets. More on how it works laterREADME.md
This documentdetect_peaks.py
This is the peak detection algorithm I used for this project. Original author: Marcos Duarte. Source code can be found here: http://nbviewer.jupyter.org/github/demotu/BMC/blob/master/notebooks/DetectPeaks.ipynb. Usage under MIT license. requirements.txt
This is the requirements for setting up a virtual environmenttest_HeartRateMonitor.py
This includes all my unit tests. test_data1.csv, unit_int_test_data1.csv, unit_int_test_data2.csv
Are basic CSV files I use in the unit tests. Should be downloaded into the same local folder as the unit test code when pulling the repo_build, docs, make.bat, index.rst, conf.py, and Makefile
were all added after Sphinx Quickstart tool on Pycharm. The documentation for this project can be found in the _build -> html -> index.html
file path. WARNING: This program only works well for "nice" ECG datasets.
If you look at the if __name__ == "__main__":
function, this is basically what is happening:
detect_peaks
algorithm. The index locations of the peaks are saved.test_data1
- Works finetest_data2
- Works finetest_data3
- Detects too many heartbeat peakstest_data4
- Works finetest_data5
- Detects too many peakstest_data6
- Works finetest_data7
- Detects too many peakstest_data8
- Works finetest_data9
- Does not detect enough peakstest_data10
- Detects most peaks (still missing ~15% of heart beats)test_data11
- Too many peakstest_data12
- 0 heart beats detected (throws an Error because of this. No JSON file produced)test_data13
- 0 heart beats detected (throws an Error because of this. No JSON file produced)test_data14
- 0 heart beats detected (throws an Error because of this. No JSON file produced)test_data15
- 0 heart beats detected (throws an Error because of this. No JSON file produced)test_data16
- Works finetest_data17
- Works finetest_data18
- Works finetest_data19
- Works finetest_data20
- Works finetest_data21
- Works finetest_data22
- Works finetest_data23
- 0 heart beats detected (throws an Error because of this. No JSON file produced)test_data24
- Code recognizes that this is probably not a good ECG dataset because it has a voltage over 5V. User can stoptest_data25
- Only 1 heartbeat detectedtest_data26
- 0 heart beats detected (throws an Error because of this. No JSON file produced)test_data27
- 0 heart beats detected (throws an Error because of this. No JSON file produced)test_data28
- throws an error, the time data is not all numeric. Maybe missing data or contains non-numberstest_data29
- throws an error, the time data is not all numeric. Maybe missing data or contains non-numberstest_data30
- throws an error, the time data is not all numeric. Maybe missing data or contains non-numberstest_data31
- throws an error, the time data is not all numeric. Maybe missing data or contains non-numberstest_data32
- Code works, but Code recognizes that this is probably not a good ECG dataset because it has a voltage over 5V. User can stopGet the heart rate monitor to work for all the test data sets
The original assignment is copied below:
Create a new repository--bme590hrm
--in your individual space on GitHub, and make sure to add all instructors and teaching assistants as CODEOWNERS.
time, voltage
. Example data can be found in the test_data/
directory in this assignment directory. metrics
:
mean_hr_bpm
: estimated average heart rate over a user-specified number
of minutes (can choose a default interval)voltage_extremes
: tuple containing minimum and maximum lead voltagesduration
: time duration of the ECG stripnum_beats
: number of detected beats in the stripbeats
: numpy array of times when a beat occurredmetrics
dictionary should be output as a JSON file should be saved with the same name as the input CSV file that contains the values of all of your object attributes. Note that there is a json module that will make your life easier.-no-ff
option so that we can audit your commit logs to see the merge operations. (This will lead to a "messy" commit history, but something that we want to see for grading purposes.)README.md
file that describes how to run it, and also make sure that you associate a software license with your project (http://choosealicense.com/). v1.0.0
when your assignment is completed and ready to be graded. Check out details on semantic versioning here: http://semver.orgINFO
for assigning values to attributes, WARNING
or ERROR
for exceptions)