You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SleepECG provides tools for sleep stage classification when EEG signals are not available. Based only on ECG, 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. Check out the changelog to learn what we added, changed, or fixed.
Installation
SleepECG is available on PyPI and can be installed with pip:
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):
importnumpyasnpfromsleepecgimportdetect_heartbeats, get_toy_ecgecg, fs=get_toy_ecg() # 5 min of ECG data at 360 Hzbeats=detect_heartbeats(ecg, fs) # indices of detected heartbeats
Contributing
The contributing guide contains detailed instructions on how to contribute to SleepECG.