Recorders¶
Spike train recording and analysis utilities.
BitstreamSpikeRecorder— Records spikes as 1D bitstream (0/1 per timestep). Provides: total spike count, firing rate (Hz given dt in ms), ISI histogram, raster data for plotting.
from sc_neurocore import BitstreamSpikeRecorder
recorder = BitstreamSpikeRecorder()
for t in range(1000):
spike = neuron.step(current)
recorder.record(spike)
print(f"Total spikes: {recorder.total_spikes}")
print(f"Firing rate: {recorder.firing_rate(dt=1.0):.1f} Hz")
sc_neurocore.recorders.spike_recorder.BitstreamSpikeRecorder
dataclass
¶
Record spikes over time and compute basic statistics.
Stores a 1D bitstream of spikes (0/1) and provides: - total spikes - firing rate (Hz) given dt (ms) - inter-spike interval (ISI) histogram
Source code in src/sc_neurocore/recorders/spike_recorder.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
isi_histogram(bins=10)
¶
Compute histogram of inter-spike intervals in ms.
Returns¶
hist : np.ndarray Histogram counts. bin_edges : np.ndarray Bin edges (ms).
Source code in src/sc_neurocore/recorders/spike_recorder.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |