Skip to content

The synthetic recording

Every chapter up to sorting uses a synthetic recording from plating.signals: its content is known, so each operation’s effect can be seen and checked. It is the sum of five components, all kept separately:

component what it is which chapter removes it
lfp slow oscillations (4 and 9 Hz) low-pass keeps it, high-pass removes it (02)
hum 60 Hz mains and its third harmonic, the same on every channel notch (02), referencing (03)
common a slow artefact shared by all channels referencing (03)
spikes three units firing, each on a few neighbouring channels what the filters keep
noise white noise, independent per channel —
import plating
from plating import signals
s = signals.synthetic() # 8 channels × 2 s at 30 kHz, seed 0: the same recording every time
print(f"{s.channels} channels × {s.samples:,} samples at {s.sample_rate:,.0f} Hz, {s.spike_samples.size} spikes from {len(s.templates)} units")

The synthetic recording

The whole script is playground/01_basics/02_synthetic_signal.py. Run it with uv run python playground/01_basics/02_synthetic_signal.py.