burst_synchrony_index#
- class braintools.metric.burst_synchrony_index(spike_matrix, burst_threshold=3, max_isi=100.0, dt=None)#
Calculate burst synchrony index based on co-occurring burst events.
This measure identifies burst events in each spike train and quantifies the synchronization of these bursts across the population.
A burst is defined as a sequence of at least
burst_thresholdspikes with inter-spike intervals ≤max_isi.- Parameters:
spike_matrix (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Spike matrix with shape(n_time_steps, n_neurons).burst_threshold (
int) – Minimum number of spikes required to constitute a burst.max_isi (
float) – Maximum inter-spike interval within a burst. Must use the same time unit asdt.dt (
float) – Time step between successive samples. If None, uses brainstate default.
- Returns:
Burst synchrony index between 0 (no burst synchrony) and 1 (perfect burst synchrony).
- Return type:
Notes
This function runs on host (concrete) arrays (Python loops,
len), so it is notjit/vmap/grad-compatible.Examples
>>> import jax.numpy as jnp >>> import braintools >>> spikes = jnp.zeros((1000, 10)) >>> for start in [100, 300, 600]: ... for i in range(10): ... spikes = spikes.at[start:start + 5, i].set(1) >>> sync_idx = braintools.metric.burst_synchrony_index(spikes, max_isi=5.0, dt=1.0) >>> bool(0.0 <= sync_idx <= 1.0) True