OSCR

Pupil- and gaze dynamics track emotion content in naturalistic speech.

Code ↔ Paper

1 match 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.

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 · it ties a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
  1. [1] § Materials and methods › Pupil data acquisition and preprocessing ↔ pupilTutorial.m, the whole file · a weak match · score 0.62 · FieldTrip, blink interpolation, accuracy, preprocessing, windows, stimulus · block oscr:b:8Y9J9G6EGQ98H-S · 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 · 137 lines · 5 KB · no license · 1 match

  1. %% PUPIL PREPROCESSING
  2. %
  3. % 1. convert edf file to asc
  4. % 2. create a FieldTrip-style data structure
  5. % 3. interpolate Eyelink-defined and additionally detected blinks
  6. % (optional): regress out blink- and saccade-linked pupil response
  7. % 4. epoch using a custom trial-definition function
  8. % 5. plot event-related pupil responses
  9. %
  10. % Anne Urai, 2016
  11. % setup path
  12. clear; clc; close all;
  13. thispath = '~/Dropbox/code/PupilPreprocessing/';
  14. addpath(thispath);
  15. % first, define the asc filename
  16. edfFile = 'EL_P22_s5_b1_2015-06-28_11-14-27.edf';
  17. ascFile = regexprep(edfFile, 'edf', 'asc');
  18. % set path to FieldTrip - get this from http://www.fieldtriptoolbox.org/download
  19. addpath('~/Documents/fieldtrip/');
  20. ft_defaults;
  21. % ============================================== %
  22. % 1. convert edf file to asc
  23. % ============================================== %
  24. if ~exist(ascFile, 'file'),
  25. if ismac,
  26. edf2ascPath = [thispath '/edf2asc-mac'];
  27. elseif isunix,
  28. edf2ascPath = [thispath '/edf2asc-linux'];
  29. else
  30. error('Sorry, I don''t have an edf2asc converter for Windows')
  31. end
  32. % use this converter to create the asc file
  33. % failsafe mode avoids errors when some samples are missing
  34. system(sprintf('%s %s -failsafe -input', edf2ascPath, edfFile));
  35. end
  36. assert(exist(ascFile, 'file') > 1, 'Edf not properly converted');
  37. % ============================================== %
  38. % 2. create a FieldTrip-style data structure
  39. % ============================================== %
  40. % read in the asc EyeLink file
  41. asc = read_eyelink_ascNK_AU(ascFile);
  42. % create events and data structure, parse asc
  43. [data, event, blinksmp, saccsmp] = asc2dat(asc);
  44. % ============================================== %
  45. % 3. interpolate Eyelink-defined and additionally detected blinks
  46. % ============================================== %
  47. plotMe = true;
  48. newpupil = blink_interpolate(data, blinksmp, plotMe);
  49. data.trial{1}(find(strcmp(data.label, 'EyePupil')==1),:) = newpupil;
  50. % ============================================== %
  51. % (optional): regress out blink- and saccade-linked pupil response
  52. % http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0155574
  53. % ============================================== %
  54. pupildata = data.trial{1}(~cellfun(@isempty, strfind(lower(data.label), 'eyepupil')),:);
  55. newpupil = blink_regressout(pupildata, data.fsample, blinksmp, saccsmp, 1, 1);
  56. % put back in fieldtrip format
  57. data.trial{1}(~cellfun(@isempty, strfind(lower(data.label), 'eyepupil')),:) = newpupil;
  58. % zscore since we work with the bandpassed signal
  59. data.trial{1}(find(strcmp(data.label, 'EyePupil')==1),:) = ...
  60. zscore(data.trial{1}(find(strcmp(data.label, 'EyePupil')==1),:));
  61. % ==================================================================
  62. % define trials
  63. % ==================================================================
  64. cfg = [];
  65. cfg.dataset = ascFile;
  66. cfg.event = event;
  67. cfg.trialfun = 'my_trialfun';
  68. cfg.trialdef.pre = 0;
  69. cfg.trialdef.post = 2;
  70. cfg.fsample = asc.fsample;
  71. cfg.sj = 22;
  72. cfg.session = 5;
  73. cfg.block = 1;
  74. cfg = ft_definetrial(cfg);
  75. % epoch
  76. data = ft_redefinetrial(cfg, data);
  77. % note that this trialfun defines four events per trial: two stimuli (that
  78. % have to be compared), a response, and feedback). We have the trial start
  79. % at fixation and save the samples of each of those events (as well as more
  80. % information about stimulus identity, choice and accuracy) in
  81. % data.trialinfo:
  82. % [fixoffset refoffset stimtype stimoffset resptype respcorrect respoffset ...
  83. % feedbacktype feedbackoffset trlcnt blockcnt session]
  84. % ==================================================================
  85. % downsample before saving
  86. % ==================================================================
  87. cfg = [];
  88. cfg.resamplefs = 100;
  89. cfg.fsample = data.fsample;
  90. % see Niels' message on the FT mailing list
  91. samplerows = find(data.trialinfo(1,:)>100); % indices of the rows with sample values (and not event codes)
  92. data.trialinfo(:,samplerows) = round(data.trialinfo(:,samplerows) * (cfg.resamplefs/cfg.fsample));
  93. % use fieldtrip to resample
  94. data = ft_resampledata(cfg, data);
  95. % ==================================================================
  96. % visualize the pupil timecourse
  97. % ==================================================================
  98. cfg = [];
  99. cfg.channel = 'EyePupil';
  100. cfg.trials(1).name = 'correct';
  101. cfg.trials(1).idx = find(data.trialinfo(:, 8) == 1);
  102. cfg.trials(2).name = 'error';
  103. cfg.trials(2).idx = find(data.trialinfo(:, 8) == 0);
  104. clf; subplot(2,2,[1 2]);
  105. plotEventRelated(cfg, data);
  106. title(ascFile, 'interpreter', 'none');
  107. ylabel('Pupil response (z)');
  108. % ==================================================================
  109. % save file
  110. % ==================================================================
  111. filename = regexprep(ascFile, 'asc', 'mat');
  112. save(filename, 'data');

