<?xml version="1.0" encoding="UTF-8"?>

<!--
 *
 * This help file was generated from uencode.sci using help_from_sci().
 *
 -->

<refentry version="5.0-subset Scilab" xml:id="uencode" 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:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:scilab="http://www.scilab.org"
          xmlns:db="http://docbook.org/ns/docbook">

  <refnamediv>
    <refname>uencode</refname>
    <refpurpose>Performs uniform quantization of the input into 2^n levels</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Syntax</title>
   <synopsis>
   y=uencode(u,n,v,'signflag')
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
        <varlistentry>
            <term>u :</term>
            <listitem><para> A vector, matrix or n-dimensional array</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>n :</term>
            <listitem><para> An integer between 2 and 32</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>v :</term>
            <listitem><para> A positive real scalar</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>'signflag' :</term>
            <listitem><para> A string which can take only 2 values 'signed' or 'unsigned'</para></listitem>
        </varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
Uniformly quantizes the input vector or n-dimensional array u into 2^n levels in the interval [-v,v]
If v is not specified, its default value is 1
'signflag' is a string that determines the nature of the quantization
If signflag='unsigned' then y contains unsigned integers in the range [0,2^n-1] corresponding to the 2^n levels
If signflag='unsigned' then y contains signed integers in the range [-2^(n-1),2^(n-1)-1] corresponding to the 2^n levels
The  size of the integers in y in bits(8,16, or 32) depends on the value of n
If the input lies beyond +/- v it is saturated
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
y=uencode(-1:0.5:1,3)

   ]]></programlisting>
</refsection>

<refsection>
   <title>Authors</title>
   <simplelist type="vert">
   <member>Ankur Mallick</member>
   </simplelist>
</refsection>

<refsection>
   <title>Bibliography</title>
   <para>[1] International Telecommunication Union. General Aspects of Digital Transmission Systems: Vocabulary of Digital Transmission and Multiplexing, and Pulse Code Modulation (PCM) Terms. ITU-T Recommendation G.701. March, 1993.</para>
</refsection>

<refsection role="see also">
   <title>See also</title>
   <simplelist type="inline">
   <member><link linkend="udecode">udecode</link></member>
   <member><link linkend="floor">floor</link></member>
   </simplelist>
</refsection>
</refentry>
