scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
sawtooth(t, width=1)

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 . :None:None:`width` must be in the interval [0, 1].

Note that this is not band-limited. It produces an infinite number of harmonics, which are aliased back and forth across the frequency spectrum.

Parameters

t : array_like

Time.

width : array_like, 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. :None:None:`width` = 0.5 produces a triangle wave. If an array, causes wave shape to change over time, and must be the same length as t.

Returns

y : ndarray

Output array containing the sawtooth waveform.

Return a periodic sawtooth or triangle waveform.

Examples

A 5 Hz waveform sampled at 500 Hz for 1 second:

>>> from scipy import signal
... import matplotlib.pyplot as plt
... t = np.linspace(0, 1, 500)
... plt.plot(t, signal.sawtooth(2 * np.pi * 5 * t))
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.signal._waveforms.sawtooth

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/signal/_waveforms.py#16
type: <class 'function'>
Commit: