sinusoid

boulderopal.signals.sinusoid(duration, amplitude, angular_frequency, phase=0.0)

Create a Signal object representing a sinusoidal oscillation.

Parameters

  • duration (float) – The duration of the oscillation.
  • amplitude (float or complex) – The amplitude of the oscillation, AA.
  • angular_frequency (float) – The angular frequency of the oscillation, ω\omega.
  • phase (float , optional) – The phase of the oscillation, ϕ\phi. Defaults to 0.

Returns

The sinusoidal oscillation.

Return type

Signal

SEE ALSO

boulderopal.signals.cosine_pulse : Create a Signal object representing a cosine pulse.

boulderopal.signals.hann_series : Create a Signal object representing a sum of Hann window functions.

Graph.signals.sinusoid_pwc : Graph operation to create a Pwc representing a sinusoidal oscillation.

Graph.signals.sinusoid_stf : Graph operation to create a Stf representing a sinusoidal oscillation.

Notes

The sinusoid is defined as

Sinusoid(t)=Asin(ωt+ϕ). \mathop{\mathrm{Sinusoid}}(t) = A \sin \left( \omega t + \phi \right) .

Examples

Define a sinusoidal oscillation.

>>> signal = bo.signals.sinusoid(
...     duration=2.0,
...     amplitude=1.0,
...     angular_frequency=np.pi,
...     phase=np.pi/2.0,
... )
>>> signal.export_with_sampling_rate(sampling_rate=0.25)
array([ 0.92387953,  0.38268343, -0.38268343, -0.92387953, -0.92387953,
   -0.38268343,  0.38268343,  0.92387953])

Was this useful?