<< pulstran Choice of Particular Signals tftb_window >>

stftb >> stftb > Choice of Particular Signals > sawtooth

sawtooth

Generates a sawtooth wave

Calling Sequence

y = sawtooth(t)
y = sawtooth(t, width)

Parameters

t :

a real vector: the time vector.

width :

a scalar in [0 1].

Description

Generates a sawtooth wave of period 2 * pi with limits +1/-1 for the elements of t.

width is a real number between 0 and 1 which specifies the point between 0and 2 * pi where the maximum is. The function increases linearly from -1 to 1 in [0, 2 * pi * width] interval, and decreases linearly from 1 to -1 in the interval[2 * pi * width, 2 * pi].

If width is 0.5, the function generates a standard triangular wave.

If width is not specified, it takes a value of 1, which is a standard sawtooth function.

Examples

t = linspace(0,20,3000);
clf
plot(t, sawtooth(t,0.2),"b")
plot(t, sawtooth(t,0.5),"r")
legend("width="+string([0.2 0.5]));

Authors


Report an issue
<< pulstran Choice of Particular Signals tftb_window >>