Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cbrnr/sleepecg
Sleep stage detection using ECG
https://github.com/cbrnr/sleepecg
ecg heartrate peak-detection python sleep-staging
Last synced: about 8 hours ago
JSON representation
Sleep stage detection using ECG
- Host: GitHub
- URL: https://github.com/cbrnr/sleepecg
- Owner: cbrnr
- License: bsd-3-clause
- Created: 2021-07-20T09:40:32.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-17T10:01:45.000Z (about 2 months ago)
- Last Synced: 2024-09-18T08:37:10.452Z (about 2 months ago)
- Topics: ecg, heartrate, peak-detection, python, sleep-staging
- Language: Python
- Homepage:
- Size: 3.1 MB
- Stars: 90
- Watchers: 4
- Forks: 23
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-hrv - cbrnr/sleepecg
README
![Python](https://img.shields.io/pypi/pyversions/sleepecg.svg?logo=python&logoColor=white)
[![PyPI](https://img.shields.io/pypi/v/sleepecg)](https://pypi.org/project/sleepecg/)
[![Docs](https://readthedocs.org/projects/sleepecg/badge/?version=latest)](https://sleepecg.readthedocs.io/en/stable/index.html)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.05411/status.svg)](https://doi.org/10.21105/joss.05411)
[![License](https://img.shields.io/github/license/cbrnr/sleepecg)](LICENSE)## SleepECG
SleepECG provides tools for sleep stage classification when [EEG](https://en.wikipedia.org/wiki/Electroencephalography) signals are not available. Based only on [ECG](https://en.wikipedia.org/wiki/Electrocardiography), SleepECG provides functions for
- downloading and reading open polysomnography datasets,
- detecting heartbeats from ECG signals, and
- classifying sleep stages (which includes preprocessing, feature extraction, and classification).### Documentation
Documentation for SleepECG is available on [Read the Docs](https://sleepecg.readthedocs.io/en/stable/index.html). Check out the [changelog](https://github.com/cbrnr/sleepecg/blob/main/CHANGELOG.md) to learn what we added, changed, or fixed.
### Installation
SleepECG is available on PyPI and can be installed with [pip](https://pip.pypa.io/en/stable/):
```
pip install sleepecg
```SleepECG with all optional dependencies can be installed with the following command:
```
pip install "sleepecg[full]"
```If you want the latest development version, use the following command:
```
pip install git+https://github.com/cbrnr/sleepecg
```### Example
The following example detects heartbeats in a short ECG (a one-dimensional NumPy array):
```python
import numpy as np
from sleepecg import detect_heartbeats, get_toy_ecgecg, fs = get_toy_ecg() # 5 min of ECG data at 360 Hz
beats = detect_heartbeats(ecg, fs) # indices of detected heartbeats
```### Contributing
The [contributing guide](https://github.com/cbrnr/sleepecg/blob/main/CONTRIBUTING.md) contains detailed instructions on how to contribute to SleepECG.