* Bug #11670 to 11676 fixed - Add examples in the signal processing help pages. 62/8562/3
Sylvestre Ledru [Mon, 6 Aug 2012 11:59:23 +0000 (13:59 +0200)]
Change-Id: I75dbe3399a94612271c65c85a956056d180b6f42

scilab/CHANGES_5.4.X
scilab/modules/signal_processing/help/en_US/mese.xml
scilab/modules/signal_processing/help/en_US/mfft.xml
scilab/modules/signal_processing/help/en_US/sskf.xml
scilab/modules/signal_processing/help/en_US/system.xml
scilab/modules/signal_processing/help/en_US/wfir.xml
scilab/modules/signal_processing/help/en_US/wiener.xml
scilab/modules/signal_processing/help/en_US/wigner.xml
scilab/modules/signal_processing/help/en_US/zpbutt.xml
scilab/modules/signal_processing/help/en_US/zpch1.xml
scilab/modules/signal_processing/help/en_US/zpch2.xml

index 0d8cd42..93c3d19 100644 (file)
@@ -66,6 +66,7 @@ Bug Fixes
 
 * Bug #11659 fixed - twinkle displayed warning messages about show_pixmap function.
 
+* Bugs #11666, #11667 and #11670 to 11676 fixed - Add examples in the signal processing help pages. 
 
             Changes between version 5.4.0-beta-1 and 5.4.0-beta-2 of Scilab
             ===============================================================
index f8b0648..2d0a3f4 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" version="5.0-subset Scilab" xml:lang="en" xml:id="mese">
-  <refnamediv>
-    <refname>mese</refname>
-    <refpurpose> maximum entropy spectral estimation</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>[sm,fr]=mese(x [,npts]);</synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>x</term>
-        <listitem>
-          <para>Input sampled data sequence</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>npts</term>
-        <listitem>
-          <para>
-            Optional parameter giving number of points of <literal>fr</literal> and <literal>sm</literal> (default is 256)
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>sm</term>
-        <listitem>
-          <para>
-            Samples of spectral estimate on the frequency grid <literal>fr</literal>
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>fr</term>
-        <listitem>
-          <para>
-            npts equally spaced frequency samples in <literal>[0,.5)</literal>
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      Calculate the maximum entropy spectral estimate of <literal>x</literal>
-    </para>
-  </refsection>
+<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" version="5.0-subset Scilab" xml:lang="en" xml:id="mese">
+    <refnamediv>
+        <refname>mese</refname>
+        <refpurpose> maximum entropy spectral estimation</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>[sm,fr]=mese(x [,npts]);</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>x</term>
+                <listitem>
+                    <para>Input sampled data sequence</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>npts</term>
+                <listitem>
+                    <para>
+                        Optional parameter giving number of points of <literal>fr</literal> and <literal>sm</literal> (default is 256)
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>sm</term>
+                <listitem>
+                    <para>
+                        Samples of spectral estimate on the frequency grid <literal>fr</literal>
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>fr</term>
+                <listitem>
+                    <para>
+                        npts equally spaced frequency samples in <literal>[0,.5)</literal>
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            Calculate the maximum entropy spectral estimate of <literal>x</literal>
+        </para>
+    </refsection>
+    <refsection>
+        <title>Sample</title>
+        <scilab:image>
+            rand("seed",12345),
+            y = (0:10);
+            x1 = sin(2*%pi*y/20);
+            x2 = sin(3.5*%pi*y/20);
+            w = .4*(rand(y)-.5*ones(y));
+            x = x1+2*x2+w;
+            [sm,fr1] = mese(x,10)
+            function [xm,fr] = bt(x)
+            xsize = max(size(x))
+            [xf,fr] = frmag(x,256)
+            xm = xf.*conj(xf)/xsize
+            endfunction
+            [xm,fr] = bt(x);
+            scf();
+            subplot(3,1,1);
+            plot(x);
+            subplot(3,1,2);
+            plot(fr1,sm)
+            subplot(3,1,3);
+            plot(fr,xm)
+        </scilab:image>
+    </refsection>
+    
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+rand("seed",12345),
+y = (0:10);
+x1 = sin(2*%pi*y/20);
+x2 = sin(3.5*%pi*y/20);
+w = .4*(rand(y)-.5*ones(y));
+x = x1+2*x2+w;
+[sm,fr1] = mese(x,10)
+// Define macro which computes the 
+// Blackman-Tukey periodogram
+function [xm,fr] = bt(x)
+  xsize = max(size(x))
+  [xf,fr] = frmag(x,256)
+  xm = xf.*conj(xf)/xsize
+endfunction
+[xm,fr] = bt(x);
+scf();
+subplot(3,1,1);
+plot(x);
+subplot(3,1,2);
+plot(fr1,sm)
+subplot(3,1,3);
+plot(fr,xm)
+ ]]></programlisting>
+    </refsection>
 </refentry>
