科研 Skill

多设备记录时钟同步

neuro-sync-forensics

Aligns recordings and event logs from different clocks using shared sync events rather than nominal sampling rates. Use when events drift out of place across merged devices.

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

SKILL.md

Sync forensics

Two devices never share a clock. Crystals differ by tens to hundreds of ppm (100 ppm is 0.36 s per hour), pulses get dropped, headers state a nominal rate, and software timestamps jitter. Align with shared events, not with nominal rates.

1. Find the shared events

Usually TTL sync pulses recorded on both sides (trigger channel on the amplifier, log on the stimulus PC), a photodiode, or a sync LED seen by a camera. Irregular intervals (for example 8-12 s random) make matching unambiguous; regular 1 s pulses show the true sampling rate.

2. Fit the clock map with the bundled script

python scripts/align_clocks.py --a pc_sync_times.txt --b eeg_trigger_samples.npy \
       --b-rate 500 [--map keypress_times.txt] [--out mapped.npy]

--a: event times on clock A (seconds). --b: the same events on clock B (samples or seconds, with --b-rate the nominal rate). The script matches events robustly (handles dropped and spurious pulses), fits b = slope * a + offset by least squares, iterates matching with the fitted map, and reports drift in ppm, residuals, unmatched events on each side, and the effective sampling rate. --map converts other clock-A times (keypresses, stimuli) to clock B.

Check the residuals: under 1 sample means a linear map is enough. Steps in the residuals mean a clock reset or a dropped data block; fit piecewise between the steps.

3. Wrong header rate

If evenly spaced pulses of known period (for example 1 per second) give a spacing that disagrees with the header, trust the pulses and fit the rate from them. A constant spacing that is off by a few percent is a header or export error, not drift.

4. Report

Shared events used, matched/unmatched counts, slope as ppm drift, offset, residual RMS and max in samples, effective sampling rate, and any segments fitted separately. Keep the fitted map with the data so others can apply it.

示例提示词

帮我把眼动仪和EEG放大器的记录对齐到同一个时间轴上。

所属插件

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

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

同插件的其他科研 Skill

常见问题

多设备记录时钟同步能做什么?

Aligns recordings and event logs from different clocks using shared sync events rather than nominal sampling rates. Use when events drift out of place across merged devices。

如何安装多设备记录时钟同步?

在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「多设备记录时钟同步」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。

多设备记录时钟同步需要哪些权限?

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

多设备记录时钟同步经过官方审核吗?

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