<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
 *
 * 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="fr" xml:id="noisegen">
    <refnamediv>
        <refname>noisegen</refname>
        <refpurpose>génération de bruit <emphasis role="bold">(obsolète)</emphasis></refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Séquence d'appel</title>
        <synopsis>b = noisegen(pas, Tmax, sig)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Paramètres</title>
        <variablelist>
            <varlistentry>
                <term>pas</term>
                <listitem>
                    <para>scalaire réel, le pas de temps</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>Tmax</term>
                <listitem>
                    <para>scalaire réel, le temps final de l'intervalle de génération</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>sig</term>
                <listitem>
                    <para>scalaire réel, l'écart-type du bruit</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <warning>
            <literal>noisegen()</literal> is obsolete. It will be removed from Scilab 6.1.x.
            Please use grand() instead. Examples (clearer, shorter, and more powerful) follow:
            <para/>
            <para>
            100 10-point wide steps with random amplitudes of normal distribution
            of mean 1 and standard deviation 0.7:
            </para>
            <programlisting role="example"><![CDATA[
            u = grand(1,100,"nor",1,0.7) .*. ones(1,10);
            clf, plot(u);
            ]]></programlisting>
            <para/>
            <para>
            40 15-point wide steps with random amplitudes of uniform distribution in [1 3],
            with initial level 0.5 and final level hold:
            </para>
            <programlisting role="example"><![CDATA[
            width = 15;
            u = grand(1,40, "unf", 1, 3) .*. ones(1,width);
            u = [ones(1,8*width)*0.5, u, ones(1,5*width)*u($)];
            clf, plot(u);
            ]]></programlisting>
        </warning>
        <para>
            <literal>noisegen()</literal> génère une fonction Scilab <literal>b = Noise(t)</literal>
            où <literal>Noise(t)</literal> est une fonction constante par morceaux
            (constante sur <literal>[k*pas, (k+1)*pas]</literal>). Les valeurs de chaque intervalle
            constant sont aléatoires, i.i.d Gaussiennes à écart-type <literal>sig</literal>.
            La fonction est constante pour <literal>t &lt;= 0</literal> et
            <literal>t &gt;= Tmax</literal>.
        </para>
        <para>
            <note>
                Remarque: des fonctions de génération aléatoires telles que <link linkend="rand">rand</link> et
                <link linkend="grand">grand</link> sont une alternative à la génération de bruit
                contenant un large panel de lois de distribution (voir exemple 2 ci-dessous).
            </note>
        </para>
    </refsection>
    <refsection>
        <title>Exemples</title>
        <para>
            Exemple #1: noisegen()
        </para>
        <programlisting role="example"><![CDATA[
noisegen(0.5, 30, 1.0);
x = -5:0.01:35;
y = feval(x, Noise);
plot(x, y);
 ]]></programlisting>
        <scilab:image>
            noisegen(0.5, 30, 1.0);
            x = -5:0.01:35;
            y = feval(x, Noise);
            plot(x, y);
        </scilab:image>
        <para>
            Exemple #2: rand()
        </para>
        <programlisting role="example"><![CDATA[
// Tracer un bruit blanc gaussien de moyenne nulle à variance 1.
// Pour utiliser une variance différente, multiplier rand() par la racine carrée de la variance.
t = 0:.5:30;
sig = 1; // Ecart-type du bruit blanc gaussien.
noise = sig*rand(t, "normal");
plot2d2(t, noise);
 ]]></programlisting>
        <scilab:image>
            t = 0:.5:30;
            sig = 1;
            noise = sig*rand(t, "normal");
            plot2d2(t, noise)
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>Vori aussi</title>
        <simplelist type="inline">
            <member>
                <link linkend="rand">rand</link>
            </member>
            <member>
                <link linkend="grand">grand</link>
            </member>
        </simplelist>
    </refsection>
    <refsection role="history">
        <title>Historique</title>
        <revhistory>
            <revision>
                <revnumber>6.1.0</revnumber>
                <revdescription>
                    noisegen() is obsolete. It will be removed from Scilab 6.1.x.
                    Please replace it with grand() and .*.
                </revdescription>
            </revision>
        </revhistory>
    </refsection>
</refentry>