pupilTutorial.m at commit eb91e68, no license · at the source

Overview

Authors: Sümeyye Şen-Alpay1, Christian Keitel1, Rosanne H Timmerman2, Anne Keitel1
  1. Psychology, University of Dundee, Dundee, UK
  2. CNNP Lab, School of Computing, Newcastle University, Newcastle upon Tyne, UK NE45TG
Institutions: University of Dundee (United Kingdom); Newcastle University (United Kingdom)
Journal: Scientific reports, volume 16, issue 1, article 27855
Dates: received 20 February 2026; accepted 5 June 2026; published online 18 June 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41598-026-57256-0 · PMID 42315873 · PMCID PMC13547293 · OpenAlex W7165127149
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: other (modality), human (organism), cognitive (subfield)
Methods: Spectral & time-frequency, Connectivity, Statistics, Machine learning, Preprocessing, Physiology & signal measures
Keywords: Speech perception, Active sensing, Emotion, Naturalistic speech, Pupillometry, Eye movements, Neuroscience, Psychology
MeSH: Emotions*, Eye Movements*, Fixation, Ocular*, Pupil*, Speech*, Speech Perception*, Acoustic Stimulation, Adult, Arousal, Attention, Electrooculography, Female, Humans, Male, Young Adult (* major topic)
Topic: Vestibular and auditory disorders (Neurology, Neuroscience), according to OpenAlex
Funding: Medical Research Council (MR/W02912X/1); Royal Society of Edinburgh (1963); the Republic of Türkiye, Ministry of National Education
Citations: not cited yet (Europe PMC); 128 references in the paper

Abstract

Cortical tracking of speech features is a well-established marker of continuous speech processing, but far less is known about listeners’ ocular responses to speech rhythm. Ocular responses are central to active sensing models in the auditory domain, where motor recruitment guides temporal speech prediction and attention allocation, potentially shaped by non-rhythmic cues, such as emotions. Here, we ask whether listeners’ pupil response and eye movements track the acoustic speech signals and to what extent this tracking is modulated by emotion-related top-down factors, including subjective emotion ratings, mood, and trait empathy. In a validation study (N = 100), participants passively listened to two TED talks and intermittently rated speech segments on valence (negative–positive) and arousal (low–high). This suggested substantial variability in valence and arousal across speech segments in both talks. In the second study (N = 41), participants completed the same task while pupillometry and electrooculography (EOG) were recorded. Mutual information was used to quantify speech tracking in pupil dilation, along with horizontal and vertical eye movements. All ocular signals significantly tracked speech at low frequencies. High-arousal speech was associated with stronger pupil tracking but weaker vertical and horizontal EOG tracking. Negative speech valence was linked to stronger tracking in pupil and vertical eye-movement signals. Interactions between the speech-emotion dimensions, as well as their interactions with listeners’ mood, further shaped these effects, giving rise to distinct patterns across ocular measures. Taken together, our findings provide evidence that ocular activity dynamically aligns to the temporal structure of natural speech and that this tracking is sensitive to both stimulus-driven and listener-dependent emotional factors.

Supplementary Information: The online version contains supplementary material available at https://doi.org/10.1038/s41598-026-57256-0.

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.

anne-urai/pupil_preprocessing_tutorial

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: eb91e689aaa1dcf6176181b3208845b9e1804ad5, 9 November 2018
Languages: MATLAB (3), Jupyter (1)
Size: 8 files, 4 scripts
Software Heritage: archived
Found in: the text, “Pupil data acquisition and preprocessing”
Holds: README, 1 notebook
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
5 files

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;
  • 4 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

