home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 8.ddi / SIGNAL.DI$ / SAWTOOTH.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  317 b   |  9 lines

  1. function y = sawtooth(t)
  2. %SAWTOOTH Sawtooth wave generation.
  3. %    SAWTOOTH(T) generates a sawtooth wave with period 2*Pi for the
  4. %    elements of time vector T.  SAWTOOTH(T) is like SIN(T), only
  5. %    it creates a sawtooth wave with peaks of +1 to -1 instead of
  6. %    a sine wave.
  7.  
  8. y = ((t < 0) + rem(t,2*pi)/2/pi - .5)*2;
  9.