Commit Graph

2 Commits

Author SHA1 Message Date
AlbertoPMDM f870ee9f14 spindle_detection and spindles, legacy and modern
- legacy: husos.detectar / husos.resumen vendored unchanged, run on the
  'sueno' windows as medidas_director does; the wake rhythm that sets the
  'rhythm near sigma' flag is computed inside the process (no biomarker
  dependency).
- modern: the same detector on MNE (sigma band-pass) and SciPy (Hilbert,
  Welch narrowness, phase stability); summary with the director's
  definitions; one baseline per feature.
- privacy.group_size understands per-feature baseline dicts.

Legacy equals the submodule's cluster route exactly (spindle count and the
six summary measures); modern equals legacy on the synthetic study.
2026-11-18 20:57:24 -06:00
AlbertoPMDM 1f8793aacb modern annotation_mask, sleep_state and posterior_rhythm
- processes.annotation_mask: the director's state words and interval rules
  on the EDF+ annotations (MNE), window dominant state and 'mixta'.
- processes.sleep_state: vigilancia's features from batched Hann
  periodograms (mne psd_array_welch), depth index, HK1K cut-offs or cohort
  reference + KMeans (scikit-learn) after train().
- biomarkers.posterior_rhythm: Welch of the wake windows (MNE), 1/f-fitted
  dominant peak, median of O1 O2 P3 P4; private copy of the baselines.
- Registered as the modern modules; Pipeline.default("modern") now runs
  the full slice.

On a synthetic study: annotation states and sleep-state labels identical to
legacy, rhythm equal (6.5 Hz); contract suites and cohort cut-offs tested.
2026-11-18 20:53:52 -06:00