index a2bb2a1..e421d6b 100644 (file)
@@ -1,60 +1,60 @@
 <?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" version="5.0-subset Scilab" xml:lang="en" xml:id="mfft">
-  <refnamediv>
-    <refname>mfft</refname>
-    <refpurpose> multi-dimensional fft</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>[xk]=mfft(x,flag,dim)</synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>x</term>
-        <listitem>
-          <para>
-            <literal>x(i,j,k,...)</literal> input signal in the form of a row vector whose values are arranged so that the i index runs the quickest, followed by the j index, etc.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>flag</term>
-        <listitem>
-          <para>(-1) FFT or (1) inverse FFT</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>dim</term>
-        <listitem>
-          <para>
-            dimension vector which gives the number of values of <literal>x</literal> for each of its indices
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>xk</term>
-        <listitem>
-          <para>
-            output of multidimensional fft in same format as for <literal>x</literal>
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      FFT for a multi-dimensional signal
-    </para>
-    <para>
-      For example for a three dimensional vector which has three points
-      along its first dimension, two points along its second
-      dimension and three points along its third dimension the row
-      vector is arranged as follows
-    </para>
-    <programlisting role=""><![CDATA[ 
+    <refnamediv>
+        <refname>mfft</refname>
+        <refpurpose> multi-dimensional fft</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>[xk]=mfft(x,flag,dim)</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>x</term>
+                <listitem>
+                    <para>
+                        <literal>x(i,j,k,...)</literal> input signal in the form of a row vector whose values are arranged so that the i index runs the quickest, followed by the j index, etc.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>flag</term>
+                <listitem>
+                    <para>(-1) FFT or (1) inverse FFT</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>dim</term>
+                <listitem>
+                    <para>
+                        dimension vector which gives the number of values of <literal>x</literal> for each of its indices
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>xk</term>
+                <listitem>
+                    <para>
+                        output of multidimensional fft in same format as for <literal>x</literal>
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            FFT for a multi-dimensional signal
+        </para>
+        <para>
+            For example for a three dimensional vector which has three points
+            along its first dimension, two points along its second
+            dimension and three points along its third dimension the row
+            vector is arranged as follows
+        </para>
+        <programlisting role="no-scilab-exec"><![CDATA[ 
 x=[x(1,1,1),x(2,1,1),x(3,1,1),
    x(1,2,1),x(2,2,1),x(3,2,1),
    x(1,1,2),x(2,1,2),x(3,1,2),
@@ -62,8 +62,18 @@ x=[x(1,1,1),x(2,1,1),x(3,1,1),
    x(1,1,3),x(2,1,3),x(3,1,3),
    x(1,2,3),x(2,2,3),x(3,2,3)]
  ]]></programlisting>
-    <para>
-      and the <literal>dim</literal> vector is: <literal>dim=[3,2,3]</literal>
-    </para>
-  </refsection>
+        <para>
+            and the <literal>dim</literal> vector is: <literal>dim=[3,2,3]</literal>
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+y1=matrix(1:6,2,3)
+y2=matrix(7:12,2,3)
+y=matrix([y1,y2],1,12)
+yf=mfft(y,-1,[2 3 2])
+ ]]></programlisting>
+    </refsection>
+    
 </refentry>
index d351938..cbfa2cf 100644 (file)
@@ -1,72 +1,92 @@
 <?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" version="5.0-subset Scilab" xml:lang="en" xml:id="sskf">
-  <refnamediv>
-    <refname>sskf</refname>
-    <refpurpose> steady-state Kalman filter</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>[xe,pe]=sskf(y,f,h,q,r,x0)</synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>y</term>
-        <listitem>
-          <para>
-            data in form <literal>[y0,y1,...,yn]</literal>, <literal>yk</literal> a column vector
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>f</term>
-        <listitem>
-          <para>system matrix dim(NxN)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>h</term>
-        <listitem>
-          <para>observations matrix dim(MxN)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>q</term>
-        <listitem>
-          <para>dynamics noise matrix dim(NxN)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>r</term>
-        <listitem>
-          <para>observations noise matrix dim(MxM)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>x0</term>
-        <listitem>
-          <para>initial state estimate</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>xe</term>
-        <listitem>
-          <para>estimated state</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>pe</term>
-        <listitem>
-          <para>steady-state error covariance</para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      steady-state Kalman filter
-    </para>
-  </refsection>
+    <refnamediv>
+        <refname>sskf</refname>
+        <refpurpose> steady-state Kalman filter</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>[xe,pe]=sskf(y,f,h,q,r,x0)</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>y</term>
+                <listitem>
+                    <para>
+                        data in form <literal>[y0,y1,...,yn]</literal>, <literal>yk</literal> a column vector
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>f</term>
+                <listitem>
+                    <para>system matrix dim(NxN)</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>h</term>
+                <listitem>
+                    <para>observations matrix dim(MxN)</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>q</term>
+                <listitem>
+                    <para>dynamics noise matrix dim(NxN)</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>r</term>
+                <listitem>
+                    <para>observations noise matrix dim(MxM)</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>x0</term>
+                <listitem>
+                    <para>initial state estimate</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>xe</term>
+                <listitem>
+                    <para>estimated state</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>pe</term>
+                <listitem>
+                    <para>steady-state error covariance</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            steady-state Kalman filter
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+rand("seed",5);
+rand("normal");
+q=[.03 0.01;.01 0.03];
+u=rand(2,11);
+f=[1.1 0.1;0 0.8];
+g=(chol(q))';
+m0=[10 10]';
+p0=[2 0;0 2];
+x0=m0+(chol(p0))'*rand(2,1);
+x=ltitr(f,g,u,x0);
+r=[2 0;0 2];
+v=(chol(r))'*rand(2,11);
+y=x+v;
+h=eye(2,2);
+[xe]=sskf(y,f,h,q,r,m0)
+ ]]></programlisting>
+    </refsection>
 </refentry>
