OSCR

Visual working memory guides attention rhythmically in humans.

Code ↔ Paper

2 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 2 matches · all tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
  1. [1] § Materials and methods › Data analysis › Behavioral performance analysis ↔ data_code/ep3code_data/wpli/sub_stft.m, the whole file · a weak match · score 0.75 · frequency bins, Fourier transform, fast, vector, intervals, spectrum
  2. [2] § Materials and methods › Data analysis › Time-frequency decomposition ↔ data_code/ep3code_data/wpli/sub_stft.m, the whole file · a weak match · score 0.69 · Hanning window, Fourier transform, square, MATLAB, power, phase

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

MATLAB · 139 lines · 5.8 KB · no license · 2 matches

  1. function [S, P, F, U] = sub_stft(x, xtimes, t, f, Fs, winsize, wintype, detrend_opt, padvalue, algm_opt)
  2. % This sub-function is used to estimate time-varying complex spectrum using
  3. % short-time Fourier transform (STFT)
  4. % Note that it is only used for multi-channel EEG data.
  5. % /Input/
  6. % x: the original data samples (Time Points x Channels)
  7. % xtimes: the time axis of the original data
  8. % t: evaluated time points in STFT
  9. % f: evaluated frequency bins in STFT
  10. % Fs: sampling rate
  11. % winsize: window size (NOTE: the unit is sec)
  12. % wintype: window type (default: hanning window)
  13. % detrend_opt: detrend or not ('1' for detrend is default, '0' for not)
  14. % padvalue: the pad value used for padding data (default: '0'; See matlab function 'padarray')
  15. % algm_opt: choose 'fft' algorithm (normal and default) or 'goertzel' algorithm (fast)
  16. % /Output/
  17. % S: complex time-frequency value
  18. % U: a constant to normalize the power
  19. % P: squared magnitude without phase
  20. % F: phase information
  21. fprintf('\nShort-time Fourier Transform: ')
  22. %% Parameters
  23. if nargin<7; wintype = 'hann'; end; % default window type is 'hann'
  24. if nargin<8; detrend_opt = 1; end % detrend (1, default) the data or not (0)
  25. if nargin<9; padvalue = 0; end; % default padding value is 0
  26. if nargin<10; algm_opt = 'fft'; end; % default option for algorithm is 'fft' (for varying window)
  27. if size(x,1)==1; x = x.'; end; % transpose data if the 1st dimension (time) is 1
  28. N_Trials = size(x,2); % number of trials
  29. N_T = length(t);
  30. N_F = length(f);
  31. fprintf('%d Time Points x %d Frequency Bins x %d Trials\n',N_T,N_F,N_Trials);
  32. S = single(zeros(N_F,N_T,N_Trials));
  33. fprintf('Processing... ')
  34. if length(winsize)==1
  35. L = round(winsize*Fs/2); % half of window size (points)
  36. h = L*2+1; % window size (points)
  37. win = window(wintype,h); % window (one trial)
  38. if ismember(0,win); win = window(wintype,h+2); win = win(find(win~=0)); end % remove zeros points in the window
  39. W = repmat(win,1,N_Trials); % window (all trials)
  40. U = win'*win; % compensates for the power of the window
  41. % index of time points in time-frequency domain
  42. dt = t(2)-t(1); % time interval (uniform step)
  43. [junk,t_idx_min] = min(abs(xtimes-t(1)));
  44. [junk,t_idx_max] = min(abs(xtimes-t(end)));
  45. t_idx = t_idx_min:round(dt*Fs):t_idx_max;
  46. % index of time points in time-frequency domain
  47. df = f(2)-f(1); % frequency step (uniform step)
  48. nfft = round(Fs/df) * max(1,2^(nextpow2(h/round(Fs/df)))); % points of FFT
  49. f_full = Fs/2*linspace(0,1,round(nfft/2)+1);
  50. [junk,f_idx_min] = min(abs(f_full-f(1)));
  51. [junk,f_idx_max] = min(abs(f_full-f(end)));
  52. f_idx = f_idx_min:max(1,2^(nextpow2(h/round(Fs/df)))):f_idx_max;
  53. if numel(f_idx)>numel(f); f_idx = f_idx(1:end-1); end
  54. % Pad x (default mode is "zero")
  55. if detrend_opt; x = detrend(x); end; % Remove linear trends
  56. X = padarray(x, L, padvalue); % padding data
  57. if detrend_opt; X = detrend(X); end; % Remove linear trends
  58. % STFT
  59. for n=1:N_T
  60. fprintf('\b\b\b\b%3.0f%%',n/N_T*100)
  61. X_n = X(t_idx(n)+[0:h-1],:);
  62. if detrend_opt; X_n = detrend(X_n); end; % Remove linear trends
  63. S_n = fft(X_n.*W,nfft,1);
  64. S(:,n,:) = S_n(f_idx,:) / sqrt(U);
  65. end
  66. S2 = S.*conj(S);
  67. P = S2/Fs;
  68. F = S./sqrt(S2);
  69. fprintf(' Done!\n')
  70. %% //////////////////////////////////////////////////// %%
  71. else % winsize is a vector
  72. winsize(find(winsize*Fs<1)) = 10/Fs; % minimum points is 11
  73. winsize(find(winsize<10/Fs)) = 10/Fs; % minimum points is 11
  74. fprintf('\n')
  75. for fi=1:length(f)
  76. fprintf('Frequency Bins (%03g): %04.1f >> ',length(f),f(fi))
  77. L = round(winsize(fi)*Fs/2); % half of window size (points)
  78. h = L*2+1; % window size (points)
  79. win = window(wintype,h); % window (one trial)
  80. if ismember(0,win); win = window(wintype,h+2); win = win(find(win~=0)); end % remove zeros points in the window
  81. W = repmat(win,1,N_Trials); % window (all trials)
  82. U(fi,1) = win'*win; % compensates for the power of the window
  83. % index of time points in time-frequency domain
  84. dt = t(2)-t(1); % time interval (uniform step)
  85. [junk,t_idx_min] = min(abs(xtimes-t(1)));
  86. [junk,t_idx_max] = min(abs(xtimes-t(end)));
  87. t_idx = t_idx_min:round(dt*Fs):t_idx_max;
  88. % index of time points in time-frequency domain
  89. df = f(2)-f(1); % frequency step (uniform step)
  90. nfft = round(Fs/df) * max(1,2^(nextpow2(h/round(Fs/df)))); % points of FFT
  91. f_full = Fs/2*linspace(0,1,round(nfft/2)+1);
  92. [junk,f_idx_min] = min(abs(f_full-f(1)));
  93. [junk,f_idx_max] = min(abs(f_full-f(end)));
  94. f_idx = f_idx_min:max(1,2^(nextpow2(h/round(Fs/df)))):f_idx_max;
  95. if numel(f_idx)>numel(f); f_idx = f_idx(1:end-1); end
  96. % Pad x (default mode is "zero")
  97. if detrend_opt; x = detrend(x); end; % Remove linear trends
  98. X = padarray(x, L, padvalue); % padding data
  99. if detrend_opt; X = detrend(X); end; % Remove linear trends
  100. % STFT
  101. for n=1:N_T
  102. fprintf('\b\b\b\b%3.0f%%',n/N_T*100)
  103. X_n = X(t_idx(n)+[0:h-1],:);
  104. if detrend_opt; X_n = detrend(X_n); end; % Remove linear trends
  105. if strcmp(algm_opt,'fft') % fft
  106. S_n = fft(X_n.*W,nfft,1);
  107. S(fi,n,:) = S_n(f_idx(fi),:) / sqrt(U(fi));
  108. elseif strcmp(algm_opt,'dtft') % DTFT
  109. S(fi,n,:) = sub_dtft(X_n,f(fi),Fs) / sqrt(U(fi));
  110. elseif strcmp(algm_opt,'goertzel') % goertzel
  111. k = round(f(fi)/Fs*h);
  112. S(fi,n,:) = goertzel(X_n,k+1) / sqrt(U(fi));
  113. end
  114. end % n
  115. fprintf('\n')
  116. end % fi
  117. end
  118. S2 = S.*conj(S);
  119. P = S2/Fs;
  120. F = S./sqrt(S2);
  121. fprintf('Done!\n')
  122. end

