Typo fixes
[scilab.git] / scilab / modules / signal_processing / help / en_US / mrfit.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" xml:lang="en" xml:id="mrfit">
3     <refnamediv>
4         <refname>mrfit</refname>
5         <refpurpose>frequency response fit</refpurpose>
6     </refnamediv>
7     <refsynopsisdiv>
8         <title>Syntax</title>
9         <synopsis>sys=mrfit(w,mag,order)
10             [num,den]=mrfit(w,mag,order)
11             sys=mrfit(w,mag,order,weight)
12             [num,den]=mrfit(w,mag,order,weight)
13         </synopsis>
14     </refsynopsisdiv>
15     <refsection>
16         <title>Arguments</title>
17         <variablelist>
18             <varlistentry>
19                 <term>w</term>
20                 <listitem>
21                     <para>positive real vector of frequencies (Hz)</para>
22                 </listitem>
23             </varlistentry>
24             <varlistentry>
25                 <term>mag</term>
26                 <listitem>
27                     <para>
28                         real vector of frequency responses magnitude (same size as <literal>w</literal>)
29                     </para>
30                 </listitem>
31             </varlistentry>
32             <varlistentry>
33                 <term>order</term>
34                 <listitem>
35                     <para>
36                         integer (required order, degree of <literal>den</literal>)
37                     </para>
38                 </listitem>
39             </varlistentry>
40             <varlistentry>
41                 <term>weight</term>
42                 <listitem>
43                     <para>
44                         positive real vector (default value <literal>ones(w)</literal>).
45                     </para>
46                 </listitem>
47             </varlistentry>
48             <varlistentry>
49                 <term>num,den</term>
50                 <listitem>
51                     <para>stable polynomials</para>
52                 </listitem>
53             </varlistentry>
54         </variablelist>
55     </refsection>
56     <refsection>
57         <title>Description</title>
58         <para>
59             <literal>sys=mrfit(w,mag,order,weight)</literal> returns a bi-stable transfer function
60             <literal>G(s)=sys=num/den</literal>, of of given <literal>order</literal> such that 
61             its frequency response magnitude <literal>abs(G(w(i)))</literal> 
62             matches <literal>mag(i)</literal> i.e. <literal>abs(freq(num,den,%i*w))</literal> should be 
63             close to <literal>mag</literal>.
64             <literal>weight(i)</literal> is the weight given to <literal>w(i)</literal>.
65         </para>
66     </refsection>
67     <refsection>
68         <title>Examples</title>
69         <programlisting role="example"><![CDATA[ 
70 w=0.01:0.01:2;
71 s=poly(0,'s');
72 G=syslin('c',2*(s^2+0.1*s+2),(s^2+s+1)*(s^2+0.3*s+1)); // syslin('c',Num,Den);
73 fresp=repfreq(G,w);
74 mag=abs(fresp);
75 Gid=mrfit(w,mag,4);
76 frespfit=repfreq(Gid,w);
77 plot2d([w',w'],[mag(:),abs(frespfit(:))])
78  ]]></programlisting>
79         <scilab:image>
80             w=0.01:0.01:2;
81             s=poly(0,'s');
82             G=syslin('c',2*(s^2+0.1*s+2),(s^2+s+1)*(s^2+0.3*s+1));
83             fresp=repfreq(G,w);
84             mag=abs(fresp);
85             Gid=mrfit(w,mag,4);
86             frespfit=repfreq(Gid,w);
87             plot2d([w',w'],[mag(:),abs(frespfit(:))])
88         </scilab:image>
89     </refsection>
90     <refsection role="see also">
91         <title>See Also</title>
92         <simplelist type="inline">
93             <member>
94                 <link linkend="cepstrum">cepstrum</link>
95             </member>
96             <member>
97                 <link linkend="frfit">frfit</link>
98             </member>
99             <member>
100                 <link linkend="freq">freq</link>
101             </member>
102             <member>
103                 <link linkend="calfrq">calfrq</link>
104             </member>
105         </simplelist>
106     </refsection>
107 </refentry>