* Bug 16005 fixed [doc]: intdec() example was biased & not robust 11/20911/2
Samuel GOUGEON [Fri, 29 Mar 2019 17:52:16 +0000 (18:52 +0100)]
  http://bugzilla.scilab.org/16005

Change-Id: I4ce1a11ce6f0d78e0c9fa10766c58d04c440c141

scilab/CHANGES.md
scilab/modules/helptools/etc/images_md5.txt
scilab/modules/helptools/images/intdec_1.png
scilab/modules/signal_processing/help/en_US/intdec.xml
scilab/modules/signal_processing/help/ja_JP/intdec.xml

index 9811c9d..f510352 100644 (file)
@@ -148,4 +148,4 @@ Bug Fixes
 * [#15425](http://bugzilla.scilab.org/show_bug.cgi?id=15425): The Kronecker product `a.*.b` failed when `a` or `b` or both are hypermatrices, with one or both being polynomials or rationals.
 * [#15523](http://bugzilla.scilab.org/show_bug.cgi?id=15523): `%ODEOPTIONS(1)=2` didn't work with solvers 'rk' and 'rkf' 
 * [#15577](http://bugzilla.scilab.org/show_bug.cgi?id=15577): `edit` did not accept a line number as text, as with `edit linspace 21`.
-
+* [#16005](http://bugzilla.scilab.org/show_bug.cgi?id=16005): The `intdec` example was biased and not robust when changing sampling frequencies.
index d65ca06..455e283 100644 (file)
@@ -778,7 +778,7 @@ householder_1.png=8a7bce8cfadfbf5d70436734b66ec20d
 hsv2rgb_1.png=7d20c259e94301d9763fbddb7bff4784\r
 hsvcolormap_1.png=11918d88bcc793200af0b9f1b58b0554\r
 iir_1.png=e675c2755f68ddc4611c849895b63012\r
-intdec_1.png=d3d3cbde187a5f74a07b3d5611e66257\r
+intdec_1.png=da3896e7d2e8468dd33edf57ccbe4480\r
 interp1_1.png=0e9a3f4319b2818ce4921b9bc3008d80\r
 interp2d_1.png=f4af61bc3faf493d778169ec7decc7ae\r
 interp2d_2.png=a62363849a3a9a3571dc1942fcebfbd3\r
index 3da3dbc..0b15a53 100644 (file)
Binary files a/scilab/modules/helptools/images/intdec_1.png and b/scilab/modules/helptools/images/intdec_1.png differ
index 4bc0cf1..164391a 100644 (file)
     <refsection>
         <title>Examples</title>
         <programlisting role="example"><![CDATA[
-Fs1 = 10000;               // initial sampling frequency
-Fs2 = 14000;               // targeted resampling frequency
-t1 = (0:1/Fs1:5)';
-t2 = (0:1/Fs2:5)';
+Fs1 = 1000;               // initial sampling frequency
+Fs2 = 1400;               // targeted resampling frequency
+t1 = linspace(0, 5-1/Fs1, Fs1*5)';
+t2 = linspace(0, 5-1/Fs2, Fs2*5)';
 F0 = 2;                    // Signal frequency
 u1 = sin(2*%pi*F0*t1);
 u2 = sin(2*%pi*F0*t2);     // Direct sampling at targeted frequency (as reference)
 u2b = intdec(u1, Fs2/Fs1); // Resampled signal
 clf
-plot(t2,u2,"b", t2,(u2b-u2)*1000, "r");
-legend("Direct highly sampled u2","(resampled_u1 - u2) x 1000","in_upper_left");
+plot(t2,u2,"b", t2,(u2b-u2)*1e13, "m");
+legend("Direct highly sampled u2","Resampling_error x 1e13","in_upper_left");
  ]]></programlisting>
         <scilab:image>
-          Fs1 = 10000;               // initial sampling frequency
-          Fs2 = 14000;               // targeted resampling frequency
-          t1 = (0:1/Fs1:5)';
-          t2 = (0:1/Fs2:5)';
-          F0 = 2;                    // Signal frequency
-          u1 = sin(2*%pi*F0*t1);
-          u2 = sin(2*%pi*F0*t2);     // Direct sampling at targeted frequency (as reference)
-          u2b = intdec(u1, Fs2/Fs1); // Resampled signal
-          clf
-          plot(t2,u2,"b", t2,(u2b-u2)*1000, "r");
-          legend("Direct highly sampled u2","(resampled_u1 - u2) x 1000","in_upper_left");
+            Fs1 = 1000;               // initial sampling frequency
+            Fs2 = 1400;               // targeted resampling frequency
+            t1 = linspace(0, 5-1/Fs1, Fs1*5)';
+            t2 = linspace(0, 5-1/Fs2, Fs2*5)';
+            F0 = 2;                    // Signal frequency
+            u1 = sin(2*%pi*F0*t1);
+            u2 = sin(2*%pi*F0*t2);     // Direct sampling at targeted frequency (as reference)
+            u2b = intdec(u1, Fs2/Fs1); // Resampled signal
+            clf
+            plot(t2,u2,"b", t2,(u2b-u2)*1e13, "m");
+            legend("Direct highly sampled u2","Resampling_error x 1e13","in_upper_left");
         </scilab:image>
     </refsection>
 </refentry>
index 969a42b..1668fc3 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-
-<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="ja" xml:id="intdec">
-
+<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="ja" xml:id="intdec">
     <refnamediv>
-
         <refname>intdec</refname>
-
         <refpurpose>信号のサンプリングレートを変更</refpurpose>
-
     </refnamediv>
-
     <refsynopsisdiv>
-
         <title>呼び出し手順</title>
-
         <synopsis>[y]=intdec(x,lom)</synopsis>
-
     </refsynopsisdiv>
-
     <refsection>
-
         <title>引数</title>
-
         <variablelist>
-
             <varlistentry>
-
                 <term>x</term>
-
                 <listitem>
-
                     <para>入力標本信号</para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>lom</term>
-
                 <listitem>
-
                     <para>1次元信号の場合, 変更するレートを指定するスカラー値です.
-
                         2次元信号の場合,
-
                         変更する
-
                         サンプリングレートのベクトル(要素数:2)
-
                         <literal>lom</literal>=(列方向の変更レート,行方向の変更レート) です.
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>y</term>
-
                 <listitem>
-
                     <para>出力標本信号</para>
-
                 </listitem>
-
             </varlistentry>
-
         </variablelist>
-
     </refsection>
-
     <refsection>
-
         <title>説明</title>
-
         <para>
-
             1次元または2次元信号のサンプリングレートをlomで指定された
-
             レートに変更します.
-
         </para>
-
     </refsection>
-
     <refsection>
-
         <title>例</title>
-
         <programlisting role="example"><![CDATA[
-Fs1 = 10000;               // initial sampling frequency
-Fs2 = 14000;               // targeted resampling frequency
-t1 = (0:1/Fs1:5)';
-t2 = (0:1/Fs2:5)';
+Fs1 = 1000;               // initial sampling frequency
+Fs2 = 1400;               // targeted resampling frequency
+t1 = linspace(0, 5-1/Fs1, Fs1*5)';
+t2 = linspace(0, 5-1/Fs2, Fs2*5)';
 F0 = 2;                    // Signal frequency
 u1 = sin(2*%pi*F0*t1);
 u2 = sin(2*%pi*F0*t2);     // Direct sampling at targeted frequency (as reference)
 u2b = intdec(u1, Fs2/Fs1); // Resampled signal
 clf
-plot(t2,u2,"b", t2,(u2b-u2)*1000, "r");
-legend("Direct highly sampled u2","(resampled_u1 - u2) x 1000","in_upper_left");
+plot(t2,u2,"b", t2,(u2b-u2)*1e13, "m");
+legend("Direct highly sampled u2","Resampling_error x 1e13","in_upper_left");
  ]]></programlisting>
         <scilab:image>
-          Fs1 = 10000;               // initial sampling frequency
-          Fs2 = 14000;               // targeted resampling frequency
-          t1 = (0:1/Fs1:5)';
-          t2 = (0:1/Fs2:5)';
-          F0 = 2;                    // Signal frequency
-          u1 = sin(2*%pi*F0*t1);
-          u2 = sin(2*%pi*F0*t2);     // Direct sampling at targeted frequency (as reference)
-          u2b = intdec(u1, Fs2/Fs1); // Resampled signal
-          clf
-          plot(t2,u2,"b", t2,(u2b-u2)*1000, "r");
-          legend("Direct highly sampled u2","(resampled_u1 - u2) x 1000","in_upper_left");
+            Fs1 = 1000;               // initial sampling frequency
+            Fs2 = 1400;               // targeted resampling frequency
+            t1 = linspace(0, 5-1/Fs1, Fs1*5)';
+            t2 = linspace(0, 5-1/Fs2, Fs2*5)';
+            F0 = 2;                    // Signal frequency
+            u1 = sin(2*%pi*F0*t1);
+            u2 = sin(2*%pi*F0*t2);     // Direct sampling at targeted frequency (as reference)
+            u2b = intdec(u1, Fs2/Fs1); // Resampled signal
+            clf
+            plot(t2,u2,"b", t2,(u2b-u2)*1e13, "m");
+            legend("Direct highly sampled u2","Resampling_error x 1e13","in_upper_left");
         </scilab:image>
-
     </refsection>
-
-</refentry>
-
+</refentry>
\ No newline at end of file