index 96cc62a..340be60 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" version="5.0-subset Scilab" xml:lang="en" xml:id="system">
-  <refnamediv>
-    <refname>system</refname>
-    <refpurpose> observation update</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>[x1,y]=system(x0,f,g,h,q,r)</synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>x0</term>
-        <listitem>
-          <para>input state vector</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>f</term>
-        <listitem>
-          <para>system matrix</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>g</term>
-        <listitem>
-          <para>input matrix</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>h</term>
-        <listitem>
-          <para>Output matrix</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>q</term>
-        <listitem>
-          <para>input noise covariance matrix</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>r</term>
-        <listitem>
-          <para>output noise covariance matrix</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>x1</term>
-        <listitem>
-          <para>output state vector</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>y</term>
-        <listitem>
-          <para>output observation</para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      define system function which generates the next
-      observation given the old state.
-      System recursively calculated
-    </para>
-    <programlisting role=""><![CDATA[ 
+    <refnamediv>
+        <refname>system</refname>
+        <refpurpose> observation update</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>[x1,y]=system(x0,f,g,h,q,r)</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>x0</term>
+                <listitem>
+                    <para>input state vector</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>f</term>
+                <listitem>
+                    <para>system matrix</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>g</term>
+                <listitem>
+                    <para>input matrix</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>h</term>
+                <listitem>
+                    <para>Output matrix</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>q</term>
+                <listitem>
+                    <para>input noise covariance matrix</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>r</term>
+                <listitem>
+                    <para>output noise covariance matrix</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>x1</term>
+                <listitem>
+                    <para>output state vector</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>y</term>
+                <listitem>
+                    <para>output observation</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            define system function which generates the next
+            observation given the old state.
+            System recursively calculated
+        </para>
+        <programlisting role=""><![CDATA[ 
 x1=f*x0+g*u
 y=h*x0+v
  ]]></programlisting>
-    <para>
-      where <literal>u</literal> is distributed <literal>N(0,q)</literal>
-      and <literal>v</literal> is distribute <literal>N(0,r)</literal>.
-    </para>
-  </refsection>
+        <para>
+            where <literal>u</literal> is distributed <literal>N(0,q)</literal>
+            and <literal>v</literal> is distribute <literal>N(0,r)</literal>.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+// initialize state statistics 
+// (mean and err. variance)
+m0=[10 10]';
+p0=[2 0;0 2];
+// create system
+f=[1.1 0.1;0 0.8];
+g=[1 0;0 1];
+h=[1 0;0 1];
+// noise statistics
+q=[.03 0.01;.01 0.03];
+r=2*eye(2);
+// initialize system process
+rand("seed",2);
+rand("normal");
+p0c=chol(p0);
+x0=m0+p0c'*rand(ones(m0));
+yt=[];
+//initialize kalman filter
+xke0=m0;pk0=p0;
+// initialize err. variance
+ecv=[pk0(1,1) pk0(2,2)]';
+[x1,y]=system(x0,f,g,h,q,r)
+ ]]></programlisting>
+    </refsection>
+    
 </refentry>
index 2419b74..562e19e 100644 (file)
@@ -1,83 +1,89 @@
 <?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" version="5.0-subset Scilab" xml:lang="en" xml:id="wfir">
