braintools.input.Repeated#
- class braintools.input.Repeated(input_obj, n_times)#
Repeated version of an input pattern.
Repeats an input pattern multiple times, useful for creating periodic stimulation protocols.
- Parameters:
Notes
The total duration is n_times * original_duration.
Examples
>>> # Single burst >>> burst = Step([0, 1, 0], [0, 10, 30], 50 * u.ms) >>> >>> # Burst train (10 bursts, 500ms total) >>> train = Repeated(burst, 10) >>> >>> # Oscillation packets >>> packet = Sinusoidal(1.0, 100 * u.Hz, 100 * u.ms) >>> packets = Repeated(packet, 5) # 500ms total >>> >>> # Usually created via repeat() method >>> train = burst.repeat(10)
Methods
__init__(input_obj, n_times)Initialize repeated input.
apply(func)Apply a custom function to the input.
clip([min_val, max_val])Clip the input values to a range.
generate()Generate the repeated input.
repeat(n_times)Repeat the input pattern n times.
scale(factor)Scale the input by a factor.
shift(time_shift)Shift the input in time.
smooth(tau)Apply exponential smoothing to the input.
Attributes
dtGet the time step from global environment.
n_stepsGet the number of time steps.
shapeGet the shape of the input array.