<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2000 - 2016 - INRIA - Serge Steer <serge.steer@inria.fr>
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook"  xmlns:scilab="http://www.scilab.org"
          xml:lang="en" xml:id="freson">
    <refnamediv>
        <refname>freson</refname>
        <refpurpose>peak frequencies</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>fr = freson(h)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>h</term>
                <listitem>
                    <para>
                        A siso linear dynamical system, in state space, transfer function or zpk representations.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>fr</term>
                <listitem>
                    <para>vector of peak frequencies in Hz</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            returns the vector frequencies at which the response
            amplitude of a siso dynamical system is a relative maximum
            also called resonance frequencies.

        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <para>Continuous time system</para>
        <programlisting role="example"><![CDATA[
h = syslin('c',-1+%s,(3+2*%s+%s^2)*(50+0.1*%s+%s^2));
fr = freson(h)
clf
bode(h);
fig=gcf();sca(fig.children(2));
[phi,db] = phasemag(repfreq(h,fr));
plot(fr,db(:),'+r')
]]></programlisting>
        <scilab:image localized="true">
            h=syslin('c',-1+%s,(3+2*%s+%s^2)*(50+0.1*%s+%s^2));
            fr=freson(h)
            clf;bode(h);
            fig=gcf();sca(fig.children(2));
            [phi,db]=phasemag(repfreq(h,fr));
            plot(fr,db(:),'+r');
        </scilab:image>
        <para>Discrete time system</para>
        <programlisting role="example"><![CDATA[
h = syslin('c',-1+%s,(3+2*%s+%s^2)*(50+0.1*%s+%s^2));
hd = dscr(h, 0.05);
fr = freson(hd)
clf
bode(hd);
fig=gcf();sca(fig.children(2));
[phi,db] = phasemag(repfreq(hd,fr));
plot(fr,db(:),'+r');
 ]]></programlisting>
        <scilab:image localized="true">
            h=syslin('c',-1+%s,(3+2*%s+%s^2)*(50+0.1*%s+%s^2));
            hd=dscr(h,0.05);
            fr=freson(hd);
            clf;bode(hd);
            fig=gcf();sca(fig.children(2));
            [phi,db]=phasemag(repfreq(hd,fr));
            plot(fr,db(:),'+r');
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="frep2tf">frep2tf</link>
            </member>
            <member>
                <link linkend="zgrid">zgrid</link>
            </member>
            <member>
                <link linkend="h_norm">h_norm</link>
            </member>
        </simplelist>
    </refsection>
    <refsection role="history">
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>6.0</revnumber>
                <revdescription>
                    <para>handling discrete systems and zpk
                        representation, peak detection improved.
                    </para>
                </revdescription>
            </revision>
        </revhistory>
    </refsection>
</refentry>
