This repository contains a Jupyter Notebook for analysing EEG responses to auditory stimuli during N3 sleep using time-frequency power analysis and inter-trial phase consistency (ITPC).
The analysis focuses on neural responses following Targeted Memory Reactivation (TMR) cues during deep sleep.
The notebook computes:
- Event-related potentials (ERP)
- Time-frequency power percentage change from a pre-stimulus baseline
- Inter-trial phase consistency (ITPC)
The analysis uses Python and MNE-Python to perform Complex Morlet Wavelet decomposition.
Main analysis settings:
- Sleep stage: N3
- Frequency range: 5–30 Hz
- Baseline interval: -300 ms to -100 ms
- Channels: Fz, Cz, Pz, and Oz
- Time-frequency method: Complex Morlet wavelets
Subject 8 showed a clear response to the TMR cue during N3 sleep. ERP activity revealed marked post-stimulus slow-wave deflections, with the strongest positive response observed at Cz, Pz, and Oz around 0.6 s. Time-frequency analysis showed a strong increase in sigma-band power around 14–16 Hz between approximately 0.8 and 1.4 s, particularly at Fz, consistent with stimulus-related spindle activity. A strong increase in early theta-band power around 5–8 Hz was also observed between 0.3 and 0.5 s across midline electrodes. ITPC was elevated mainly in the early post-stimulus theta range, suggesting a phase-locked evoked response, whereas the later sigma-band activity appeared more induced than phase-locked. Overall, Subject 8 demonstrated both early evoked theta activity and later induced spindle-like sigma activity following TMR stimulation.
sleep_tfr_itpc_single_subject.ipynb Main analysis notebook
README.md Project description
requirements.txt Required Python packages
.gitignore Files excluded from version control