科研 Skill

刺激呈现时序校准

neuro-stimulus-timing-audit

Measures and corrects stimulus presentation timing for EEG, MEG or BCI experiments using a photodiode or trigger loopback. Use when ERPs look jittery or frame drops are suspected.

发布者 Codar安全审核通过v0.1.0更新于 2026-11-18

SKILL.md

Stimulus timing audit

The time a script logs a stimulus is not the time light leaves the screen or sound leaves the speaker. Displays add a fixed lag plus frame-quantised jitter, and dropped frames add whole frame periods. Measure with a sensor on the output, recorded on the same amplifier as the brain data.

1. Set up the measurement

  • Photodiode taped over a small patch in a screen corner that flips white with each stimulus; record it on an aux channel of the EEG amplifier.
  • Audio: split the audio output into an aux channel or use a microphone.
  • Keep the software marker (or TTL) too; the audit compares the two.

2. Measure with the bundled script

python scripts/photodiode_lag.py --sensor aux.npy --fs 1000 --markers marker_samples.npy \
       [--refresh 60] [--window-ms 200] [--polarity rise]

It finds the sensor onset after each marker (half-amplitude crossing), reports lag statistics in ms, missed onsets, and whether lags cluster at multiples of the frame period (frame drops). --out corrected.npy writes corrected event samples.

3. Interpret

ResultMeaningAction
constant lag, small spread (under 1 ms)display/audio latency onlyshift events by the median lag
spread about one frame periodmarker not synced to the display flipsend marker on flip (PsychoPy win.callOnFlip, Psychtoolbox Screen('Flip') timestamp) or use sensor onsets as events
lags at extra whole framesdropped framesreduce load, disable compositor effects, check refresh rate setting
missed onsetsstimulus not shown or sensor misplacedcheck the log for those trials

For SSVEP or flicker stimuli also check the actual flicker frequency from the sensor spectrum, since frame drops shift it.

4. Report

Display/audio device, refresh rate, number of events, median lag, spread (SD and range), frame drops, missed events, and the correction applied.

示例提示词

我的ERP实验时间锁定不准,帮我用光电二极管校准刺激呈现延迟。

所属插件

神经科学面向神经科学研究:EEG/MEG、fMRI、BIDS、spike sorting、连接组、脑机接口解码评估、神经刺激安全与公开神经数据检索。

安装该插件会一并获得同领域的 45 个 Skill / MCP。

同插件的其他科研 Skill

常见问题

刺激呈现时序校准能做什么?

Measures and corrects stimulus presentation timing for EEG, MEG or BCI experiments using a photodiode or trigger loopback. Use when ERPs look jittery or frame drops are suspected。

如何安装刺激呈现时序校准?

在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「刺激呈现时序校准」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。

刺激呈现时序校准需要哪些权限?

该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。

刺激呈现时序校准经过官方审核吗?

是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。