<?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="friedman" 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>friedman</refname>
    <refpurpose>FRIEDMAN Instantaneous frequency density</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>Calling Sequence</title>
    <synopsis>
      TIFD = friedman(TFR, HAT
      TIFD = friedman(TFR, HAT, T
      TIFD = friedman(TFR, HAT, T, METHOD)
      TIFD = friedman(TFR, HAT, T, METHOD, TRACE)
      TIFD = friedman(...,'plot')
    </synopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Parameters</title>
    <variablelist>
      <varlistentry>
        <term>	TFR   :</term>
        <listitem>
          <para>a N by M matrix: the time-frequency representation.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>HAT   :</term>
        <listitem>
          <para>a N by M matrix: then complex matrix of the reassignment vectors.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>T:</term>
        <listitem>
          <para>a vector of positive integer values: the time instant(s) (default : (1:M)).</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>	METHOD:</term>
        <listitem>
          <para>a character string: the chosen representation for plotting (default : 'tfrrsp').</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>'plot':</term> 
        <listitem>
          <para> if the last input parameter value is
          'plot', <link linkend="tfrqview">tfrqview</link> is called and
          the time-frequency representation will be plotted.</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>	TIFD  :</term>
        <listitem>
          <para>a real N by M matrix: the time instantaneous-frequency density.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>

  <refsection>
    <title>Description</title>
    <para>
      computes the time-instantaneous frequency density (defined by Friedman [1])
      of a reassigned time-frequency representation.
    </para>
    <para>
      WARNING : TIFD is not an energy distribution, but an estimated
      probability distribution !
    </para>
  </refsection>

  <refsection>
    <title>Examples</title>
    <programlisting role="example"><![CDATA[
    sig = fmlin(128,0.1,0.4); 
    h = window('kr',47,3*%pi);
    t = 1:2:127; 
    [tfr,rtfr,hat] = tfrrpwv(sig,t,128,h);
    tfid = friedman(tfr,hat,t);
    clf; gcf().color_map = jetcolormap(128);
    grayplot(t,linspace(0,0.5,128),tfid')
    ]]></programlisting>
    <scilab:image><![CDATA[
    sig=fmlin(128,0.1,0.4); 
    h=window('kr',47,3*%pi);
    t=1:2:127; 
    [tfr,rtfr,hat]=tfrrpwv(sig,t,128,h);
    tfid = friedman(tfr,hat,t);
    clf;gcf().color_map= jetcolormap(128);
    grayplot(t,linspace(0,0.5,128),tfid')
    ]]></scilab:image>
  </refsection>

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

  <refsection>
    <title>Authors</title>
    <simplelist type="vert">
      <member>H. Nahrstaedt - Aug 2010</member>
      <member>F. Auger, August 1994, Decembre 1995.</member>
    </simplelist>
  </refsection>
</refentry>