-  <refnamediv>
-    <refname>wfir</refname>
-    <refpurpose> linear-phase FIR filters</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>[wft,wfm,fr]=wfir(ftype,forder,cfreq,wtype,fpar)</synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>ftype</term>
-        <listitem>
-          <para>
-            string : <literal>'lp','hp','bp','sb'</literal> (filter type)
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>forder</term>
-        <listitem>
-          <para>
-            Filter order (pos integer)(odd for <literal>ftype='hp'</literal> or <literal>'sb'</literal>)
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>cfreq</term>
-        <listitem>
-          <para>
-            2-vector of cutoff frequencies (<literal>0&lt;cfreq(1),cfreq(2)&lt;.5</literal>)  only <literal>cfreq(1)</literal> is used when <literal>ftype='lp'</literal> or <literal>'hp'</literal>
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>wtype</term>
-        <listitem>
-          <para>
-            Window type (<literal>'re','tr','hm','hn','kr','ch'</literal>)
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>fpar</term>
-        <listitem>
-          <para>
-            2-vector of window parameters. Kaiser window <literal>fpar(1)&gt;0 fpar(2)=0</literal>. Chebyshev window  <literal>fpar(1)&gt;0, fpar(2)&lt;0</literal> or <literal>fpar(1)&lt;0, 0&lt;fpar(2)&lt;.5</literal>
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>wft</term>
-        <listitem>
-          <para>time domain filter coefficients</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>wfm</term>
-        <listitem>
-          <para>frequency domain filter response on the grid fr</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>fr</term>
-        <listitem>
-          <para>Frequency grid</para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      Function which makes linear-phase, FIR low-pass, band-pass,
-      high-pass, and stop-band filters
-      using the windowing technique.
-      Works interactively if called with no arguments.
-    </para>
-  </refsection>
+    <refnamediv>
+        <refname>wfir</refname>
+        <refpurpose> linear-phase FIR filters</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>[wft,wfm,fr]=wfir(ftype,forder,cfreq,wtype,fpar)</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>ftype</term>
+                <listitem>
+                    <para>
+                        string : <literal>'lp','hp','bp','sb'</literal> (filter type)
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>forder</term>
+                <listitem>
+                    <para>
+                        Filter order (pos integer)(odd for <literal>ftype='hp'</literal> or <literal>'sb'</literal>)
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>cfreq</term>
+                <listitem>
+                    <para>
+                        2-vector of cutoff frequencies (<literal>0&lt;cfreq(1),cfreq(2)&lt;.5</literal>)  only <literal>cfreq(1)</literal> is used when <literal>ftype='lp'</literal> or <literal>'hp'</literal>
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>wtype</term>
+                <listitem>
+                    <para>
+                        Window type (<literal>'re','tr','hm','hn','kr','ch'</literal>)
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>fpar</term>
+                <listitem>
+                    <para>
+                        2-vector of window parameters. Kaiser window <literal>fpar(1)&gt;0 fpar(2)=0</literal>. Chebyshev window  <literal>fpar(1)&gt;0, fpar(2)&lt;0</literal> or <literal>fpar(1)&lt;0, 0&lt;fpar(2)&lt;.5</literal>
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>wft</term>
+                <listitem>
+                    <para>time domain filter coefficients</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>wfm</term>
+                <listitem>
+                    <para>frequency domain filter response on the grid fr</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>fr</term>
+                <listitem>
+                    <para>Frequency grid</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            Function which makes linear-phase, FIR low-pass, band-pass,
+            high-pass, and stop-band filters
+            using the windowing technique.
+            Works interactively if called with no arguments.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+[h,hm,fr]=wfir("lp",33,[.2 0],"hm",[0 0])
+ ]]></programlisting>
+    </refsection>
 </refentry>
index 2963ed5..0bc6934 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" version="5.0-subset Scilab" xml:lang="en" xml:id="wiener">
-  <refnamediv>
-    <refname>wiener</refname>
-    <refpurpose>  Wiener estimate</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>[xs,ps,xf,pf]=wiener(y,x0,p0,f,g,h,q,r)</synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>f, g, h</term>
-        <listitem>
-          <para>
-            system matrices in the interval <literal>[t0,tf]</literal>
-          </para>
-          <variablelist>
+<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"  version="5.0-subset Scilab" xml:lang="en" xml:id="wiener">
+    <refnamediv>
+        <refname>wiener</refname>
+        <refpurpose>  Wiener estimate</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>[xs,ps,xf,pf]=wiener(y,x0,p0,f,g,h,q,r)</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
             <varlistentry>
-              <term>f</term>
-              <listitem>
-                <para>
-                  =<literal>[f0,f1,...,ff]</literal>, and <literal>fk</literal> is a nxn matrix
-                </para>
-              </listitem>
+                <term>f, g, h</term>
+                <listitem>
+                    <para>
+                        system matrices in the interval <literal>[t0,tf]</literal>
+                    </para>
+                    <variablelist>
+                        <varlistentry>
+                            <term>f</term>
+                            <listitem>
+                                <para>
+                                    =<literal>[f0,f1,...,ff]</literal>, and <literal>fk</literal> is a nxn matrix
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>g</term>
+                            <listitem>
+                                <para>
+                                    =<literal>[g0,g1,...,gf]</literal>, and <literal>gk</literal> is a nxn matrix
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>h</term>
+                            <listitem>
+                                <para>
+                                    =<literal>[h0,h1,...,hf]</literal>, and <literal>hk</literal> is a mxn matrix
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                </listitem>
             </varlistentry>
             <varlistentry>
