<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the Scilab time frequency toolbox.
This file must be used under the terms of the  terms of the GNU General Public License 
as published by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Copyright (C) 2007   Juan Aguado
-->


<refentry xml:id="sawtooth" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:scilab="http://www.scilab.org"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook">

  <refnamediv>
    <refname>sawtooth</refname>
	<refpurpose>Generates a sawtooth wave</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>Calling Sequence</title>
    <synopsis>
      y = sawtooth(t)
      y = sawtooth(t, width)
    </synopsis>
  </refsynopsisdiv>
  <refsection>
    <title>Parameters</title>
    <variablelist>
      <varlistentry>
        <term>t :</term>
        <listitem><para>a real vector: the time vector.</para>
        </listitem>
      </varlistentry>
    </variablelist>
    <variablelist>
      <varlistentry>
        <term>width :</term>
        <listitem>
          <para>a scalar in [0 1].</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>
  <refsection>
    <title>Description</title>
    <para>
      Generates a sawtooth wave of period 2 * pi with limits +1/-1
      for the elements of t.
    </para>
    <para>
      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].
    </para>
    <para>
      If width is 0.5, the function generates a standard triangular wave.
    </para>
    <para>
      If width is not specified, it takes a value of 1, which is a standard
      sawtooth function.
    </para>
  </refsection>
  <refsection>
    <title>Examples</title>
    <programlisting role="example"><![CDATA[
    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]));
    ]]></programlisting>
  </refsection>

  <refsection>
    <title>Authors</title>
    <simplelist type="vert">
      <member>Juan Aguado 2007</member>
    </simplelist>
  </refsection>
</refentry>
