<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="GEN12">
  <refmeta>
    <refentrytitle>GEN12</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>GEN12</refname>
    <refpurpose>
      Generates the log of a modified Bessel function of the second kind.
      <indexterm id="IndexGEN12"><primary>GEN12</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      This generates the log of a modified Bessel function of the second kind, order 0, suitable for use in amplitude-modulated FM.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>f</command> # time size 12 xint</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>size </emphasis> -- number of points in the table. Must be a power of 2 or a power-of-2 plus 1 (see <link linkend="f"><citetitle>f statement</citetitle></link>). The normal value is power-of-2 plus 1.
    </para>

    <para>
      <emphasis>xint</emphasis> -- specifies the <emphasis>x</emphasis> interval [0 to <emphasis>+xint</emphasis>] over which the function is defined.
    </para>

    <note>
      <title>Note</title>
      <para>
        <itemizedlist>
          <listitem>
            <para>
              This subroutine draws the natural log of a modified Bessel function of the second kind, order 0 (commonly written as <emphasis>I</emphasis> subscript 0), over the x-interval requested. The call should have rescaling inhibited.
            </para>
          </listitem>

          <listitem>
            <para>
              The function is useful as an amplitude scaling factor in cycle-synchronous amplitude-modulated FM. (See Palamin &amp; Palamin, <emphasis>J. Audio Eng. Soc., 36/9</emphasis>, Sept. 1988, pp.671-684.) The algorithm is interesting because it permits the normally symmetric FM spectrum to be made asymmetric around a frequency other than the carrier, and is thereby useful for formant positioning. By using a table lookup index of <emphasis>I</emphasis>(r - 1/r), where <emphasis>I</emphasis> is the FM modulation index and <emphasis>r</emphasis> is an exponential parameter affecting partial strengths, the Palamin algorithm becomes relatively efficient, requiring only oscil's, table lookups, and a single <emphasis>exp</emphasis> call.
            </para>
          </listitem>
        </itemizedlist>
      </para>
    </note>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      Here is a simple example of the GEN12 routine. It uses the files <ulink url="examples/gen12.orc"><citetitle>gen12.orc</citetitle></ulink> and <ulink url="examples/gen12.sco"><citetitle>gen12.sco</citetitle></ulink>. It generates the function <emphasis>ln(I0(x))</emphasis> from 0 to 20. Here is its diagram:

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/gen12.png" format="PNG">
        </imageobject>

        <textobject>
          <phrase>Diagram of the waveform generated by GEN12.</phrase>
        </textobject>

        <caption>
          <para>Diagram of the waveform generated by GEN12.</para>
        </caption>
      </mediaobject>

      <example>
        <title>A simple example of the GEN12 routine.</title>

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

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

  <refsect1>
    <title>Credits</title>
    <para>Example written by &namekevin;</para>
  </refsect1>
</refentry>