-              <term>g</term>
-              <listitem>
-                <para>
-                  =<literal>[g0,g1,...,gf]</literal>, and <literal>gk</literal> is a nxn matrix
-                </para>
-              </listitem>
+                <term>q, r</term>
+                <listitem>
+                    <para>covariance matrices of dynamics and observation noise</para>
+                    <variablelist>
+                        <varlistentry>
+                            <term>q</term>
+                            <listitem>
+                                <para>
+                                    =<literal>[q0,q1,...,qf]</literal>, and <literal>qk</literal> is a nxn matrix
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>r</term>
+                            <listitem>
+                                <para>
+                                    =<literal>[r0,r1,...,rf]</literal>, and <literal>gk</literal> is a mxm matrix
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                </listitem>
             </varlistentry>
             <varlistentry>
-              <term>h</term>
-              <listitem>
-                <para>
-                  =<literal>[h0,h1,...,hf]</literal>, and <literal>hk</literal> is a mxn matrix
-                </para>
-              </listitem>
+                <term>x0, p0</term>
+                <listitem>
+                    <para>initial state estimate and error variance</para>
+                </listitem>
             </varlistentry>
-          </variablelist>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>q, r</term>
-        <listitem>
-          <para>covariance matrices of dynamics and observation noise</para>
-          <variablelist>
             <varlistentry>
-              <term>q</term>
-              <listitem>
-                <para>
-                  =<literal>[q0,q1,...,qf]</literal>, and <literal>qk</literal> is a nxn matrix
-                </para>
-              </listitem>
+                <term>y</term>
+                <listitem>
+                    <para>
+                        observations in the interval <literal>[t0,tf]</literal>. <literal>y=[y0,y1,...,yf]</literal>, and <literal>yk</literal> is a column m-vector
+                    </para>
+                </listitem>
             </varlistentry>
             <varlistentry>
-              <term>r</term>
-              <listitem>
-                <para>
-                  =<literal>[r0,r1,...,rf]</literal>, and <literal>gk</literal> is a mxm matrix
-                </para>
-              </listitem>
+                <term>xs</term>
+                <listitem>
+                    <para>
+                        Smoothed state estimate <literal>xs= [xs0,xs1,...,xsf]</literal>, and <literal>xsk</literal> is a column n-vector
+                    </para>
+                </listitem>
             </varlistentry>
