OSCR

Non-linear relationships between auditory mismatch responses and the inharmonicity of complex sounds.

Code ↔ Paper

3 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 3 matches
  1. [1] § Methods › Data processing and statistical analysis ↔ scripts/utility_funs.py, lines 92–144 · score 0.77 · 150–350 ms, 70–250 ms, negative peak, 150 ms, 70 ms, window
  2. [2] § Methods › Procedure ↔ paradigms/eeg/eeg_paradigm.py, lines 42–62 · score 0.71 · inter onset interval, EEG paradigm, IOI, block, 200 Hz, sounds
  3. [3] § Methods › Data processing and statistical analysis ↔ scripts/utility_funs.py, lines 35–68 · score 0.66 · notch filter, decimated, baseline, EOG, epochs, 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

Python · 175 lines · 5 KB · no license · 2 matches

  1. import numpy as np
  2. import mne
  3. from scipy.signal import find_peaks
  4. front_channel_picks = ["Fz", "F1", "F2", "AF3", "AF4", "AFz", "F3", "F4", "FC1", "FC2", "FCz"]
  5. def participant_fname(pid):
  6. """Return a filename for given participant id."""
  7. # return participants[pid]
  8. return f'hm_{pid}'
  9. def recode_events(ev):
  10. # get triggers from events array
  11. trigs = ev[:, 2]
  12. # iterate over trigs
  13. for i, t in enumerate(trigs):
  14. # always ignore first 10 sounds in the block
  15. if t > 200 and t < 300:
  16. trigs[i:i+10] = 0
  17. # if deviant, set new trigger encoding
  18. elif t > 100 and t < 200:
  19. trigs[i] += 1000
  20. trigs[i+1] += 1200
  21. trigs[i+2] += 1300
  22. # put everything back
  23. ev[:, 2] = trigs
  24. return ev
  25. def read_and_epoch(fname, ch_eog, ch_exclude=None, inspect=False, bandpass_low=.2, bandpass_high=30, notch=50):
  26. raw = mne.io.read_raw(fname,
  27. eog=ch_eog,
  28. # misc=ch_ecg,
  29. exclude=ch_exclude,
  30. stim_channel='Status',
  31. preload=True)
  32. raw.set_montage('biosemi64')
  33. # filter
  34. raw.notch_filter(notch)
  35. raw.filter(bandpass_low, bandpass_high)
  36. # visual inspection
  37. if inspect:
  38. raw.plot()
  39. # epoch the data
  40. events_raw = mne.find_events(raw, stim_channel='Status')
  41. events = recode_events(events_raw)
  42. event_ids = {f'j{i}/std': i+1 for i in range(8)}
  43. event_ids.update({f'j{i}/dev_1': i+1101 for i in range(8)})
  44. event_ids.update({f'j{i}/dev_2': i+1201 for i in range(8)})
  45. event_ids.update({f'j{i}/dev_3': i+1301 for i in range(8)})
  46. epochs = mne.Epochs(raw,
  47. events,
  48. event_ids,
  49. tmin=-.1, tmax=.5,
  50. baseline=None,
  51. decim=2 # decimate so new sr is 1024
  52. )
  53. return raw, epochs
  54. def read_preprocessed_epochs(pid, epochs_path):
  55. epochs = mne.read_epochs(f'{epochs_path}/{pid}-epo.fif')
  56. return epochs
  57. def make_evokeds(epochs):
  58. jitters = [f'j{i}' for i in range(8)]
  59. evokeds = {}
  60. for jitter in jitters:
  61. evokeds[jitter] = {
  62. 'std': epochs[f'{jitter}/std'].average(),
  63. 'dev': epochs[f'{jitter}/dev'].average(),
  64. }
  65. evokeds[jitter]['mmn'] = mne.combine_evoked([evokeds[jitter]['dev'], evokeds[jitter]['std']], weights=[1, -1])
  66. return evokeds
  67. def participant_peaks(evoked, mean_window=(-0.025, 0.025)):
  68. e = evoked.copy().pick(front_channel_picks)
  69. p3_window = (.15, .35)
  70. mmn_window = (.07, .25)
  71. try:
  72. # numpy array of mmn window data
  73. mmn_epoch = e.copy().crop(*mmn_window)
  74. e_times = mmn_epoch.times
  75. np_epoch = np.mean(mmn_epoch.get_data(), axis=0)
  76. # find negative peaks (cause it's mmn)
  77. peak_indices, _ = find_peaks(-np_epoch)
  78. peak_index = np.argmin(np_epoch[peak_indices])
  79. mmn_lat = e_times[peak_indices[peak_index]]
  80. # calculate MMN mean amplitude
  81. e_mean_crop = e.copy().crop(
  82. tmin=mmn_lat + mean_window[0], tmax=mmn_lat + mean_window[1]
  83. )
  84. mmn_amp = e_mean_crop.data.mean() * 1e6
  85. except ValueError:
  86. mmn_lat, mmn_amp = np.nan, np.nan
  87. try:
  88. # numpy array of mmn window data
  89. p3_epoch = e.copy().crop(*p3_window)
  90. e_times = p3_epoch.times
  91. np_epoch = np.mean(p3_epoch.get_data(), axis=0)
  92. # find negative peaks (cause it's mmn)
  93. peak_indices, _ = find_peaks(np_epoch)
  94. peak_index = np.argmax(np_epoch[peak_indices])
  95. p3_lat = e_times[peak_indices[peak_index]]
  96. # calculate P3 mean amplitude
  97. e_mean_crop = e.copy().crop(
  98. tmin=p3_lat + mean_window[0], tmax=p3_lat + mean_window[1]
  99. )
  100. p3_amp = e_mean_crop.data.mean() * 1e6
  101. except ValueError:
  102. p3_lat, p3_amp = np.nan, np.nan
  103. ret = {
  104. "mmn_lat": mmn_lat,
  105. "mmn_amp": mmn_amp,
  106. "p3_lat": p3_lat,
  107. "p3_amp": p3_amp,
  108. }
  109. return ret
  110. def orn_peaks(evoked, mean_window=(-0.025, 0.025)):
  111. e = evoked.copy().pick(front_channel_picks)
  112. try:
  113. orn_ch, orn_lat, orn_amp = e.get_peak(
  114. tmin=0.1, tmax=0.3, mode="neg", return_amplitude=True
  115. )
  116. # calculate ORN mean amplitude
  117. e_mean_crop = e.copy().crop(
  118. tmin=orn_lat + mean_window[0], tmax=orn_lat + mean_window[1]
  119. )
  120. orn_mean_amp = e_mean_crop.data.mean() * 1e6
  121. except ValueError:
  122. orn_ch, orn_lat, orn_amp, orn_mean_amp = np.nan, np.nan, np.nan, np.nan
  123. ret = {
  124. "orn_peak_ch": orn_ch,
  125. "orn_peak_lat": orn_lat,
  126. "orn_peak_amp": orn_amp * 1e6,
  127. "orn_mean_amp": orn_mean_amp,
  128. }
  129. return ret
  130. def p2_peaks(evoked, peak_time, mean_window=(-0.025, 0.025)):
  131. e = evoked.copy().pick(front_channel_picks)
  132. tmin, tmax = peak_time + mean_window[0], peak_time + mean_window[1]
  133. p2_amp = e.copy().crop(tmin, tmax).data.mean() * 1e6
  134. return p2_amp

