spiketools.sim.train.sim_spiketrain_poisson

spiketools.sim.train.sim_spiketrain_poisson(rate, n_samples, fs=1000, refractory=None)[source]

Simulate spike train from a Poisson distribution.

Parameters:
ratefloat

The firing rate of neuron to simulate.

n_samplesint

The number of samples to simulate.

fsint, optional, default: 1000

The sampling rate, in Hz.

refractoryint, optional

The refractory period to apply to the simulated data, in number of samples.

Returns:
spike_train1d array

Simulated spike train.

Examples

Simulate a spike train at a rate of 2 Hz for 100 samples:

>>> spike_train = sim_spiketrain_poisson(2, 100)