sub_stft.m, no license · at the source

Overview

Authors: Jiachen Lu1,2,3, Yaochun Cai2,3,4,5, Xilin Zhang2,3,4,5
  1. Department of Psychology and Research Center of Adolescent Psychology and Behavior, School of Education, Guangzhou University, Guangzhou, China, Guangzhou, China
  2. Key Laboratory of Brain, Cognition and Education Sciences, Ministry of Education, South China Normal University, Guangzhou, China
  3. School of Psychology, South China Normal University, Guangzhou, China
  4. Center for Studies of Psychological Application, Guangdong Key Laboratory of Mental Health and Cognitive Science, South China Normal University, Guangzhou, China
  5. Philosophy and Social Science Laboratory of Reading and Development in Children and Adolescents, Ministry of Education, South China Normal University, Guangzhou, China
Journal: eLife, volume 14, article RP108017
Dates: published online 8 July 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.7554/elife.108017 · PMID 42418336 · PMCID PMC13345632 · OpenAlex W4413348373
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: human (organism), cognitive (subfield)
Methods: Spectral & time-frequency, Preprocessing, Connectivity, Statistics, Smoothing, state filtering, decompositions, Machine learning
Keywords: Human
MeSH: Attention*, Memory, Short-Term*, Visual Perception*, Adult, Alpha Rhythm, Female, Humans, Male, Theta Rhythm, Young Adult (* major topic)
Topic: Neural and Behavioral Psychology Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: National Natural Science Foundation of China (32271099); National Outstanding Youth Foundation of China (32022032); Research Center for Brain Cognition and Human Development of Guangdong Province (2024B0303390003)
Citations: cited by 1 paper (Europe PMC); 71 references in the paper

