braintools.input.TimeShifted#
- class braintools.input.TimeShifted(input_obj, time_shift)#
Time-shifted version of an input.
Shifts an input forward (delay) or backward (advance) in time. The total duration remains the same, with zero-padding added as needed.
- Parameters:
Examples
>>> pulse = Step([1], [200 * u.ms], 500 * u.ms) >>> >>> # Delay by 100ms (pulse now at 300ms) >>> delayed = TimeShifted(pulse, 100 * u.ms) >>> >>> # Advance by 50ms (pulse now at 150ms) >>> advanced = TimeShifted(pulse, -50 * u.ms) >>> >>> # Usually created via shift() method >>> delayed = pulse.shift(100 * u.ms)
Methods
__init__(input_obj, time_shift)Initialize time-shifted 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 shifted 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.