- Notifications
You must be signed in to change notification settings - Fork27
Sleep stage detection using ECG
License
NotificationsYou must be signed in to change notification settings
cbrnr/sleepecg
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
SleepECG provides tools for sleep stage classification whenEEG signals are not available. Based only onECG, 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 for SleepECG is available onRead the Docs. Check out thechangelog to learn what we added, changed, or fixed.
SleepECG is available on PyPI and can be installed withpip:
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
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
Thecontributing guide contains detailed instructions on how to contribute to SleepECG.
About
Sleep stage detection using ECG