scipy.signal.sawtooth

scipy.signal.sawtooth(t, width=1)[source]

Return a periodic sawtooth or triangle waveform.

The sawtooth waveform has a period 2*pi, rises from -1 to 1 on the interval 0 to width*2*pi, then drops from 1 to -1 on the interval width*2*pi to 2*pi. width must be in the interval [0, 1].

Parameters :

t : array_like

Time.

width : float, optional

Width of the rising ramp as a proportion of the total cycle. Default is 1, producing a rising ramp, while 0 produces a falling ramp. t = 0.5 produces a triangle wave.

Returns :

y : ndarray

Output array containing the sawtooth waveform.

Examples

Previous topic

scipy.signal.gausspulse

Next topic

scipy.signal.square