* Bug #11670 to 11676 fixed - Add examples in the signal processing help pages.
[scilab.git] / scilab / modules / signal_processing / help / en_US / mese.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <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">
3     <refnamediv>
4         <refname>mese</refname>
5         <refpurpose> maximum entropy spectral estimation</refpurpose>
6     </refnamediv>
7     <refsynopsisdiv>
8         <title>Calling Sequence</title>
9         <synopsis>[sm,fr]=mese(x [,npts]);</synopsis>
10     </refsynopsisdiv>
11     <refsection>
12         <title>Arguments</title>
13         <variablelist>
14             <varlistentry>
15                 <term>x</term>
16                 <listitem>
17                     <para>Input sampled data sequence</para>
18                 </listitem>
19             </varlistentry>
20             <varlistentry>
21                 <term>npts</term>
22                 <listitem>
23                     <para>
24                         Optional parameter giving number of points of <literal>fr</literal> and <literal>sm</literal> (default is 256)
25                     </para>
26                 </listitem>
27             </varlistentry>
28             <varlistentry>
29                 <term>sm</term>
30                 <listitem>
31                     <para>
32                         Samples of spectral estimate on the frequency grid <literal>fr</literal>
33                     </para>
34                 </listitem>
35             </varlistentry>
36             <varlistentry>
37                 <term>fr</term>
38                 <listitem>
39                     <para>
40                         npts equally spaced frequency samples in <literal>[0,.5)</literal>
41                     </para>
42                 </listitem>
43             </varlistentry>
44         </variablelist>
45     </refsection>
46     <refsection>
47         <title>Description</title>
48         <para>
49             Calculate the maximum entropy spectral estimate of <literal>x</literal>
50         </para>
51     </refsection>
52     <refsection>
53         <title>Sample</title>
54         <scilab:image>
55             rand("seed",12345),
56             y = (0:10);
57             x1 = sin(2*%pi*y/20);
58             x2 = sin(3.5*%pi*y/20);
59             w = .4*(rand(y)-.5*ones(y));
60             x = x1+2*x2+w;
61             [sm,fr1] = mese(x,10)
62             function [xm,fr] = bt(x)
63             xsize = max(size(x))
64             [xf,fr] = frmag(x,256)
65             xm = xf.*conj(xf)/xsize
66             endfunction
67             [xm,fr] = bt(x);
68             scf();
69             subplot(3,1,1);
70             plot(x);
71             subplot(3,1,2);
72             plot(fr1,sm)
73             subplot(3,1,3);
74             plot(fr,xm)
75         </scilab:image>
76     </refsection>
77     
78     <refsection>
79         <title>Examples</title>
80         <programlisting role="example"><![CDATA[ 
81 rand("seed",12345),
82 y = (0:10);
83 x1 = sin(2*%pi*y/20);
84 x2 = sin(3.5*%pi*y/20);
85 w = .4*(rand(y)-.5*ones(y));
86 x = x1+2*x2+w;
87 [sm,fr1] = mese(x,10)
88 // Define macro which computes the 
89 // Blackman-Tukey periodogram
90 function [xm,fr] = bt(x)
91   xsize = max(size(x))
92   [xf,fr] = frmag(x,256)
93   xm = xf.*conj(xf)/xsize
94 endfunction
95 [xm,fr] = bt(x);
96 scf();
97 subplot(3,1,1);
98 plot(x);
99 subplot(3,1,2);
100 plot(fr1,sm)
101 subplot(3,1,3);
102 plot(fr,xm)
103  ]]></programlisting>
104     </refsection>
105 </refentry>