-          </variablelist>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>x0, p0</term>
-        <listitem>
-          <para>initial state estimate and error variance</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>y</term>
-        <listitem>
-          <para>
-            observations in the interval <literal>[t0,tf]</literal>. <literal>y=[y0,y1,...,yf]</literal>, and <literal>yk</literal> is a column m-vector
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>xs</term>
-        <listitem>
-          <para>
-            Smoothed state estimate <literal>xs= [xs0,xs1,...,xsf]</literal>, and <literal>xsk</literal> is a column n-vector
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>ps</term>
-        <listitem>
-          <para>
-            Error covariance of smoothed estimate <literal>ps=[p0,p1,...,pf]</literal>, and <literal>pk</literal> is a nxn matrix
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>xf</term>
-        <listitem>
-          <para>
-            Filtered state estimate <literal>xf= [xf0,xf1,...,xff]</literal>, and <literal>xfk</literal> is a column n-vector
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>pf</term>
-        <listitem>
-          <para>
-            Error covariance of filtered estimate <literal>pf=[p0,p1,...,pf]</literal>, and <literal>pk</literal> is a nxn matrix
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      function which gives the Wiener estimate using
-      the forward-backward Kalman filter formulation
-    </para>
-  </refsection>
+            <varlistentry>
+                <term>ps</term>
+                <listitem>
+                    <para>
+                        Error covariance of smoothed estimate <literal>ps=[p0,p1,...,pf]</literal>, and <literal>pk</literal> is a nxn matrix
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>xf</term>
+                <listitem>
+                    <para>
+                        Filtered state estimate <literal>xf= [xf0,xf1,...,xff]</literal>, and <literal>xfk</literal> is a column n-vector
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>pf</term>
+                <listitem>
+                    <para>
+                        Error covariance of filtered estimate <literal>pf=[p0,p1,...,pf]</literal>, and <literal>pk</literal> is a nxn matrix
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            function which gives the Wiener estimate using
+            the forward-backward Kalman filter formulation
+        </para>
+    </refsection>
+    <refsection>
+        <title>Sample</title>
+        <scilab:image>
+            m0=[10 10]';
+            p0=[100 0;0 100];
+            f=[1.1 50.1;0 0.8];
+            g=[1 0;0 1];
+            h=[1 0;0 1];
+            [hi,hj]=size(h);
+            q=[.01 0;0 0.01];
+            r=20*eye(2,2);
+            rand("seed",66);
+            rand("normal");
+            p0c=chol(p0);
+            x0=m0+p0c'*rand(ones(m0));
+            y=h*x0+chol(r)'*rand(ones(1:hi))';
+            yt=y;
+            x=x0;
+            ft=[f];
+            gt=[g];
+            ht=[h];
+            qt=[q];
+            rt=[r];
+            n=10;
+            for k=1:n
+            [x1,y]=system(x0,f,g,h,q,r);
+            x=[x x1];
+            yt=[yt y];
+            x0=x1;
+            ft=[ft f];
+            gt=[gt g];
+            ht=[ht h];
+            qt=[qt q];
+            rt=[rt r];
+            end
+            [xs,ps,xf,pf]=wiener(yt,m0,p0,ft,gt,ht,qt,rt);
+            a=min([x(1,:)-2*sqrt(ps(1,1:2:2*(n+1))),xf(1,:),xs(1,:)]);
+            b=max([x(1,:)+2*sqrt(ps(1,1:2:2*(n+1))),xf(1,:),xs(1,:)]);
+            c=min([x(2,:)-2*sqrt(ps(2,2:2:2*(n+1))),xf(2,:),xs(2,:)]);
+            d=max([x(2,:)+2*sqrt(ps(2,2:2:2*(n+1))),xf(2,:),xs(2,:)]);
+            xmargin=max([abs(a),abs(b)]);
+            ymargin=max([abs(c),abs(d)]);
+            a=-0.1*xmargin+a;
+            b=.1*xmargin+b;
+            c=-0.1*ymargin+c;
+            d=.1*ymargin+d;
+            scf();
+            plot([a a b],[d c c]);
+            plot2d(x(1,:)',x(2,:)',[2],"000")
+            plot2d(xf(1,:)',xf(2,:)',[2],"000")
+            plot2d(xs(1,:)',xs(2,:)',[2],"000")
+            plot2d(xs(1,:)',xs(2,:)',[-2],"000")
+            plot2d(xf(1,:)',xf(2,:)',[-3],"000")
+            plot2d(x(1,:)',x(2,:)',[-4],"000")
+            
+        </scilab:image>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+// initialize state statistics (mean and er. variance)
+m0=[10 10]';
+p0=[100 0;0 100];
+// create system
+f=[1.1 50.1;0 0.8];
+g=[1 0;0 1];
+h=[1 0;0 1];
+[hi,hj]=size(h);
+// noise statistics
+q=[.01 0;0 0.01];
+r=20*eye(2,2);
+// initialize system process
+rand("seed",66);
+rand("normal");
+p0c=chol(p0);
+x0=m0+p0c'*rand(ones(m0));
+y=h*x0+chol(r)'*rand(ones(1:hi))';
+yt=y;
+// initialize plotted variables
+x=x0;
+// loop
+ft=[f];
+gt=[g];
+ht=[h];
+qt=[q];
+rt=[r];
+n=10;
+for k=1:n
+    // generate the state and observation 
+    // at time k (i.e. xk and yk)
+    [x1,y]=system(x0,f,g,h,q,r);
+    x=[x x1];
+    yt=[yt y];
+    x0=x1;
+    ft=[ft f];
+    gt=[gt g];
+    ht=[ht h];
+    qt=[qt q];
+    rt=[rt r];
+end
+// get the wiener filter estimate
+[xs,ps,xf,pf]=wiener(yt,m0,p0,ft,gt,ht,qt,rt);
+// plot result
+a=min([x(1,:)-2*sqrt(ps(1,1:2:2*(n+1))),xf(1,:),xs(1,:)]);
+b=max([x(1,:)+2*sqrt(ps(1,1:2:2*(n+1))),xf(1,:),xs(1,:)]);
+c=min([x(2,:)-2*sqrt(ps(2,2:2:2*(n+1))),xf(2,:),xs(2,:)]);
+d=max([x(2,:)+2*sqrt(ps(2,2:2:2*(n+1))),xf(2,:),xs(2,:)]);
+xmargin=max([abs(a),abs(b)]);
+ymargin=max([abs(c),abs(d)]);
+a=-0.1*xmargin+a;
+b=.1*xmargin+b;
+c=-0.1*ymargin+c;
+d=.1*ymargin+d;
+// plot frame, real state (x), and estimates (xf, and xs)
+scf();
+plot([a a b],[d c c]);
+plot2d(x(1,:)',x(2,:)',[2],"000")
+plot2d(xf(1,:)',xf(2,:)',[2],"000")
+plot2d(xs(1,:)',xs(2,:)',[2],"000")
+// mark data points (* for real data, o for estimates)
+plot2d(xs(1,:)',xs(2,:)',[-2],"000")
+plot2d(xf(1,:)',xf(2,:)',[-3],"000")
+plot2d(x(1,:)',x(2,:)',[-4],"000")
+ ]]></programlisting>
+    </refsection>
+    
 </refentry>
