Skip to content
Back to skills

Neuro Sync Forensics

ASecurity

Align recordings and event logs that come from different clocks (EEG/ECoG amplifiers, stimulus PCs, eye trackers, cameras, implants, LSL streams, ephys systems with sync pulses). Use whenever the user needs event times in samples, merges data from two devices, sees events drifting out of place, has missing or extra sync pulses, or suspects a wrong sampling rate in a file header.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 13, 2026
ai-agentspythonrustbash

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 13, 2026

npx -y skills add Hillock-NeuroTech/neurotech-skills --skill neuro-sync-forensics --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Neuro Sync Forensics?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Neuro Sync Forensics
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hillock-neurotech-neuro-sync-forensics/badge)](https://www.skillsdirectory.com/skills/hillock-neurotech-neuro-sync-forensics)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: neuro-sync-forensics
description: Align recordings and event logs that come from different clocks (EEG/ECoG amplifiers, stimulus PCs, eye trackers, cameras, implants, LSL streams, ephys systems with sync pulses). Use whenever the user needs event times in samples, merges data from two devices, sees events drifting out of place, has missing or extra sync pulses, or suspects a wrong sampling rate in a file header.
---

# 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

```bash
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.

Files in this skill

  • SKILL.md2.3 KB
  • scripts/align_clocks.py3.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.