function y = sawtooth(t)
%SAWTOOTH Sawtooth wave generation.
%	SAWTOOTH(T) generates a sawtooth wave with period 2*Pi for the
%	elements of time vector T.  SAWTOOTH(T) is like SIN(T), only
%	it creates a sawtooth wave with peaks of +1 to -1 instead of
%	a sine wave.

y = ((t < 0) + rem(t,2*pi)/2/pi - .5)*2;
