| Signal Processing Toolbox | Search  Help Desk |
| sawtooth | See Also |
Sawtooth or triangle wave generator.
Syntax
x = sawtooth(t) x = sawtooth(t,width)
Description
sawtooth(t)
generates a sawtooth wave with period 2
for the elements of time vector t. sawtooth(t) is similar to sin(t), but it creates a sawtooth wave with peaks of -1 and 1 instead of a sine wave. The sawtooth wave is defined to be -1 at multiples of 2
and to increase linearly with time with a slope of 1/
at all other times.
sawtooth(t,width)
generates a modified triangle wave where width, a scalar parameter between 0 and 1, determines the fraction between 0 and 2
at which the maximum occurs. The function increases from -1 to 1 on the interval 0 to 2
*width, then decreases linearly from 1 to -1 on the interval 2
*width to 2
. Thus a parameter of 0.5 specifies a standard triangle wave, symmetric about time instant
with peak-to-peak amplitude of 1. sawtooth(t,1) is equivalent to sawtooth(t).
Diagnostics
If thewidth parameter is not a scalar, sawtooth gives the following error message:
Requires WIDTH parameter to be a scalar.
See Also
chirp |
Swept-frequency cosine generator. |
cos |
Cosine of vector/matrix elements (see the online MATLAB Function Reference). |
diric |
Dirichlet or periodic sinc function. |
gauspuls |
Gaussian-modulated sinusoidal pulse generator. |
pulstran |
Pulse train generator. |
rectpuls |
Sampled aperiodic rectangle generator. |
sin |
Sine of vector/matrix elements (see the online MATLAB Function Reference). |
sinc |
Sinc or sin( t)/ t function. |
square |
Square wave generator. |
tripuls |
Sampled aperiodic triangle generator. |