index bc7ccbd..152db59 100644 (file)
@@ -1,55 +1,96 @@
 <?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" version="5.0-subset Scilab" xml:lang="en" xml:id="wigner">
-  <refnamediv>
-    <refname>wigner</refname>
-    <refpurpose> 'time-frequency' wigner spectrum</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>[tab]=wigner(x,h,deltat,zp)</synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>tab</term>
-        <listitem>
-          <para>wigner spectrum (lines correspond to the time variable)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>x</term>
-        <listitem>
-          <para>analyzed signal</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>h</term>
-        <listitem>
-          <para>data window</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>deltat</term>
-        <listitem>
-          <para>analysis time increment (in samples)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>zp</term>
-        <listitem>
-          <para>
-            length of FFT's. <literal>%pi/zp</literal> gives the frequency increment.
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      function which computes the 'time-frequency' wigner
-      spectrum of a signal.
-    </para>
-  </refsection>
+<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"  version="5.0-subset Scilab" xml:lang="en" xml:id="wigner">
+    <refnamediv>
+        <refname>wigner</refname>
+        <refpurpose> 'time-frequency' wigner spectrum</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>[tab]=wigner(x,h,deltat,zp)</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>tab</term>
+                <listitem>
+                    <para>wigner spectrum (lines correspond to the time variable)</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>x</term>
+                <listitem>
+                    <para>analyzed signal</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>h</term>
+                <listitem>
+                    <para>data window</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>deltat</term>
+                <listitem>
+                    <para>analysis time increment (in samples)</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>zp</term>
+                <listitem>
+                    <para>
+                        length of FFT's. <literal>%pi/zp</literal> gives the frequency increment.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            function which computes the 'time-frequency' wigner
+            spectrum of a signal.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Sample</title>
+        <scilab:image>
+            a=[488^2 488 1;408^2 408 1;568^2 568 1];
+            b=[1.28;0;0];
+            x=a\b;
+            t=408:568;
+            p=x'*[t.*t;t;ones(t)];
+            u=[0*ones(408:487) ones(488:568)];
+            s=p.*sin(2*%pi/16*t+u*%pi);
+            s=[0*ones(0:407) s 0*ones(569:951)];
+            h=ones(1,64);
+            w=wigner(s,h,12,128);
+            scf();
+            plot3d(1:69,1:64,abs(w(1:69,1:64)));
+        </scilab:image>
+    </refsection>
+    
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+a=[488^2 488 1;408^2 408 1;568^2 568 1];
+b=[1.28;0;0];
+x=a\b;
+t=408:568;
+p=x'*[t.*t;t;ones(t)];
+// unit step function
+u=[0*ones(408:487) ones(488:568)];
+// finite duration sinusoid
+s=p.*sin(2*%pi/16*t+u*%pi);
+// signal to be analyzed
+s=[0*ones(0:407) s 0*ones(569:951)];
+// 64-point rectangular window
+h=ones(1,64);
+// wigner spectrum
+w=wigner(s,h,12,128);
+scf();
+plot3d(1:69,1:64,abs(w(1:69,1:64)));
+ ]]></programlisting>
+    </refsection>
+    
 </refentry>
index fc763c2..e36640d 100644 (file)
@@ -1,48 +1,57 @@
 <?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" version="5.0-subset Scilab" xml:lang="en" xml:id="zpbutt">
-  <refnamediv>
-    <refname>zpbutt</refname>
-    <refpurpose> Butterworth analog filter</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>[pols,gain]=zpbutt(n,omegac)</synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>n</term>
-        <listitem>
-          <para>integer (filter order)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>omegac</term>
-        <listitem>
-          <para>real (cut-off frequency in Hertz)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>pols</term>
-        <listitem>
-          <para>resulting poles of filter</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>gain</term>
-        <listitem>
-          <para>resulting gain of filter</para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      computes the poles of a Butterworth analog
-      filter of order <literal>n</literal> and cutoff frequency omegac
-      transfer function H(s) is calculated by <literal>H(s)=gain/real(poly(pols,'s'))</literal>
-    </para>
-  </refsection>
+    <refnamediv>
+        <refname>zpbutt</refname>
+        <refpurpose> Butterworth analog filter</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>[pols,gain]=zpbutt(n,omegac)</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>n</term>
+                <listitem>
+                    <para>integer (filter order)</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>omegac</term>
+                <listitem>
+                    <para>real (cut-off frequency in Hertz)</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>pols</term>
+                <listitem>
+                    <para>resulting poles of filter</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>gain</term>
+                <listitem>
+                    <para>resulting gain of filter</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            computes the poles of a Butterworth analog
+            filter of order <literal>n</literal> and cutoff frequency omegac
+            transfer function H(s) is calculated by <literal>H(s)=gain/real(poly(pols,'s'))</literal>
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+n=7;
+omegac=3;
+[pols,gain]=zpbutt(n,omegac)
+ ]]></programlisting>
+    </refsection>
+    
 </refentry>
