SquareWave#

class SquareWave(
frequency: float = 1000.0,
amplitude: float = 1.0,
offset: float = 0.0,
)[source]#

Bases: object

A 50% duty-cycle square wave at a VirtualScope channel’s probe tip.

Each cycle starts with a rising edge from offset - amplitude to offset + amplitude. At 0 Hz it sits at offset, as a 0 Hz SineWave does.

Variables:
  • frequency (float) – Frequency in Hz, not negative. 0 gives a DC level.

  • amplitude (float) – Peak amplitude in volts (half the peak-to-peak value), not negative.

  • offset (float) – DC offset in volts.

Raises:

ValueError – frequency or amplitude is negative or not finite, or offset is not finite.

frequency: float = 1000.0#
amplitude: float = 1.0#
offset: float = 0.0#