Brain-wide properties of slow waves across vigilance states.
One block of code here has a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 1 match
- [1] § Materials and methods › Identification of SWs ↔ iDetectSlowWave.m, lines 4 to 29 · score 0.51 · SW detection, candidate, zero crossings, 0.25 s, waves, 0.5 Hz · block
oscr:b:1W6ZGKV0XG1F5-X· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
MATLAB · 180 lines · 7.8 KB · MIT · 1 match
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Slow wave detector
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Detection of slow waves based on criteria defined in Frauscher et al.
- % (2015) Brain and Riedner et al. (2007) Sleep.
- % If used, thank you for citing:
- % Sheybani et al. (2023) Nat Comm (in revision)
- % Sheybani et al. (2023) Brain Communications
- % Given their substantial theorical inputs, it would be fair to cite
- % Frauscher et al. (2015) Brain and Riedner et al. (2007) Sleep as well
- % The code is shared without any warranty
- % Laurent Sheybani, laboratory of Prof. Matthew C Walker, University
- % College London (UCL), London, UK
- rawdata = ; % lines are electrodes, columns are timeframes
- n = ; % filter order
- sf = ; % sampling frequency
- fc_low = 0.5; % high-pass for SW detection
- fc_high = 4; % low-pass for SW detection
- min_duration_ZeroCrossing_sec = 0.25; % minimal duration of a half-wave, in s
- max_duration_ZeroCrossing_sec = 1; % maximal duration of a half-wave, in s
- keep_above_prctle = []; % threshold above which candidate waves are saved
- % For simplicity, we remove the condition "no_IED_before", and assume that
- % the post-processing pruning controls for that
- %% Filter the data for SW detection
- [b_low a_low] = butter(n, 2*fc_low/sf,'high'); % coefficients of the high pass-filter
- [b_high a_high] = butter(n, 2*fc_high/sf,'low'); % coefficients of the low pass-filter
- min_duration_ZeroCrossing = min_duration_ZeroCrossing_sec * sf;
- max_duration_ZeroCrossing = max_duration_ZeroCrossing_sec * sf;
- thedata = filtfilt(b_low, a_low, rawdata'); % filtering (high-pass)
- thedata = filtfilt(b_high, a_high, thedata)'; % filtering (low-pass)
- %% Look for SW of default polarity
- idx_ZeroCrossing = iFindZeroCrossing(thedata);
- clear PosToNeg_ZeroCrossing
- for k = 1 : length(idx_ZeroCrossing)
- if thedata(k,idx_ZeroCrossing{k}(1) + 1) > thedata(k,idx_ZeroCrossing{k}(1))
- PosToNeg_ZeroCrossing{k} = idx_ZeroCrossing{k}(2 : 2 : end);
- else
- PosToNeg_ZeroCrossing{k} = idx_ZeroCrossing{k}(1 : 2 : end);
- end
- end
- % Initiate variables
- onset_SWA = cell(1,length(PosToNeg_ZeroCrossing));
- offset_SWA = cell(1,length(PosToNeg_ZeroCrossing));
- SWA = cell(1, length(PosToNeg_ZeroCrossing));
- SWA_onset = cell(1, length(PosToNeg_ZeroCrossing));
- SWA_offset = cell(1, length(PosToNeg_ZeroCrossing));
- SWA_middle = cell(1, length(PosToNeg_ZeroCrossing));
- % Across electrodes
- disp('Negative waves...')
- clear diff_ZeroCrossing
- for k = 1 : length(PosToNeg_ZeroCrossing)
- if isempty(PosToNeg_ZeroCrossing{k})
- SWA_onset{k} = [];
- SWA_offset{k} = [];
- SWA_middle{k} = [];
- SWA{k} = [];
- else
- diff_ZeroCrossing = diff(idx_ZeroCrossing{k});
- if thedata(k,idx_ZeroCrossing{k}(1) + 1) > thedata(k,idx_ZeroCrossing{k}(1))
- PosToNeg_diff_ZeroCrossing = diff_ZeroCrossing(2 : 2 : end);
- else
- PosToNeg_diff_ZeroCrossing = diff_ZeroCrossing(1 : 2 : end);
- end
- onset_SWA{k} = PosToNeg_ZeroCrossing{k}(PosToNeg_diff_ZeroCrossing > min_duration_ZeroCrossing...
- & PosToNeg_diff_ZeroCrossing < max_duration_ZeroCrossing);
- for m = 1 : length(onset_SWA{k})
- offset_SWA{k} = [offset_SWA{k} idx_ZeroCrossing{k}(find(onset_SWA{k}(m) == idx_ZeroCrossing{k}) + 1)];
- end
- for m = 1 : length(onset_SWA{k})
- amp_temp(m) = max(abs(thedata(k,onset_SWA{k}(m) : offset_SWA{k}(m))));
- end
- threshold_amp = prctile(amp_temp, keep_above_prctle);
- clear amp_temp
- m_trace = 1;
- for m = 1 : length(onset_SWA{k})
- if max(abs(thedata(k, onset_SWA{k}(m) : offset_SWA{k}(m)))) >= max(abs(threshold_amp))
- [maxi idx] = max(abs(thedata(k, onset_SWA{k}(m) : offset_SWA{k}(m))));
- if onset_SWA{k}(m) + idx - (3*sf) > 0 && onset_SWA{k}(m) + idx + (3*sf) < length(thedata(k,:))
- SWA{k}(m_trace,:) = rawdata(k, onset_SWA{k}(m) + idx + [(-3*sf) : (3*sf)]);
- SWA_onset{k}(m_trace) = onset_SWA{k}(m);
- SWA_offset{k}(m_trace) = offset_SWA{k}(m);
- SWA_middle{k}(m_trace) = onset_SWA{k}(m) + idx;
- m_trace = m_trace + 1;
- end
- end
- end
- clear threshold_amp
- end
- end
- %% Look for SW of opposite polarity
- clear rawdata_inv
- for k = 1 : size(rawdata,1)
- rawdata_inv(k,:) = rawdata(k,:);
- end
- thedata_inv = filtfilt(b_low, a_low, rawdata_inv'); % filtering (high-pass)
- thedata_inv = filtfilt(b_high, a_high, thedata_inv)'; % filtering (low-pass)
- idx_ZeroCrossing_inv = iFindZeroCrossing(thedata_inv);
- clear NegToPos_ZeroCrossing_inv
- for k = 1 : length(idx_ZeroCrossing_inv)
- if thedata_inv(k,idx_ZeroCrossing_inv{k}(1) + 1) < thedata_inv(k,idx_ZeroCrossing_inv{k}(1))
- NegToPos_ZeroCrossing_inv{k} = idx_ZeroCrossing_inv{k}(2 : 2 : end);
- else
- NegToPos_ZeroCrossing_inv{k} = idx_ZeroCrossing_inv{k}(1 : 2 : end);
- end
- end
- % Initiate variables
- onset_SWA_inv = cell(1,length(NegToPos_ZeroCrossing_inv));
- offset_SWA_inv = cell(1,length(NegToPos_ZeroCrossing_inv));
- SWA_inv = cell(1, length(NegToPos_ZeroCrossing_inv));
- SWA_inv_onset = cell(1, length(NegToPos_ZeroCrossing_inv));
- SWA_inv_offset = cell(1, length(NegToPos_ZeroCrossing_inv));
- SWA_inv_middle = cell(1, length(NegToPos_ZeroCrossing_inv));
- % Across electrodes
- disp('Positive waves...')
- clear diff_ZeroCrossing_inv
- for k = 1 : length(NegToPos_ZeroCrossing_inv)
- if isempty(NegToPos_ZeroCrossing_inv{k})
- SWA_inv_onset{k} = [];
- SWA_inv_offset{k} = [];
- SWA_inv_middle{k} = [];
- SWA_inv{k} = [];
- else
- diff_ZeroCrossing_inv = diff(idx_ZeroCrossing_inv{k});
- if thedata_inv(k,idx_ZeroCrossing_inv{k}(1) + 1) < thedata_inv(k,idx_ZeroCrossing_inv{k}(1))
- NegToPos_diff_ZeroCrossing_inv = diff_ZeroCrossing_inv(2 : 2 : end);
- else
- NegToPos_diff_ZeroCrossing_inv = diff_ZeroCrossing_inv(1 : 2 : end);
- end
- onset_SWA_inv{k} = NegToPos_ZeroCrossing_inv{k}(NegToPos_diff_ZeroCrossing_inv > min_duration_ZeroCrossing...
- & NegToPos_diff_ZeroCrossing_inv < max_duration_ZeroCrossing);
- for m = 1 : length(onset_SWA_inv{k})
- offset_SWA_inv{k} = [offset_SWA_inv{k} idx_ZeroCrossing_inv{k}(find(onset_SWA_inv{k}(m) == idx_ZeroCrossing_inv{k}) + 1)];
- end
- for m = 1 : length(onset_SWA_inv{k})
- amp_temp_inv(m) = max(abs(thedata_inv(k,onset_SWA_inv{k}(m) : offset_SWA_inv{k}(m))));
- end
- threshold_amp_inv = prctile(amp_temp_inv, current_threshold);
- clear amp_temp_inv
- m_trace = 1;
- for m = 1 : length(onset_SWA_inv{k})
- if max(abs(thedata_inv(k, onset_SWA_inv{k}(m) : offset_SWA_inv{k}(m)))) >= max(abs(threshold_amp_inv))
- [maxi idx] = max(abs(thedata_inv(k, onset_SWA_inv{k}(m) : offset_SWA_inv{k}(m))));
- if onset_SWA_inv{k}(m) + idx - (3*sf) > 0 && onset_SWA_inv{k}(m) + idx + (3*sf) < length(thedata_inv(k,:))
- SWA_inv{k}(m_trace,:) = rawdata_inv(k, onset_SWA_inv{k}(m) + idx + [(-3*sf) : (3*sf)]);
- SWA_inv_onset{k}(m_trace) = onset_SWA_inv{k}(m);
- SWA_inv_offset{k}(m_trace) = offset_SWA_inv{k}(m);
- SWA_inv_middle{k}(m_trace) = onset_SWA_inv{k}(m) + idx;
- m_trace = m_trace + 1;
- end
- end
- end
- clear threshold_amp_inv
- end
- end
iDetectSlowWave.m at commit dd32d80, under MIT · at the source
Overview
- Research Department of Epilepsy, UCL Queen Square Institute of Neurology, University College London, London, United Kingdom
- Department of Epilepsy, National Hospital for Neurology and Neurosurgery, London, United Kingdom
- National Hospital for Neurology and Neurosurgery, University College London Hospitals NHS Foundation Trust, London, United Kingdom
- NIHR University College London Hospitals Biomedical Research Centre, London, United Kingdom
Abstract
Until recently, slow waves (SWs) were considered to be highly specific, if not exclusive, to sleep and non-rapid eye movement (NREM) sleep in particular. During NREM sleep, they are proposed to track and contribute to normalization of homeostatic sleep pressure. However, recent evidence has identified typical SWs during wakefulness and rapid-eye movement (REM) sleep. SWs during wakefulness have been regarded as intrusions of sleep, supported by the finding of an associated down-state of neural activity. Although this suggests that the underlying neurobiology of SWs might be shared across vigilance states, i.e. the activity of neurons is comparable, it does not address the question as to whether SWs display state-dependent differences that could reflect a homeostatic regulation. To address this question, we utilized an intracranial dataset of 106 adult patients with drug-resistant epilepsy and computed specific features of SWs—their incidence, slope, transition frequency, associated high gamma activity, multipeak morphology and overlap across brain regions. Overall, we found that changes in these features reflect a state-dependent modulation, potentially in line with expected changes in homeostatic pressure. The multipeak morphology displayed the greatest changes across states. SW differences were sufficiently specific to vigilance state that we could successfully classify these states using SW properties. Our work provides further evidence that SWs during wakefulness and REM sleep are consistent with intrusion of NREM-SW and establish normative values for future studies on SWs across vigilance states and brain regions.
Statement of Significance: Using a large dataset of intracranial recordings in 106 patients with drug-resistant epilepsy, we show that key morphological features of SWs change across vigilance states. Furthermore, we were able to successfully classify vigilance states based on these morphological properties, establishing their specificity for wakefulness, non-rapid eye movement (NREM) and rapid eye movement (REM) sleep respectively. Our work contributes to the hypothesis that SWs outsides NREM can be regarded as intrusions of NREM-SW and provides normative scaling laws for future studies on this neurophysiological entity.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
bushlab-ucl/slowWaveDetection
dd32d8034421413342b7b195c6e60880b6270e1b, 30 November 2023Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
5 files
- iDetectSlowWave.m, MATLAB, 180 lines, 1 match
- iFindIED_semiautomatic.m
, MATLAB, 180 lines - iFindZeroCrossing.m, MATLAB, 24 lines
- LICENSE, License, 21 lines
- README.md, Text, 6 lines
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 3 scripts, each with its path and the digest of its content;
- 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability
Data are available on the Loris repository: https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 6 keywords, 1 funder, 40 references.
Cite
This paper
Yang, S., Poole, O., Walker, M. C., & Sheybani, L. (2026). Brain-wide properties of slow waves across vigilance states. Sleep advances : a journal of the Sleep Research Society, 7(3), zpag065. https://
BibTeX
@article{yang2026brain,
author = {Yang, Senyu and Poole, Olivia and Walker, Matthew C and Sheybani, Laurent},
title = {{Brain-wide properties of slow waves across vigilance states}},
journal = {Sleep advances : a journal of the Sleep Research Society},
year = {2026},
month = jun,
volume = {7},
number = {3},
pages = {zpag065},
publisher = {Oxford University Press},
issn = {2632-5012},
doi = {10.1093/
url = {https://
pmid = {42494975},
pmcid = {PMC13395241}
}
RIS
TY - JOUR
AU - Yang, Senyu
AU - Poole, Olivia
AU - Walker, Matthew C
AU - Sheybani, Laurent
TI - Brain-wide properties of slow waves across vigilance states
T2 - Sleep advances : a journal of the Sleep Research Society
J2 - Sleep Adv
PY - 2026
DA - 2026/
VL - 7
IS - 3
SP - zpag065
SN - 2632-5012
PB - Oxford University Press
DO - 10.1093/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1093/
"type": "article-journal",
"title": "Brain-wide properties of slow waves across vigilance states",
"container-title": "Sleep advances : a journal of the Sleep Research Society",
"author": [
{
"family": "Yang",
"given": "Senyu"
},
{
"family": "Poole",
"given": "Olivia"
},
{
"family": "Walker",
"given": "Matthew C"
},
{
"family": "Sheybani",
"given": "Laurent"
}
],
"container-title-short":
"volume": "7",
"issue": "3",
"page": "zpag065",
"DOI": "10.1093/
"PMID": "42494975",
"PMCID": "PMC13395241",
"ISSN": "2632-5012",
"publisher": "Oxford University Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
22
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1212/wnl.0000000000214001
- Dynamic Interplay Between Wake Slow Waves and Epileptiform Discharges in the Epileptogenic Zone.Journal: NeurologyIn common: intracranial EEG (iEEG / ECoG / SEEG), epilepsy, 8 references, 2 authors
- [2] doi:10.1038/s41593-026-02318-9 [code]
- Induction of cortical on/
off periods in awake mice fulfills sleep functions. Journal: Nature neuroscienceIn common: 9 references - [3] doi:10.1073/pnas.2532072123 [code]
- Spatially structured heterogeneity shapes large-scale cortical dynamics in a model of the human cortex.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: 8 references
- [4] doi:10.1093/braincomms/fcae354 [code]
- Non-rapid eye movement sleep slow-wave activity features are associated with amyloid accumulation in older adults with obstructive sleep apnoea.Journal: Brain communicationsIn common: 8 references
- [5] doi:10.1371/journal.pbio.3003060 [code]
- Hemispherotomy leads to persistent sleep-like slow waves in the isolated cortex of awake humans.Journal: PLoS biologyIn common: Signal Processing Toolbox, epilepsy, 6 references
- [6] doi:10.1093/braincomms/fcaf391
- Evoked slow oscillations and dynamic network reorganization after stroke.Journal: Brain communicationsIn common: 7 references
- [7] doi:10.1016/j.isci.2023.107138 [code]
- How and when EEG reflects changes in neuronal connectivity due to time awake.Journal: iScienceIn common: Signal Processing Toolbox, 6 references
- [8] doi:10.1038/s42003-024-06941-9 [code]
- Coordinated NREM sleep oscillations among hippocampal subfields modulate synaptic plasticity in humans.Journal: Communications biologyIn common: epilepsy, 6 references
- [9] doi:10.1016/j.isci.2025.113213
- Global and local nature of cortical slow waves.Journal: iScienceIn common: 6 references
- [10] doi:10.1016/j.cub.2025.06.064 [code]
- Cortical activity upon awakening from sleep reveals consistent spatio-temporal gradients across sleep stages in human EEG.Journal: Current biology : CBIn common: Signal Processing Toolbox, 5 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 3 scripts, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:cf1a0c169b36c71c…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1093/sleepadvances/zpag065)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1093/sleepadvances/zpag065.svg
:target: https://openscicode.org/badge/doi/10.1093/sleepadvances/zpag065
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1093/sleepadvances/zpag065"><img src="https://openscicode.org/badge/doi/10.1093/sleepadvances/zpag065.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
