<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the Scilab time frequency toolbox.
This file must be used under the terms of the  terms of the GNU General Public License 
as published by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Copyright (c) 1996 by CNRS (France)
-->


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

  <refnamediv>
    <refname>frpowerspec</refname>
	<refpurpose>Computes the energy spectrum of the signal</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>Calling Sequence</title>
    <synopsis>
      [SP,F] = frpowerspec(X)
      [SP,F] = frpowerspec(X, N)
      [SP,F] = frpowerspec(X, N, H)
      [SP,F] = frpowerspec(...,'plot')
    </synopsis>
  </refsynopsisdiv>


  <refsection>
    <title>Parameters</title>
    <variablelist>
      <varlistentry>
        <term>X :</term>
        <listitem>
          <para> A Nx elements real vector : the signal in time to be analysed.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term> N:</term> 
        <listitem>
          <para> a positive integer: the number of frequency bins
          (default:Nx). For faster computation N should be a power of
          2.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term> H :</term> 
        <listitem>
          <para> real Nx elements vector: the analysis
          window,(default: window("re",Nx)).</para>
          
        </listitem>
      </varlistentry>
      
      <varlistentry>
        <term> TRACE :</term> 
        <listitem>
          <para>A boolean (or a real scalar) if true (or nonzero),the
          progression of the algorithm is shown (default : %f).</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>'plot':</term> <listitem><para> if one input parameter is
        'plot', <link linkend="tfrqview">tfrqview</link> is called and
        the time-frequency representation will be plotted.</para>
      </listitem>
      </varlistentry>
      <varlistentry>
        <term>SP :</term> 
        <listitem>
          <para> A real column vector of size N: the energy spectrum of the signal.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term> F :</term> 
        <listitem>
          <para> A real column vector of size N: the normalized frequencies.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>

  <refsection>
    <title>Examples</title>
    <programlisting role="example"><![CDATA[
    sig = fmlin(128,0.1,0.4);
    [SP,F] = frpowerspec(sig);
    clf; plot(F,SP)
    xlabel(_("Normalized frequency"));
    ylabel(_("Energy spectrum"));
    ]]></programlisting>
    <scilab:image><![CDATA[
    sig=fmlin(128,0.1,0.4);
    [SP,F]=frpowerspec(sig);
    clf;plot(F,SP)
    xlabel(_("Normalized frequency"));
    ylabel(_("Energy spectrum"));
    ]]></scilab:image>
  </refsection>
  <refsection role="see also">
    <title>See also</title>
    <simplelist type="inline">
       <member><link linkend="cspect">cspect</link></member>
       <member><link linkend="pspect">pspect</link></member>
	</simplelist>
  </refsection>
  <refsection>
    <title>Authors</title>
    <simplelist type="vert">
      <member>H. Nahrstaedt - Aug 2010	</member>
    </simplelist>
  </refsection>
</refentry>