Datasets cited

Data availability

Data and stimuli are publicly available on the OSF (https://osf.io/dsvzh/files/osfstorage).

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, 8 keywords, 15 MeSH terms, 3 funders, 124 references.

Cite

This paper

Şen-Alpay, S., Keitel, C., Timmerman, R. H., & Keitel, A. (2026). Pupil- and gaze dynamics track emotion content in naturalistic speech. Scientific reports, 16(1), 27855. https://doi.org/10.1038/s41598-026-57256-0

BibTeX

@article{senalpay2026pupil,
author = {Şen-Alpay, Sümeyye and Keitel, Christian and Timmerman, Rosanne H and Keitel, Anne},
title = {{Pupil- and gaze dynamics track emotion content in naturalistic speech}},
journal = {Scientific reports},
year = {2026},
month = jun,
volume = {16},
number = {1},
pages = {27855},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-57256-0},
url = {https://doi.org/10.1038/s41598-026-57256-0},
pmid = {42315873},
pmcid = {PMC13547293}
}

RIS

TY - JOUR
AU - Şen-Alpay, Sümeyye
AU - Keitel, Christian
AU - Timmerman, Rosanne H
AU - Keitel, Anne
TI - Pupil- and gaze dynamics track emotion content in naturalistic speech
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/06/18
VL - 16
IS - 1
SP - 27855
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-57256-0
UR - https://doi.org/10.1038/s41598-026-57256-0
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-57256-0",
"type": "article-journal",
"title": "Pupil- and gaze dynamics track emotion content in naturalistic speech",
"container-title": "Scientific reports",
"author": [
{
"family": "Şen-Alpay",
"given": "Sümeyye"
},
{
"family": "Keitel",
"given": "Christian"
},
{
"family": "Timmerman",
"given": "Rosanne H"
},
{
"family": "Keitel",
"given": "Anne"
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "27855",
"DOI": "10.1038/s41598-026-57256-0",
"PMID": "42315873",
"PMCID": "PMC13547293",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-57256-0",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
18
]
]
}
}

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.3389/fnhum.2026.1692628 [code]
The effects of vocal emotions and emotional context on the neural tracking of speech envelopes and listeners' vigilance states.
Journal: Frontiers in human neuroscience
In common: cognitive, 17 references
[2] doi:10.1093/cercor/bhac094 [code]
Expectations boost the reconstruction of auditory features from electrophysiological responses to noisy speech.
Journal: Cerebral cortex (New York, N.Y. : 1991)
In common: FieldTrip, Statistics and Machine Learning Toolbox, cognitive, 16 references
[3] doi:10.1111/nyas.15315
Cortical and behavioral tracking of rhythm in music: Effects of pitch predictability, enjoyment, and expertise.
Journal: Annals of the New York Academy of Sciences
In common: cognitive, 15 references
[4] doi:10.1371/journal.pbio.3003924
Endogenous auditory and motor brain rhythms predict individual speech tracking.
Journal: PLoS biology
In common: cognitive, 13 references
[5] doi:10.1523/eneuro.0209-22.2022 [code]
MEG Activity in Visual and Auditory Cortices Represents Acoustic Speech-Related Information during Silent Lip Reading.
Journal: eNeuro
In common: FieldTrip, Statistics and Machine Learning Toolbox, cognitive, 11 references
[6] doi:10.7554/elife.77468 [code]
Neural tracking of phrases in spoken language comprehension is automatic and task-dependent.
Journal: eLife
In common: cognitive, 13 references
[7] doi:10.1162/imag_a_00539 [code]
Are you talking to me? How the choice of speech register impacts listeners' hierarchical encoding of speech.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: FieldTrip, cognitive, 11 references
[8] doi:10.1038/s42003-025-09481-y [code]
Effects of speech periodicity and speech rate on auditory-motor coupling during speech comprehension.
Journal: Communications biology
In common: FieldTrip, Statistics and Machine Learning Toolbox, cognitive, 10 references
[9] doi:10.1371/journal.pone.0313274
Infant low-frequency EEG cortical power, cortical tracking and phase-amplitude coupling predicts language a year later.
Journal: PloS one
In common: 11 references
[10] doi:10.1371/journal.pbio.3001713
Neural dynamics differentially encode phrases and sentences during spoken language comprehension.
Journal: PLoS biology
In common: cognitive, 11 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.

Add the badge to the code's README

OSCR: the badge of this paper

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 -->
[![OSCR](https://openscicode.org/badge/doi/10.1038/s41598-026-57256-0.svg)](https://openscicode.org/badge/doi/10.1038/s41598-026-57256-0)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1038/s41598-026-57256-0.svg
   :target: https://openscicode.org/badge/doi/10.1038/s41598-026-57256-0
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41598-026-57256-0"><img src="https://openscicode.org/badge/doi/10.1038/s41598-026-57256-0.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.