Pupil- and gaze dynamics track emotion content in naturalistic speech.
The 1 match · it ties a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
- [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
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 · 137 lines · 5 KB · no license · 1 match
- %% PUPIL PREPROCESSING
- %
- % 1. convert edf file to asc
- % 2. create a FieldTrip-style data structure
- % 3. interpolate Eyelink-defined and additionally detected blinks
- % (optional): regress out blink- and saccade-linked pupil response
- % 4. epoch using a custom trial-definition function
- % 5. plot event-related pupil responses
- %
- % Anne Urai, 2016
- % setup path
- clear; clc; close all;
- thispath = '~/Dropbox/code/PupilPreprocessing/';
- addpath(thispath);
- % first, define the asc filename
- edfFile = 'EL_P22_s5_b1_2015-06-28_11-14-27.edf';
- ascFile = regexprep(edfFile, 'edf', 'asc');
- % set path to FieldTrip - get this from http://www.fieldtriptoolbox.org/download
- addpath('~/Documents/fieldtrip/');
- ft_defaults;
- % ============================================== %
- % 1. convert edf file to asc
- % ============================================== %
- if ~exist(ascFile, 'file'),
- if ismac,
- edf2ascPath = [thispath '/edf2asc-mac'];
- elseif isunix,
- edf2ascPath = [thispath '/edf2asc-linux'];
- else
- error('Sorry, I don''t have an edf2asc converter for Windows')
- end
- % use this converter to create the asc file
- % failsafe mode avoids errors when some samples are missing
- system(sprintf('%s %s -failsafe -input', edf2ascPath, edfFile));
- end
- assert(exist(ascFile, 'file') > 1, 'Edf not properly converted');
- % ============================================== %
- % 2. create a FieldTrip-style data structure
- % ============================================== %
- % read in the asc EyeLink file
- asc = read_eyelink_ascNK_AU(ascFile);
- % create events and data structure, parse asc
- [data, event, blinksmp, saccsmp] = asc2dat(asc);
- % ============================================== %
- % 3. interpolate Eyelink-defined and additionally detected blinks
- % ============================================== %
- plotMe = true;
- newpupil = blink_interpolate(data, blinksmp, plotMe);
- data.trial{1}(find(strcmp(data.label, 'EyePupil')==1),:) = newpupil;
- % ============================================== %
- % (optional): regress out blink- and saccade-linked pupil response
- % http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0155574
- % ============================================== %
- pupildata = data.trial{1}(~cellfun(@isempty, strfind(lower(data.label), 'eyepupil')),:);
- newpupil = blink_regressout(pupildata, data.fsample, blinksmp, saccsmp, 1, 1);
- % put back in fieldtrip format
- data.trial{1}(~cellfun(@isempty, strfind(lower(data.label), 'eyepupil')),:) = newpupil;
- % zscore since we work with the bandpassed signal
- data.trial{1}(find(strcmp(data.label, 'EyePupil')==1),:) = ...
- zscore(data.trial{1}(find(strcmp(data.label, 'EyePupil')==1),:));
- % ==================================================================
- % define trials
- % ==================================================================
- cfg = [];
- cfg.dataset = ascFile;
- cfg.event = event;
- cfg.trialfun = 'my_trialfun';
- cfg.trialdef.pre = 0;
- cfg.trialdef.post = 2;
- cfg.fsample = asc.fsample;
- cfg.sj = 22;
- cfg.session = 5;
- cfg.block = 1;
- cfg = ft_definetrial(cfg);
- % epoch
- data = ft_redefinetrial(cfg, data);
- % note that this trialfun defines four events per trial: two stimuli (that
- % have to be compared), a response, and feedback). We have the trial start
- % at fixation and save the samples of each of those events (as well as more
- % information about stimulus identity, choice and accuracy) in
- % data.trialinfo:
- % [fixoffset refoffset stimtype stimoffset resptype respcorrect respoffset ...
- % feedbacktype feedbackoffset trlcnt blockcnt session]
- % ==================================================================
- % downsample before saving
- % ==================================================================
- cfg = [];
- cfg.resamplefs = 100;
- cfg.fsample = data.fsample;
- % see Niels' message on the FT mailing list
- samplerows = find(data.trialinfo(1,:)>100); % indices of the rows with sample values (and not event codes)
- data.trialinfo(:,samplerows) = round(data.trialinfo(:,samplerows) * (cfg.resamplefs/cfg.fsample));
- % use fieldtrip to resample
- data = ft_resampledata(cfg, data);
- % ==================================================================
- % visualize the pupil timecourse
- % ==================================================================
- cfg = [];
- cfg.channel = 'EyePupil';
- cfg.trials(1).name = 'correct';
- cfg.trials(1).idx = find(data.trialinfo(:, 8) == 1);
- cfg.trials(2).name = 'error';
- cfg.trials(2).idx = find(data.trialinfo(:, 8) == 0);
- clf; subplot(2,2,[1 2]);
- plotEventRelated(cfg, data);
- title(ascFile, 'interpreter', 'none');
- ylabel('Pupil response (z)');
- % ==================================================================
- % save file
- % ==================================================================
- filename = regexprep(ascFile, 'asc', 'mat');
- save(filename, 'data');
pupilTutorial.m at commit eb91e68, no license · at the source
Overview
- Psychology, University of Dundee, Dundee, UK
- CNNP Lab, School of Computing, Newcastle University, Newcastle upon Tyne, UK NE45TG
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://
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
eb91e689aaa1dcf6176181b3208845b9e1804ad5, 9 November 2018Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
5 files
- my_trialfun.m, MATLAB, 88 lines
- plotEventRelated.m, MATLAB, 124 lines
- pupilTutorial.ipynb, Jupyter, 152 lines
- pupilTutorial.m, MATLAB, 137 lines, 1 match
- README.md, Text, 13 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;
- 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://
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://
BibTeX
@article{senalpay2026pup
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/
url = {https://
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/
VL - 16
IS - 1
SP - 27855
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"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":
"volume": "16",
"issue": "1",
"page": "27855",
"DOI": "10.1038/
"PMID": "42315873",
"PMCID": "PMC13547293",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://
"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 neuroscienceIn common: cognitive, 17 references
- [2] doi:10.1371/journal.pbio.3003924
- Endogenous auditory and motor brain rhythms predict individual speech tracking.Journal: PLoS biologyIn common: cognitive, 13 references
- [3] doi:10.1162/imag.a.1305
- Can you &
lt;i& gt;feel& lt;/ i& gt; what I am saying? Speech-based vibrotactile stimulation enhances the cortical tracking of attended speech in a multi-talker background. Journal: Imaging neuroscience (Cambridge, Mass.)In common: cognitive, 9 references - [4] doi:10.1111/ejn.70598 [code]
- Enhanced Time-Locked Decoding for Spoken Words but Not Environmental Sounds in Natural-Like Auditory Conditions.Journal: The European journal of neuroscienceIn common: cognitive, 8 references
- [5] doi:10.1523/eneuro.0041-26.2026 [code]
- Ocular Speech Tracking Persists in Blindness, but Its Dynamics and Oculo-Cerebral Connectivity Depend on Visual Status.Journal: eNeuroIn common: cognitive, 7 references
- [6] doi:10.1162/nol.a.249 [code]
- How Low-Frequency Neural Activity Structures Language in Time.Journal: Neurobiology of language (Cambridge, Mass.)In common: FieldTrip, cognitive, 6 references
- [7] doi:10.1016/j.isci.2026.116458 [code]
- Neural tracking of prosodic and statistical rhythms jointly supports artificial language learning.Journal: iScienceIn common: FieldTrip, Statistics and Machine Learning Toolbox, cognitive, 5 references
- [8] doi:10.1093/braincomms/fcag261 [code]
- Cortical speech envelope tracking reflects lesion-symptom profiles in post-stroke aphasia.Journal: Brain communicationsIn common: cognitive, 6 references
- [9] doi:10.1371/journal.pone.0346695 [code]
- Age and language experience modulate predictive processing in the visual modality.Journal: PloS oneIn common: cognitive, 6 references
- [10] doi:10.1038/s41467-026-71604-8 [code]
- Respiration as a dynamic modulator of sensory sampling.Journal: Nature communicationsIn common: FieldTrip, Statistics and Machine Learning Toolbox, cognitive, 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.
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, 4 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:b292c84f024c4c7d…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
