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
  • end_time (float or None , optional) – The end time of the square pulse, t1t_1

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)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?