<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="ziwm">
  <refmeta>
    <refentrytitle>ziwm</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>ziwm</refname>
    <refpurpose>
      Writes to a zk variable to an i-rate variable with mixing.
      <indexterm id="IndexZiwm"><primary>ziwm</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Writes to a zk variable to an i-rate variable with mixing.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>ziwm</command> isig, indx [, imix]</synopsis>
 </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>isig</emphasis> -- initializes the value of the zk location.
    </para>

    <para>
      <emphasis>indx</emphasis> -- points to the zk location location to which to write.
    </para>

    <para>
      <emphasis>imix</emphasis> (optional, default=1) -- indicates if mixing should occur.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ziwm</emphasis> is a mixing opcode, it adds the signal to the current value of the variable. If no <emphasis>imix</emphasis> is specified, mixing always occurs. <emphasis>imix</emphasis> = 0 will cause overwriting like <emphasis>ziw</emphasis>, <emphasis>zkw</emphasis>, and <emphasis>zaw</emphasis>. Any other value will cause mixing.
    </para>

    <para>
      <emphasis>Caution</emphasis>: When using the mixing opcodes <emphasis>ziwm</emphasis>, <emphasis>zkwm</emphasis>, and <emphasis>zawm</emphasis>, care must be taken that the variables mixed to, are zeroed at the end (or start) of each k- or a-cycle. Continuing to add signals to them, can cause their values can drift to astronomical figures.
    </para>

    <para>
      One approach would be to establish certain ranges of zk or za variables to be used for mixing, then use <emphasis>zkcl</emphasis> or <emphasis>zacl</emphasis> to clear those ranges.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the ziwm opcode. It uses the files <ulink url="examples/ziwm.orc"><citetitle>ziwm.orc</citetitle></ulink> and <ulink url="examples/ziwm.sco"><citetitle>ziwm.sco</citetitle></ulink>.

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

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

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

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="zaw"><citetitle>zaw</citetitle></link>,
      <link linkend="zawm"><citetitle>zawm</citetitle></link>,
      <link linkend="ziw"><citetitle>ziw</citetitle></link>,
      <link linkend="zkw"><citetitle>zkw</citetitle></link>,
      <link linkend="zkwm"><citetitle>zkwm</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: Robin Whittle</member>
        <member>Australia</member>
        <member>May 1997</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
