scipy.signal.square

scipy.signal.square(t, duty=0.5)[source]

Return a periodic square-wave waveform.

The square wave has a period 2*pi, has value +1 from 0 to 2*pi*duty and -1 from 2*pi*duty to 2*pi. duty must be in the interval [0,1].

Parameters :

t : array_like

The input time array.

duty : float, optional

Duty cycle.

Returns :

y : array_like

The output square wave.

Previous topic

scipy.signal.sawtooth

Next topic

scipy.signal.sweep_poly