square_pulse
boulderopal.signals.square_pulse(duration, amplitude, start_time=0.0, end_time=None)
Create a Signal object representing a square pulse.
Parameters
- duration (float) – The duration of the pulse.
- amplitude (float or complex) – The amplitude of the square pulse, .
- start_time (float , optional) – The start time of the square pulse, . Defaults to 0.
- end_time (float or None , optional) – The end time of the square pulse, . Must be greater than the start time. Defaults to the duration.
Returns
The square pulse.
Return type
SEE ALSO
boulderopal.signals.cosine_pulse
: Create a Signal object representing a cosine pulse.
boulderopal.signals.gaussian_pulse
: Create a Signal object representing a Gaussian pulse.
boulderopal.signals.sech_pulse
: Create a Signal object representing a hyperbolic secant pulse.
Graph.signals.square_pulse_pwc
: Graph operation to create a Pwc representing a square pulse.
Notes
The square pulse is defined as
where is the Heaviside step function.
Examples
Define a square pulse and discretize it.
>>> pulse = bo.signals.square_pulse(duration=4.0, amplitude=2.5, start_time=1.0, end_time=3.0)
>>> pulse.export_with_time_step(time_step=1.0)
array([0. , 2.5, 2.5, 0. ])