braintools.input.gaussian_pulse#
- braintools.input.gaussian_pulse(amplitude, center, sigma, duration, n=1)#
Generate Gaussian pulse input.
Creates a Gaussian-shaped current pulse centered at a specific time with a specified width. Useful for smooth, physiologically realistic inputs.
- Parameters:
amplitude (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Peak amplitude of the Gaussian pulse. Supports current units.center (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Center time of the Gaussian pulse. Supports time units.sigma (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Standard deviation (width) of the Gaussian pulse. Supports time units.duration (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Total duration of the input.n (
int) – Number of parallel pulses to generate. Default is 1.
- Returns:
current – The Gaussian pulse input. Shape is (n_timesteps,) if n=1, or (n_timesteps, n) if n>1.
- Return type:
ndarray or Quantity
Examples
>>> import brainunit as u >>> import brainstate >>> brainstate.environ.set(dt=0.1 * u.ms)
Single Gaussian pulse
>>> current = gaussian_pulse( ... amplitude=10 * u.pA, ... center=50 * u.ms, ... sigma=10 * u.ms, ... duration=100 * u.ms ... )
Multiple identical pulses
>>> currents = gaussian_pulse( ... amplitude=5 * u.nA, ... center=25 * u.ms, ... sigma=5 * u.ms, ... duration=50 * u.ms, ... n=10 # Generate 10 identical pulses ... )
Narrow pulse (approximating delta function)
>>> current = gaussian_pulse( ... amplitude=100 * u.pA, ... center=10 * u.ms, ... sigma=0.5 * u.ms, ... duration=20 * u.ms ... )
Wide pulse (slow activation)
>>> current = gaussian_pulse( ... amplitude=2 * u.nA, ... center=100 * u.ms, ... sigma=30 * u.ms, ... duration=200 * u.ms ... )
Notes
The pulse is effectively zero at distances > 3*sigma from center
Total charge delivered depends on both amplitude and sigma
For n>1, all pulses are identical