Standalone help pages
[scilab.git] / scilab / modules / signal_processing / help / en_US / yulewalk.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="yulewalk">
3     <refnamediv>
4         <refname>yulewalk</refname>
5         <refpurpose>  least-square filter design</refpurpose>
6     </refnamediv>
7     <refsynopsisdiv>
8         <title>Calling Sequence</title>
9         <synopsis>Hz = yulewalk(N,frq,mag)</synopsis>
10     </refsynopsisdiv>
11     <refsection>
12         <title>Arguments</title>
13         <variablelist>
14             <varlistentry>
15                 <term>N</term>
16                 <listitem>
17                     <para>integer (order of desired filter)</para>
18                 </listitem>
19             </varlistentry>
20             <varlistentry>
21                 <term>frq</term>
22                 <listitem>
23                     <para>real row vector (non-decreasing order), frequencies.</para>
24                 </listitem>
25             </varlistentry>
26             <varlistentry>
27                 <term>mag</term>
28                 <listitem>
29                     <para>non negative real row vector (same size as frq), desired magnitudes.</para>
30                 </listitem>
31             </varlistentry>
32             <varlistentry>
33                 <term>Hz</term>
34                 <listitem>
35                     <para>
36                         filter <literal>B(z)/A(z)</literal>
37                     </para>
38                 </listitem>
39             </varlistentry>
40         </variablelist>
41     </refsection>
42     <refsection>
43         <title>Description</title>
44         <para>
45             Hz = yulewalk(N,frq,mag) finds the N-th order iir filter
46         </para>
47         <programlisting role="no-scilab-exec"><![CDATA[ 
48                   n-1         n-2
49       B(z)   b(1)z     + b(2)z    + .... + b(n)
50 H(z)= ---- = ---------------------------------
51                 n-1       n-2
52       A(z)    z   + a(2)z    + .... + a(n)
53  ]]></programlisting>
54         <para>
55             which matches the magnitude frequency response given by vectors frq and mag.
56             Vectors frq and mag specify the frequency and magnitude of the desired
57             frequency response. The frequencies in frq must be between 0.0 and 1.0,
58             with 1.0 corresponding to half the sample rate. They must be in
59             increasing order and start with 0.0 and end with 1.0.
60         </para>
61     </refsection>
62     <refsection>
63         <title>Examples</title>
64         <programlisting role="example"><![CDATA[ 
65 f=[0,0.4,0.4,0.6,0.6,1];
66 H=[0,0,1,1,0,0];
67 Hz=yulewalk(8,f,H);
68 fs=1000;
69 fhz = f*fs/2; 
70 clf(0);
71 xset('window',0);
72 plot2d(fhz',H');
73 xtitle('Desired Frequency Response (Magnitude)')
74 [frq,repf]=repfreq(Hz,0:0.001:0.5);
75 clf(1);
76 xset('window',1);
77 plot2d(fs*frq',abs(repf'));
78 xtitle('Obtained Frequency Response (Magnitude)')
79  ]]></programlisting>
80         <scilab:image>
81             f=[0,0.4,0.4,0.6,0.6,1];
82             H=[0,0,1,1,0,0];
83             Hz=yulewalk(8,f,H);
84             fs=1000;
85             fhz = f*fs/2; 
86             clf(0);
87             xset('window',0);
88             plot2d(fhz',H');
89             xtitle('Desired Frequency Response (Magnitude)')
90             [frq,repf]=repfreq(Hz,0:0.001:0.5);
91         </scilab:image>
92         <scilab:image>
93             f=[0,0.4,0.4,0.6,0.6,1];
94             H=[0,0,1,1,0,0];
95             Hz=yulewalk(8,f,H);
96             fs=1000;
97             fhz = f*fs/2;
98             [frq,repf]=repfreq(Hz,0:0.001:0.5);
99             plot2d(fs*frq',abs(repf'));
100             xtitle('Obtained Frequency Response (Magnitude)')
101         </scilab:image>
102     </refsection>
103 </refentry>