index e5d2c88..995d850 100644 (file)
@@ -1,57 +1,67 @@
 <?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" version="5.0-subset Scilab" xml:lang="en" xml:id="zpch1">
-  <refnamediv>
-    <refname>zpch1</refname>
-    <refpurpose> Chebyshev analog filter</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>[poles,gain]=zpch1(n,epsilon,omegac)</synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>n</term>
-        <listitem>
-          <para>integer (filter order)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>epsilon</term>
-        <listitem>
-          <para>
-            real : ripple in the pass band (<literal>0&lt;epsilon&lt;1</literal>)
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>omegac</term>
-        <listitem>
-          <para>real : cut-off frequency in Hertz</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>poles</term>
-        <listitem>
-          <para>resulting filter poles</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>gain</term>
-        <listitem>
-          <para>resulting filter gain</para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      Poles of a Type 1 Chebyshev analog filter. The transfer function is given by :
-    </para>
-    <programlisting role=""><![CDATA[ 
+    <refnamediv>
+        <refname>zpch1</refname>
+        <refpurpose> Chebyshev analog filter</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>[poles,gain]=zpch1(n,epsilon,omegac)</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>n</term>
+                <listitem>
+                    <para>integer (filter order)</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>epsilon</term>
+                <listitem>
+                    <para>
+                        real : ripple in the pass band (<literal>0&lt;epsilon&lt;1</literal>)
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>omegac</term>
+                <listitem>
+                    <para>real : cut-off frequency in Hertz</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>poles</term>
+                <listitem>
+                    <para>resulting filter poles</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>gain</term>
+                <listitem>
+                    <para>resulting filter gain</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            Poles of a Type 1 Chebyshev analog filter. The transfer function is given by :
+        </para>
+        <programlisting role="no-scilab-exec"><![CDATA[ 
 H(s)=gain/poly(poles,'s')
  ]]></programlisting>
-  </refsection>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+n = 13;
+epsilon = 0.2;
+omegac = 3;
+[p,gain] = zpch1(n,epsilon,omegac)
+ ]]></programlisting>
+    </refsection>
+    
 </refentry>
index da148cd..840d992 100644 (file)
@@ -1,64 +1,74 @@
 <?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" version="5.0-subset Scilab" xml:lang="en" xml:id="zpch2">
-  <refnamediv>
-    <refname>zpch2</refname>
-    <refpurpose> Chebyshev analog filter</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>[zeros,poles,gain]=zpch2(n,A,omegar)</synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>n</term>
-        <listitem>
-          <para>integer : filter order</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>A</term>
-        <listitem>
-          <para>
-            real : attenuation in stop band (<literal>A&gt;1</literal>)
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>omegar</term>
-        <listitem>
-          <para>real : cut-off frequency in Hertz</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>zeros</term>
-        <listitem>
-          <para>resulting filter zeros</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>poles</term>
-        <listitem>
-          <para>resulting filter poles</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>gain</term>
-        <listitem>
-          <para>Resulting filter gain</para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      Poles and zeros of a type 2 Chebyshev analog filter
-      gain is the gain of the filter
-    </para>
-    <programlisting role=""><![CDATA[ 
+    <refnamediv>
+        <refname>zpch2</refname>
+        <refpurpose> Chebyshev analog filter</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>[zeros,poles,gain]=zpch2(n,A,omegar)</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>n</term>
+                <listitem>
+                    <para>integer : filter order</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>A</term>
+                <listitem>
+                    <para>
+                        real : attenuation in stop band (<literal>A&gt;1</literal>)
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>omegar</term>
+                <listitem>
+                    <para>real : cut-off frequency in Hertz</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>zeros</term>
+                <listitem>
+                    <para>resulting filter zeros</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>poles</term>
+                <listitem>
+                    <para>resulting filter poles</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>gain</term>
+                <listitem>
+                    <para>Resulting filter gain</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            Poles and zeros of a type 2 Chebyshev analog filter
+            gain is the gain of the filter
+        </para>
+        <programlisting role="no-scilab-exec"><![CDATA[ 
 H(s)=gain*poly(zeros,'s')/poly(poles,'s')
  ]]></programlisting>
-  </refsection>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+n=10;
+A=1/0.2;
+omegar=6;
+[z,p,gain]=zpch2(n,A,omegar)
+ ]]></programlisting>
+    </refsection>
+    
 </refentry>