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, AA.
  • start_time (float , optional) – The start time of the square pulse, t0t_0. Defaults to 0.
  • end_time (float or None , optional) – The end time of the square pulse, t1t_1. Must be greater than the start time. Defaults to the duration.

Returns

The square pulse.

Return type

Signal

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

Square(t)=Aθ(tt0)θ(t1t), \mathop{\mathrm{Square}}(t) = A \theta(t-t_0) \theta(t_1-t) ,

where θ(t)\theta(t) 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. ])

Was this useful?