Statistics and models
These answer a question about the signal, rather than producing another signal, so they’re called from Python or Rust and aren’t pipeline stages.
Per-channel statistics
Section titled “Per-channel statistics”| Function | What it gives |
|---|---|
channel_noise_std |
median(abs(x)) / 0.6745: robust noise, barely moved by the spikes |
channel_mad |
median(abs(x - median(x))), unscaled |
channel_mean_std |
Mean and population standard deviation |
Windows
Section titled “Windows”dspk.ops.math.window: Hann, Hamming, Gaussian and
Kaiser, symmetric.
Peak candidates
Section titled “Peak candidates”dspk.ops.peaks.candidates finds local extrema
reaching a height per channel. A flat peak is reported at its first sample.
noise = dspk.ops.math.channel_noise_std(x)peaks = dspk.ops.peaks.candidates(x, 4 * noise, polarity="negative")PCA and probabilistic PCA
Section titled “PCA and probabilistic PCA”PCA and
PPCA fit on the device. Channels are the features,
and samples the observations.
pca = dspk.ops.linalg.PCA.fit(x, 3)scores = pca.transform(x) # (3, samples)Crossing a threshold
Section titled “Crossing a threshold”There’s no general threshold-crossing or onset operation in the core yet. For spikes, see detection in the Synapse plugin.