* Bug #11668 fixed - Help page of rpem had no example. 48/10948/2
Charlotte HECQUET [Fri, 22 Mar 2013 09:55:47 +0000 (10:55 +0100)]
Change-Id: Ie30458998a337e8a93f07c435b18315fbb99ad1f

scilab/CHANGES_5.4.X
scilab/modules/helptools/etc/images_md5.txt
scilab/modules/helptools/images/rpem_1.png [new file with mode: 0644]
scilab/modules/signal_processing/help/en_US/identification/rpem.xml

index 2cdd96c..88bf180 100644 (file)
@@ -341,6 +341,8 @@ Bug fixes
 
 * Bug #11665 fixed - Help page of lindquist had no example.
 
+* Bug #11668 fixed - Help page of rpem had no example.
+
 * Bug #11669 fixed - Help page of kalm and srkf functions had no example.
 
 * Bug #11682 fixed - "resizefcn" and "closerequestfcn" properties description
index aaf1b4d..7e262c5 100644 (file)
@@ -915,6 +915,7 @@ remezb_1.png=17a8eb044482a1871bede91c36eddf0f
 replot_1.png=d9ab231632d9298a6f87718df49ce8ae
 replot_2.png=2bbd8e5516bcfba00fb343eff77b4736
 rotate_1.png=df252732000d1c17d23c04e038b1b0f3
+rpem_1.png=c1cf0dd9f14c3cb03980fb982d917b38
 sca_1.png=26a128db93d82d857191be51313e1d87
 sec_1.png=4eff2516ae7932bb126b6e2fa133f046
 sech_1.png=62b827923764aaaf8ce355b0256bef3b
diff --git a/scilab/modules/helptools/images/rpem_1.png b/scilab/modules/helptools/images/rpem_1.png
new file mode 100644 (file)
index 0000000..95ab77e
Binary files /dev/null and b/scilab/modules/helptools/images/rpem_1.png differ
index 967233a..0ce3455 100644 (file)
@@ -181,4 +181,120 @@ b(1)*u(t-1)+...+b(n)*u(t-n)+e(t)+c(1)*e(t-1)+...+c(n)*e(t-n)
             <literal>a=[a(1),...,a(n)], b=[b(1),...,b(n)], c=[c(1),...,c(n)]</literal>.
         </para>
     </refsection>
+    <refsection>
+        <title>Example</title>
+        <programlisting role="Example"><![CDATA[
+nbPoints = 500; // Number of points computed
+
+// Real parameters a,b,c: here, y=u
+a=cat(2,1,zeros(1,nbPoints - 1));
+b=cat(2,1,zeros(1,nbPoints - 1));
+c=zeros(1,nbPoints);
+
+// Generate input signal
+t=linspace(0,50,1000);
+w=%pi/4;
+u=cos(w*t);
+
+// Generate output signal
+Arma=armac(a,b,c,1,1,0);
+y=arsimul(Arma,u);
+
+f1=figure("figure_name","figure1","backgroundColor",[1 1 1]);
+subplot(3,1,1);
+plot(t, u, "b+");
+xtitle("Input");
+subplot(3,1,2);
+plot(t, y);
+
+// Arguments of rpem
+phi=zeros(1,nbPoints*3);
+psi=zeros(1,nbPoints*3);
+l=zeros(1,nbPoints*3);
+p=1*eye(nbPoints*3,nbPoints*3);
+theta=[0*a 0*b 0*c];
+w0=list(theta,p,l,phi,psi);
+[w0, v]=rpem(w0,u,y);
+
+// Get estimated parameters:
+a_est=w0(1)(1);
+b_est=w0(1)(nbPoints + 1);
+c_est=w0(1)(2 * nbPoints + 1);
+for i=2:nbPoints
+    a_est=cat(2,a_est,w0(1)(i));
+    b_est=cat(2,b_est,w0(1)(i+nbPoints));
+    c_est=cat(2,c_est,w0(1)(i+2*nbPoints));
+end
+
+// Generate and plot output estimated
+Arma_est=armac(a_est,b_est,c_est,1,1,0);
+y_est=arsimul(Arma_est,u);
+plot(t, y_est,"color","red");
+xtitle("Real output(blue), Estimated output (red)");
+
+// Plot estimated parameters
+subplot(3,1,3);
+xtitle("a,b,c estimated");
+plot(a_est(1,:),"color","red");
+plot(b_est(1,:),"color","green");
+plot(c_est(1,:),"color","blue");
+]]>
+        </programlisting>
+        <scilab:image>
+nbPoints = 500; // Number of points computed
+
+// Real parameters a,b,c: here, y=u
+a=cat(2,1,zeros(1,nbPoints - 1));
+b=cat(2,1,zeros(1,nbPoints - 1));
+c=zeros(1,nbPoints);
+
+// Generate input signal
+t=linspace(0,50,1000);
+w=%pi/4;
+u=cos(w*t);
+
+// Generate output signal
+Arma=armac(a,b,c,1,1,0);
+y=arsimul(Arma,u);
+
+f1=figure("figure_name","figure1","backgroundColor",[1 1 1]);
+subplot(3,1,1);
+plot(t, u, "b+");
+xtitle("Input");
+subplot(3,1,2);
+plot(t, y);
+
+// Arguments of rpem
+phi=zeros(1,nbPoints*3);
+psi=zeros(1,nbPoints*3);
+l=zeros(1,nbPoints*3);
+p=1*eye(nbPoints*3,nbPoints*3);
+theta=[0*a 0*b 0*c];
+w0=list(theta,p,l,phi,psi);
+[w0, v]=rpem(w0,u,y);
+
+// Get estimated parameters:
+a_est=w0(1)(1);
+b_est=w0(1)(nbPoints + 1);
+c_est=w0(1)(2 * nbPoints + 1);
+for i=2:nbPoints
+    a_est=cat(2,a_est,w0(1)(i));
+    b_est=cat(2,b_est,w0(1)(i+nbPoints));
+    c_est=cat(2,c_est,w0(1)(i+2*nbPoints));
+end
+
+// Generate and plot output estimated
+Arma_est=armac(a_est,b_est,c_est,1,1,0);
+y_est=arsimul(Arma_est,u);
+plot(t, y_est,"color","red");
+xtitle("Real output(blue), Estimated output (red)");
+
+// Plot estimated parameters
+subplot(3,1,3);
+xtitle("a,b,c estimated");
+plot(a_est(1,:),"color","red");
+plot(b_est(1,:),"color","green");
+plot(c_est(1,:),"color","blue");
+        </scilab:image>
+    </refsection>
 </refentry>