Abstract

How does internal representation held in visual working memory (VWM), known as the attentional template, guide attention in humans? A longstanding debate concerns whether only one (Single-Item-Template theory) or multiple (Multiple-Item-Template theory) items serve as attentional templates simultaneously. Here, we propose a Rhythmic-Item-Template hypothesis, successfully reconciling these seemingly contradictory theories. Using the classical VWM-guided attention task with human participants, we found that two VWM items alternately dominate behavioral guidance in theta-rhythmic (4–8 Hz), with anti-correlated activation states in time, and more importantly, this rhythmic oscillation was not driven by the retro-cue processing. Neural recordings revealed that occipital alpha oscillation (8–14 Hz) governed item-specific prioritization, and its amplitude closely tracked subjects’ behavioral guidance, while frontal theta-oscillations phase-led and coupled with occipital alpha oscillations during the item transition. Our Rhythmic-Item-Template results not only resolve previous Single-Item-Template versus Multiple-Item-Template debate but also advance our understanding of how distributed brain rhythms coordinate flexible resource allocation in multi-item memory systems.

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 2 matches between paragraphs and lines of code.

OSF 34cex

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: MATLAB (14)
Size: 123 files, 14 scripts
Software Heritage: not checked
Found in: “Data availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
14 files
At the source: osf.io/34cex/

The paper's code and data availability statement is in the Data section.

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;
  • 14 scripts, each with its path and the digest of its content;
  • 2 matches 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

The raw and processed behavioral and EEG data, along with all analysis scripts necessary to reproduce the main findings, are publicly available at https://osf.io/34cex/. All analyses were conducted using custom code in MATLAB and the EEGlab toolbox.

The following dataset was generated:

Lu J. 2025. Visual working memory guides attention rhythmically. Open Science Framework. 34cex

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, pages, dates, 3 authors, 1 keyword, 10 MeSH terms, 3 funders, 71 references.

Cite

This paper

Lu, J., Cai, Y., & Zhang, X. (2026). Visual working memory guides attention rhythmically in humans. eLife, 14, RP108017. https://doi.org/10.7554/elife.108017

BibTeX