utility_funs.py at commit b033cca, no license · at the source

Overview

Authors: Aniela Brzezińska1, Bartosz Witkowski1, Małgorzata Basińska2, Tomasz Domżalski1, Krzysztof Basiński1
  1. Auditory Neuroscience Laboratory, Department of Psychology, Medical University of Gdańsk, Gdańsk, Poland
  2. Division of Quality of Life Research, Department of Psychology, Medical University of Gdańsk, Gdańsk, Poland
Institutions: Gdańsk Medical University (Poland)
Journal: Scientific reports, volume 16, issue 1, article 11836
Dates: received 15 October 2025; accepted 18 February 2026; published online 3 March 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41598-026-41129-7 · PMID 41775782 · PMCID PMC13066439 · OpenAlex W7133314128
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: EEG (modality), human (organism), cognitive (subfield)
Methods: Spectral & time-frequency, Preprocessing, Statistics, Smoothing, state filtering, decompositions, Evoked potentials
Keywords: Predictive processing, Inharmonicity, Mismatch negativity, P3a, Pitch perception, Auditory mismatch, Neuroscience, Psychology
MeSH: Auditory Perception*, Evoked Potentials, Auditory*, Pitch Perception*, Acoustic Stimulation, Adult, Electroencephalography, Female, Humans, Male, Pitch Discrimination, Sound, Young Adult (* major topic)
Topic: Neuroscience and Music Perception (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Narodowe Centrum Nauki (2022/47/D/HS6/03323)
Citations: not cited yet (Europe PMC); 56 references in the paper

Abstract

Harmonicity is a feature of sound that is important for many aspects of auditory perception and previous research has shown that harmonicity modulates the brain’s mismatch responses to oddball sounds. Predictive processing accounts of perception suggest that the brain generates predictions about the incoming stimuli. Since inharmonic sound spectra contain more information, inharmonicity has been suggested to be involved in precision weighting, an important component of predictive processing theories. In this study we explored this issue by parametrically modulating the level of inharmonicity applied to synthetic sounds and recording mismatch responses (MMN and P3a) from healthy volunteers (N = 37) using electroencephalography. Our results show that a sigmoid function models the relationship between inharmonicity and MMN amplitude better than any linear or polynomial function. Furthermore, P3a amplitude has an inverted-U relationship with inharmonicity and peaks at inharmonicity levels just below the threshold for pitch discrimination. These results are consistent with the hypothesis that inharmonicity impairs F0 extraction above a certain threshold.

Supplementary Information: The online version contains supplementary material available at 10.1038/s41598-026-41129-7.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.

Zenodo 17357764

License: CC-BY-4.0
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (15 files), pandas (13 files), Matplotlib (11 files), MNE-Python (7 files), seaborn (7 files), nlme (5 files), autoreject (3 files), lme4 (3 files), lmerTest (3 files), PsychoPy (3 files), SciPy (3 files), emmeans (2 files), tidyverse (2 files), broom (1 file), SymPy (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)
31 files
At the source:

k-basinski/inharmonicity_modulation

License: none: the authors keep all their rights
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: b033cca2f744363dcbfc94507ebcf73ff751b09c, 24 December 2025
Languages: Python (17), R (10), Jupyter (2)
Size: 596 files, 29 scripts
Software Heritage: not archived
Found in: the Zenodo archive record
Holds: README, 8 notebooks
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (15 files), pandas (12 files), Matplotlib (11 files), MNE-Python (7 files), seaborn (6 files), nlme (5 files), autoreject (3 files), lme4 (3 files), lmerTest (3 files), PsychoPy (3 files), SciPy (3 files), emmeans (2 files), tidyverse (2 files), broom (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
30 files

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:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 59 scripts, each with its path and the digest of its content;
  • 3 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

Datasets cited

Data availability

The raw data for this experiment is available at 10.5281/zenodo.15341473 while code that was used to perform the analyses is available at 10.5281/zenodo.17357764.

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, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 8 keywords, 12 MeSH terms, 1 funder, 52 references.

Cite

This paper

Brzezińska, A., Witkowski, B., Basińska, M., Domżalski, T., & Basiński, K. (2026). Non-linear relationships between auditory mismatch responses and the inharmonicity of complex sounds. Scientific reports, 16(1), 11836. https://doi.org/10.1038/s41598-026-41129-7

BibTeX

@article{brzezinska2026non,
author = {Brzezińska, Aniela and Witkowski, Bartosz and Basińska, Małgorzata and Domżalski, Tomasz and Basiński, Krzysztof},
title = {{Non-linear relationships between auditory mismatch responses and the inharmonicity of complex sounds}},
journal = {Scientific reports},
year = {2026},
month = mar,
volume = {16},
number = {1},
pages = {11836},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-41129-7},
url = {https://doi.org/10.1038/s41598-026-41129-7},
pmid = {41775782},
pmcid = {PMC13066439}
}

RIS

TY - JOUR
AU - Brzezińska, Aniela
AU - Witkowski, Bartosz
AU - Basińska, Małgorzata
AU - Domżalski, Tomasz
AU - Basiński, Krzysztof
TI - Non-linear relationships between auditory mismatch responses and the inharmonicity of complex sounds
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/03/03
VL - 16
IS - 1
SP - 11836
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-41129-7
UR - https://doi.org/10.1038/s41598-026-41129-7
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-41129-7",
"type": "article-journal",
"title": "Non-linear relationships between auditory mismatch responses and the inharmonicity of complex sounds",
"container-title": "Scientific reports",
"author": [
{
"family": "Brzezińska",
"given": "Aniela"
},
{
"family": "Witkowski",
"given": "Bartosz"
},
{
"family": "Basińska",
"given": "Małgorzata"
},
{
"family": "Domżalski",
"given": "Tomasz"
},
{
"family": "Basiński",
"given": "Krzysztof"
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "11836",
"DOI": "10.1038/s41598-026-41129-7",
"PMID": "41775782",
"PMCID": "PMC13066439",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-41129-7",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
3
]
]
}
}

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.1162/imag.a.1321 [code]
Phase similarity between similar objects indicates representational merging across retrieval training but not sleep.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: autoreject, broom, emmeans, 9 other tools, EEG, cognitive, 3 references
[2] doi:10.34133/csbj.0042 [code]
Using Steady-State Visual Evoked Potentials to Characterize Wide-Ranging Retinopathy Linked to &lt;i&gt;CRB1&lt;/i&gt;: Implications for Clinical Trials.
Journal: Computational and structural biotechnology journal
In common: SymPy, PsychoPy, emmeans, 9 other tools, EEG
[3] doi:10.1093/nc/niag029 [code]
A data-driven approach to identifying and evaluating connectivity-based neural correlates of conscious visual perception.
Journal: Neuroscience of consciousness
In common: autoreject, broom, emmeans, 8 other tools, cognitive, 2 references
[4] doi:10.1371/journal.pcbi.1014302 [code]
Trial-level sequence modeling reveals hidden dynamics of dual-task interference.
Journal: PLoS computational biology
In common: autoreject, emmeans, MNE-Python, 7 other tools, EEG, 2 references
[5] doi:10.1038/s41598-026-53525-0 [code]
Timing-induced illusory percepts of pitch.
Journal: Scientific reports
In common: PsychoPy, lmerTest, lme4, 6 other tools, cognitive, 3 references
[6] doi:10.1002/hbm.70368 [code]
The Mismatch Negativity Compared: EEG, SQUID‐MEG, and Novel 4 Helium‐OPMs
Journal: n/a
In common: autoreject, MNE-Python, seaborn, 3 other tools, EEG, cognitive, 5 references
[7] doi:10.1093/cercor/bhag113 [code]
Long-term reliability and stability of parameterized resting state EEG: evidence from a five-year follow-up.
Journal: Cerebral cortex (New York, N.Y. : 1991)
In common: broom, emmeans, MNE-Python, 8 other tools, EEG, 1 reference
[8] doi:10.1016/j.celrep.2026.117505 [code]
Impaired spatial coding and neuronal hyperactivity in the medial entorhinal cortex of aged APP knock-in mice.
Journal: Cell reports
In common: SymPy, nlme, broom, 7 other tools
[9] doi:10.1038/s41467-026-73865-9 [code]
Histamine shapes the neurocomputational dynamics of human learning.
Journal: Nature communications
In common: PsychoPy, broom, emmeans, 8 other tools, cognitive
[10] doi:10.1038/s41467-026-75662-w [code]
Distinct Roles of Deep and Superficial Cortical Layers in Tone Prediction, Comparison, and Adaptation in Human Auditory Cortices.
Journal: Nature communications
In common: MNE-Python, seaborn, tidyverse, 4 other tools, cognitive, 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.

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.