Skip to content

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.

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

dspk.ops.math.window: Hann, Hamming, Gaussian and Kaiser, symmetric.

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 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)

There’s no general threshold-crossing or onset operation in the core yet. For spikes, see detection in the Synapse plugin.