brainpy.inputs.spike_input#
- brainpy.inputs.spike_input(sp_times, sp_lens, sp_sizes, duration, dt=None)[source]#
Format current input like a series of short-time spikes.
For example:
If you want to generate a spike train at 10 ms, 20 ms, 30 ms, 200 ms, 300 ms, and each spike lasts 1 ms and the spike current is 0.5, then you can use the following funtions:
>>> spike_input(sp_times=[10, 20, 30, 200, 300], >>> sp_lens=1., # can be a list to specify the spike length at each point >>> sp_sizes=0.5, # can be a list to specify the current size at each point >>> duration=400.)