<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="interp">
  <refmeta>
    <refentrytitle>interp</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>interp</refname>
    <refpurpose>
      Converts a control signal to an audio signal using linear interpolation.
      <indexterm id="IndexInterp"><primary>interp</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Converts a control signal to an audio signal using linear interpolation.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>interp</command> ksig [, iskip] [, imode]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>iskip</emphasis> (optional, default=0) -- initial disposition of internal save space (see <link linkend="reson"><citetitle>reson</citetitle></link>). The default value is 0.
    </para>

    <para>
      <emphasis>imode</emphasis> (optional, default=0) -- sets the initial output value to the first k-rate input instead of zero.  The following graphs show the output of interp with a constant input value, in the original, when skipping init, and in the new mode:

      <example>
        <title>iskip=0, imode=0</title>
        <literallayout>
 |    ________
 |   /        
 |  /         
 | /          
 |/           
-+------------
 |            
        </literallayout>
      </example>

      <example>
        <title>iskip=1, imode=0</title>
        <literallayout>
(prev)
 |  __________
 | /          
 |/           
 |            
 |            
-+------------
 |            
        </literallayout>
      </example>

      <example>
        <title>iskip=0, imode=1</title>
        <literallayout>
 |____________
 |
 |
 |
 |
-+------------
 |
        </literallayout>
      </example>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ksig</emphasis> -- input k-rate signal.
    </para>

    <para>
      <emphasis>interp</emphasis> converts a control signal to an audio signal. It uses linear interpolation between successive kvals. 
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the interp opcode. It uses the files <ulink url="examples/interp.orc"><citetitle>interp.orc</citetitle></ulink> and <ulink url="examples/interp.sco"><citetitle>interp.sco</citetitle></ulink>.

      <example>
        <title>Example of the interp opcode.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/interp.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/interp.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="diff"><citetitle>diff</citetitle></link>,
      <link linkend="downsamp"><citetitle>downsamp</citetitle></link>,
      <link linkend="integ"><citetitle>integ</citetitle></link>,
      <link linkend="samphold"><citetitle>samphold</citetitle></link>,
      <link linkend="upsamp"><citetitle>upsamp</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Example written by &namekevin;.</para>
    <para>Updated November 2002, thanks to a note from both &namerasmus; and &nameistvan;.</para>
  </refsect1>
</refentry>
