{"id":22787652,"url":"https://github.com/tsteven4/ecg-analysis","last_synced_at":"2025-03-30T16:17:30.372Z","repository":{"id":237283378,"uuid":"794201571","full_name":"tsteven4/ecg-analysis","owner":"tsteven4","description":"Analysis of ECG data","archived":false,"fork":false,"pushed_at":"2024-04-30T23:45:26.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T17:45:37.451Z","etag":null,"topics":["ecg","electrocardiogram","heart-rate-variability","hrv","polarh10"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsteven4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-30T16:46:54.000Z","updated_at":"2025-01-23T18:05:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"92f0dc29-57bc-4408-8256-ac4794cfa6cb","html_url":"https://github.com/tsteven4/ecg-analysis","commit_stats":null,"previous_names":["tsteven4/ecg-analysis"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsteven4%2Fecg-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsteven4%2Fecg-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsteven4%2Fecg-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsteven4%2Fecg-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsteven4","download_url":"https://codeload.github.com/tsteven4/ecg-analysis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246342994,"owners_count":20761947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecg","electrocardiogram","heart-rate-variability","hrv","polarh10"],"created_at":"2024-12-12T00:59:46.440Z","updated_at":"2025-03-30T16:17:30.366Z","avatar_url":"https://github.com/tsteven4.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polar ECG Data Analysis\n\nThis program scans ECG and RR files from the [Polar Sensor Logger](https://play.google.com/store/apps/details?id=com.j_ware.polarsensorlogger).  Location data may be optionally included.  The program looks for high variability of successive beat to beat interval differences.\n\n## Description of Operation\n\nThe standard deviation of the difference in successive RR periods, SDΔRR (milliseconds) is calculated.  This is similar to the standard metric RMSSD, however SDΔRR is estimated from a subset of the data to make it robust to outliers.\n\nAn interactive plot is created with three panels.  The top panel shows the RR data versus time.  The middle panel shows the SDΔRR metric versus time.  The bottom panel shows the ECG voltage values versus time.  You may pan and zoom using the plot controls.\n\nIf the value of SDΔRR exceeds the threshold for a sufficient time then the zone is identified as suspicious.  If zone(s) are identified a message \"Suspicious events found in ...\" is printed and both ECG plots and [Poincaré plots](https://en.wikipedia.org/wiki/Poincar%C3%A9_plot) are saved as portable network graphics (.png) files.  If location data is available then a web page showing the track in green with the suspicious zones in red will be created.\n\nThe program may not identify zones where evidence of an arrhythmia exists.  The program may erroneously identify zones where no arrhythmia occurred.  Artifacts in the data may make the program unreliable.  The program is not intended to identify all types of arrhythmia.  Interpretations of the validity and significance of the results is left to the user and their doctor.\n\n```\nusage: analyze_polar [-h] [--location LOCATION] [--axislimit AXISLIMIT] [--threshold THRESHOLD] rrsrc ecgsrc\n\nPolar Sensor Logger RR and ECG analyzer\n\npositional arguments:\n  rrsrc                 Input Polar RR file\n  ecgsrc                Input Polar ECG file\n\noptions:\n  -h, --help            show this help message and exit\n  --location LOCATION, -l LOCATION\n                        Input location file (default: None)\n  --axislimit AXISLIMIT, -a AXISLIMIT\n                        Maximum axis value for Poincaré plots(seconds) (default: 1.0)\n  --threshold THRESHOLD, -t THRESHOLD\n                        SDΔRR warning threshold(msec) (default: 50)\n```\n\n## Data Collection\n\nThe Polar Sensor Logger app may be used to collect ECG data.  If this is enabled it will also log the RR intervals.  The Polar H10 heart rate sensor supports collecting of ECG data.\n\nIt is not necessary to collect HRV data on your Garmin device.  However, it may be useful to extract the position data from a fit file recorded by your device.  A csv file suitable for use by this program can be created from a fit file by using [gpsbabel](https://www.gpsbabel.org).\n\nThe gpsbabel conversion relies on a style file 'fit2csv.style':\n```\nFIELD_DELIMITER         COMMA\nRECORD_DELIMITER        NEWLINE\nBADCHARS                COMMA\nDATATYPE                TRACK\n\nPROLOGUE time,lat,lon\n\nIFIELD LOCAL_TIME,\"\",\"%Y-%m-%dT%H:%M:%S\"\nIFIELD LAT_DECIMAL,\"\",\"%0.6f\"\nIFIELD LON_DECIMAL,\"\",\"%0.6f\"\n```\n\n```\ngpsbael -i garmin_fit -f inputfile.fit -o xcsv,style=fit2csv.style -F locationfile.csv\n```\n\nIf you are using Garmin Connect, instructions for exporting your data can be found [in the Garmin FAQs](https://support.garmin.com/en-US/?faq=W1TvTPW8JZ6LfJSfK512Q8).  Follow the instructions for \"Export Original\" and \"Export a Timed Activity From Garmin Connect\" to download your FIT file.\n\n## Required Tools\n\nA recent version of python 3 is required. \n\nYou can download a python .whl file to install ecg-analysis from [github](https://github.com/tsteven4/ecg-analysis/releases).  Expand \"Assets\" and select the .whl file.  The \"Continuous build\" release on that page is continuously updated as changes are made.  The .whl file from older releases are not archived.  The version number may or may not change when it is updated.\n\nYou can install the .whl file with pip3.  Substitute the actual name of the .whl file you downloaded.  For example, from a command prompt (DOS, powershell, bash, etc.) :\n```\npip3 install --upgrade ecg_analysis-0.0.1-py3-none-any.whl\n```\n\n### Windows\n\nOn windows python 3 can be downloaded from the [Microsoft Store](https://apps.microsoft.com/store/detail/python-310/9PJPW5LDXLZ5).  You may want to heed the message \"WARNING: The script analyze_ecg.exe is installed in ... which is not on PATH.  Consider adding this directory to PATH ...\".  Having the script directory in your path will make it easier analyze fit files from the command line.\n\n### macOS\n\nOn macOS python 3 can be downloaded from [python.org](https://www.python.org/downloads/macos/), or installed with [Homebrew](https://brew.sh/) or [MacPorts](https://ports.macports.org/).\n\n### Linux\n\nOn linux python3 is probably available from your distribution using your standard packaging tools, e.g. apt, dnf, ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsteven4%2Fecg-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsteven4%2Fecg-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsteven4%2Fecg-analysis/lists"}