rawToBinData

rawToBinData(res_table, Fs, binsize, hard_cutoffs, hist_choice)

RAWTOBINDATA Convert extracted event/signal data into a binned struct ready for GLM fitting

Usage:

BinData = rawToBinData(res_table, Fs, binsize, hard_cutoffs, hist_choice)

Inputs:

res_table : table - extracted spindle event info and SO signals – required Fs : double - sampling frequency in Hz – required binsize : double - point-process bin size in seconds – required hard_cutoffs : 1x2 double - frequency range (Hz) for fast spindle selection – required hist_choice : char - ‘short’ (15 s) or ‘long’ (90 s, infraslow) history window – required

Outputs:
BinDatastruct - binned model inputs (y, sta, sop, phase, sp_hist, sp, RW,

real_time, spindletime_raw, isis, N2_rate, N3_rate, Fs)

Notes

The recording is trimmed to a 5-minute (300 s) buffer around the first and last NonWake epoch. History uses cardinal spline control points [0:15:90 120 hist_ord] (short) or [0:15:90 120 150:100:750 hist_ord] (long). Accompanies Chen et al., PNAS 2025.

See also: preprocessToDesignMatrix, ModifiedCardinalSpline, Hist, RawPhase2BinPhase, stageraw2bin

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