eegToEventSignal

eegToEventSignal(EEG, Fs, stage_val, stage_time)

EEGTOEVENTSIGNAL Preprocess EEG to extract spindle events and slow-oscillation power/phase

Usage:

res_table = eegToEventSignal(EEG, Fs, stage_val, stage_time)

Inputs:

EEG : 1xN double - raw EEG data – required Fs : double - sampling frequency in Hz – required stage_val : 1xS double - stage values (1=N3, 2=N2, 3=N1, 4=REM, 5=Wake) – required stage_time : 1xS double - stage onset times (s) – required

Outputs:
res_tabletable - event info and signals with key columns:

peak_ctimes : detected event central times (s) peak_freqs : detected event frequency (Hz) SOpow : slow oscillation power (normalized) SOphase : slow oscillation phase (rad, unwrapped on input)

Notes

Pipeline: detect_artifacts -> TF_peak_detection -> compute_SOP (p2shift1234 norm) -> SO band-pass filter + Hilbert for phase. Accompanies Chen et al., PNAS 2025.

See also: detect_artifacts, TF_peak_detection, compute_SOP, rawToBinData

∿∿∿ Prerau Laboratory MATLAB Codebase · sleepEEG.org ∿∿∿