brainpy.measure.firing_rate#

brainpy.measure.firing_rate(sp_matrix, width, dt=None, numpy=True)[source]#

Calculate the mean firing rate over in a neuron group.

This method is adopted from Brian2.

The firing rate in trial \(k\) is the spike count \(n_{k}^{sp}\) in an interval of duration \(T\) divided by \(T\):

\[v_k = {n_k^{sp} \over T}\]
Parameters
  • sp_matrix (math.JaxArray, np.ndarray) – The spike matrix which record spiking activities.

  • width (int, float) – The width of the window in millisecond.

  • dt (float, optional) – The sample rate.

Returns

rate – The population rate in Hz, smoothed with the given window.

Return type

numpy.ndarray