neurodsp.sim.transients.sim_action_potential

neurodsp.sim.transients.sim_action_potential(n_seconds, fs, centers, stds, alphas, heights)[source]

Simulate an action potential as the sum of skewed gaussians.

Parameters
n_secondsfloat

Length of cycle window in seconds.

fsfloat

Sampling frequency of the cycle simulation.

centersarray-like or float

Times where the peak occurs in the pre-skewed gaussian.

stdsarray-like or float

Standard deviations of the gaussian kernels, in seconds.

alphasarray-like or float

Magnitiude and direction of the skew.

heightsarray-like or float

Maximum value of the cycles.

Returns
cycle1d array

Simulated spike cycle.

Examples

Simulate an action potential:

>>> ap = sim_action_potential(n_seconds=0.01, fs=30000,
...                           centers=[0.35, 0.45, 0.6], stds=[0.1, 0.1, 0.1],
...                           alphas=[-1, 0, 1], heights=[1.5, -5, 0.5])