- The cluster route's 2 s window table (ventanas.cortar + estado_director
exclusions and labels) rebuilt from the contract, one private copy per
module.
- legacy: biomarcadores espectro.py, aperiodico.py (FOOOF with Wilkinson's
modifications) and complejidad.py copied unchanged; exponent per region
and state (NaN under 20 windows or R2 < 0.9); MSE fine / coarse / total.
- modern: MNE multitaper + fooof with the same two Wilkinson modifications;
antropy sample entropy with Costa's fixed tolerance.
Copies byte-identical to the submodule; modern within 2% (exponent) and 1%
(MSE) of legacy on the synthetic study; contract suites pass.
- legacy: ondas_lentas.detectar on F3 F4 Fz over the whole recording,
union_intervalos + estadificar for the 'sueno' windows (the cluster
route's fases_sueno), ondas_lentas.resumen for the features; vendored
unchanged.
- modern: the same zero-crossing detector on an MNE band-pass, the same 20%
of 30 s N3 rule, the same summary definitions.
Legacy waves equal the submodule's exactly; modern equals legacy on the
synthetic study; contract suites pass.
- legacy: medidas_director.gradiente on gradiente.analizar (vendored), in
the 'sueno' and 'somnolencia' windows as analizar_director does.
- modern: Hann periodograms per window (MNE), median band power, Theil-Sen
slope (scipy.stats.theilslopes) on the director's front-back coordinates.
- 8 features gradient_<band>_<state>, one baseline each.
Legacy equals the submodule's cluster route exactly; modern within 0.01 of
legacy on the synthetic study.
- 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.
- 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.