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

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

<refentry version="5.0-subset Scilab" xml:id="db" 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>db</refname>
    <refpurpose>Converts the elements of the vector or matrix X to decibels (dB</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Syntax</title>
   <synopsis>
   [dboutput] = db(X)
   [dboutput] = db(X, SignalType)
   [dboutput] = db(X, R)
   [dboutput] = db(X, 'voltage', R)
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
        <varlistentry>
            <term>X:</term>
            <listitem><para> Signal measurements. X must be a vector or matrix. If the elements of X are power measurements, all elements must be nonnegative.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>SignalType:</term>
            <listitem><para> Type of signal measurements. Valid entries for SignalType are 'voltage' or 'power'. The entries are not case sensitive. If you specify SignalType as 'power', the elements of X must be nonnegative. Default: 'voltage'</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>R:</term>
            <listitem><para> Resistive load in ohms. You can specify resistance only when the SignalType is 'voltage'. Default: 1</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>dboutput:</term>
            <listitem><para> The elements of the vector or matrix X converted to decibels (dB). The elements of X are voltage measurements across a resistance of 1 ohm.</para></listitem>
        </varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
dboutput = db(X) converts the elements of the vector or matrix X to decibels (dB). The elements of X are voltage measurements across a resistance of 1 ohm.
dboutput = db(X,SignalType) specifies the signal type represented by the elements of X as 'voltage' or 'power'. The entries are not case sensitive. The default value is 'voltage'. For voltage measurements, the resistance defaults to 1 ohm. If you specify SignalType as 'power', the elements of X must be nonnegative.
dboutput = db(X,R) specifies the resistance R for voltage measurements. You can specify a resistance only when the signal measurements are voltages.
dboutput = db(X,'voltage',R) specifies the resistance R for voltage measurements. This syntax is equivalent to db(X,R).
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
// Convert voltage measurements to decibels
X = [1, 2; 3, 4] // Voltage measurements
SignalType = 'voltage'
R = 2 // Resistance in ohms
dboutput = db(X, SignalType, R)

   ]]></programlisting>
</refsection>

<refsection>
   <title>Authors</title>
   <simplelist type="vert">
   <member>Pratik Kapoor</member>
   </simplelist>
</refsection>
</refentry>
