Skip to content

Commit

Permalink
Add EEG-HRV coupling notebook (#89)
Browse files Browse the repository at this point in the history
* Added EEG-HRV coupling notebook

* Minor updates
  • Loading branch information
raphaelvallat authored Aug 3, 2022
1 parent b3f153f commit 5d1ff92
Show file tree
Hide file tree
Showing 5 changed files with 1,591 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ The notebooks and datasets can be found on `GitHub <https://github.com/raphaelva
* `spectrogram <notebooks/10_spectrogram.ipynb>`_: plot a multi-taper full-night spectrogram on single-channel EEG data with the hypnogram on top.
* `nonlinear_features <notebooks/11_nonlinear_features.ipynb>`_: calculate non-linear EEG features on 30-seconds epochs and perform a naive sleep stage classification.
* `SO-sigma_coupling <notebooks/12_SO-sigma_coupling.ipynb>`_: slow-oscillations/spindles phase-amplitude coupling and data-driven comodulogram.
* `EEG-HRV coupling <notebooks/16_EEG-HRV_coupling.ipynb>`_: overnight coupling between EEG bandpower and heart rate variability.
* `topoplot <notebooks/15_topoplot.ipynb>`_: topoplot.

Gallery
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ v0.6.2.dev
a. Added the :py:func:`yasa.hypno_find_periods` function to find sequences of consecutive values in hypnogram that are longer than a certain duration. This is a flexible function that can be used to detect NREM/REM periods.
b. Added the :py:func:`yasa.hrv_stage` function, which calculates heart rate (HR) and heart rate variability (HRV) by stage and periods.
c. Added a new dataset containing 8 hours of ECG data. The dataset is in compressed NumPy format and can be found in notebooks/data_ECG_8hrs_200Hz.npz. The dataset also includes an upsampled hypnogram.
d. Added a new Jupyter notebook to calculate EEG-HRV overnight coupling based on the :py:func:`yasa.hrv_stage` function. https://github.com/raphaelvallat/yasa/blob/master/notebooks/16_EEG-HRV_coupling.ipynb

**Spindles & slow-waves detection** - `PR 71 <https://github.com/raphaelvallat/yasa/pull/71>`_

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ The notebooks and datasets can be found on `GitHub <https://github.com/raphaelva
* `spectrogram <https://github.com/raphaelvallat/yasa/blob/master/notebooks/10_spectrogram.ipynb>`_: plot a multi-taper full-night spectrogram on single-channel EEG data with the hypnogram on top.
* `nonlinear_features <https://github.com/raphaelvallat/yasa/blob/master/notebooks/11_nonlinear_features.ipynb>`_: calculate non-linear EEG features on 30-seconds epochs and perform a naive sleep stage classification.
* `SO-sigma_coupling <https://github.com/raphaelvallat/yasa/blob/master/notebooks/12_SO-sigma_coupling.ipynb>`_: slow-oscillations/spindles phase-amplitude coupling and data-driven comodulogram.
* `EEG-HRV coupling <https://github.com/raphaelvallat/yasa/blob/master/notebooks/16_EEG-HRV_coupling.ipynb>`_: overnight coupling between EEG bandpower and heart rate variability.
* `topoplot <https://github.com/raphaelvallat/yasa/blob/master/notebooks/15_topoplot.ipynb>`_: topoplot.

**********
Expand Down
1,585 changes: 1,585 additions & 0 deletions notebooks/16_EEG-HRV_coupling.ipynb

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions yasa/heart.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def hrv_stage(
Heartbeat detection is performed with the SleepECG library: https://github.com/cbrnr/sleepecg
For an example of this function, please see the `Jupyter notebook
<https://github.com/raphaelvallat/yasa/blob/master/notebooks/16_EEG-HRV_coupling.ipynb>`_
References
----------
* Shaffer, F., & Ginsberg, J. P. (2017). An overview of heart rate variability metrics and
Expand Down

0 comments on commit 5d1ff92

Please sign in to comment.