@article{lu2026visual,
author = {Lu, Jiachen and Cai, Yaochun and Zhang, Xilin},
title = {{Visual working memory guides attention rhythmically in humans}},
journal = {eLife},
year = {2026},
month = jul,
volume = {14},
pages = {RP108017},
publisher = {eLife Sciences Publications, Ltd},
issn = {2050-084X},
doi = {10.7554/elife.108017},
url = {https://doi.org/10.7554/elife.108017},
pmid = {42418336},
pmcid = {PMC13345632}
}

RIS

TY - JOUR
AU - Lu, Jiachen
AU - Cai, Yaochun
AU - Zhang, Xilin
TI - Visual working memory guides attention rhythmically in humans
T2 - eLife
J2 - Elife
PY - 2026
DA - 2026/07/08
VL - 14
SP - RP108017
SN - 2050-084X
PB - eLife Sciences Publications, Ltd
DO - 10.7554/elife.108017
UR - https://doi.org/10.7554/elife.108017
LA - en
ER -

CSL-JSON

{
"id": "10.7554/elife.108017",
"type": "article-journal",
"title": "Visual working memory guides attention rhythmically in humans",
"container-title": "eLife",
"author": [
{
"family": "Lu",
"given": "Jiachen"
},
{
"family": "Cai",
"given": "Yaochun"
},
{
"family": "Zhang",
"given": "Xilin"
}
],
"container-title-short": "Elife",
"volume": "14",
"page": "RP108017",
"DOI": "10.7554/elife.108017",
"PMID": "42418336",
"PMCID": "PMC13345632",
"ISSN": "2050-084X",
"publisher": "eLife Sciences Publications, Ltd",
"URL": "https://doi.org/10.7554/elife.108017",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
8
]
]
}
}

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.1038/s41598-026-50726-5
Rhythmic alternate prioritization in auditory feature-based attention.
Journal: Scientific reports
In common: cognitive, 14 references
[2] doi:10.1162/imag.a.1199 [code]
Sustained alpha oscillations serve attentional prioritization in working memory, not maintenance.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: EEGLAB, Image Processing Toolbox, Statistics and Machine Learning Toolbox, cognitive, 9 references
[3] doi:10.1016/j.isci.2026.116240 [code]
Physical activity enhances theta-periodicity of visual attentional allocation.
Journal: iScience
In common: EEGLAB, Statistics and Machine Learning Toolbox, cognitive, 7 references
[4] doi:10.1186/s12915-026-02630-7 [code]
Phasic modulation of attentional rhythmic sampling according to task demands.
Journal: BMC biology
In common: Statistics and Machine Learning Toolbox, cognitive, 8 references
[5] doi:10.1162/imag.a.1034 [code]
Top-down selection of visual working memory contents is supported by alpha-band phase-synchronized oscillatory networks
Journal: n/a
In common: cognitive, 8 references
[6] doi:10.1038/s42003-026-10071-9 [code]
Alpha phase coding supports feature binding during working memory maintenance.
Journal: Communications biology
In common: cognitive, 7 references
[7] doi:10.1093/brain/awaf431 [code]
Behavioural and clinical biomarkers of the human bed nucleus of stria terminalis from direct neural recordings.
Journal: Brain : a journal of neurology
In common: Psychtoolbox, EEGLAB, Image Processing Toolbox, 1 other tool, 3 references
[8] doi:10.1038/s41467-026-70124-9 [code]
Alpha frequency shapes perceptual sensitivity by modulating optimal phase likelihood.
Journal: Nature communications
In common: EEGLAB, Image Processing Toolbox, Statistics and Machine Learning Toolbox, cognitive, 3 references
[9] doi:10.1111/psyp.70271 [code]
Disentangling Respiratory Phase-Dependent and Phase-Independent Components of Anticipatory Cardiac Deceleration.
Journal: Psychophysiology
In common: Psychtoolbox, EEGLAB, Image Processing Toolbox, 1 other tool, cognitive, 2 references
[10] doi:10.1162/imag.a.1201 [code]
All spectral frequencies of neural activity reveal semantic representation in the human anterior ventral temporal cortex.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: EEGLAB, Image Processing Toolbox, Statistics and Machine Learning Toolbox, 4 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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.