~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/signal_processing/help/en_US/remezb.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
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" version="5.0-subset Scilab" xml:lang="en" xml:id="remezb">
3
 
  <refnamediv>
4
 
    <refname>remezb</refname>
5
 
    <refpurpose> Minimax approximation of magnitude response</refpurpose>
6
 
  </refnamediv>
7
 
  <refsynopsisdiv>
8
 
    <title>Calling Sequence</title>
9
 
    <synopsis>[an]=remezb(nc,fg,ds,wt)</synopsis>
10
 
  </refsynopsisdiv>
11
 
  <refsection>
12
 
    <title>Arguments</title>
13
 
    <variablelist>
14
 
      <varlistentry>
15
 
        <term>nc</term>
16
 
        <listitem>
17
 
          <para>Number of cosine functions</para>
18
 
        </listitem>
19
 
      </varlistentry>
20
 
      <varlistentry>
21
 
        <term>fg</term>
22
 
        <listitem>
23
 
          <para>Grid of frequency points in [0,.5)</para>
24
 
        </listitem>
25
 
      </varlistentry>
26
 
      <varlistentry>
27
 
        <term>ds</term>
28
 
        <listitem>
29
 
          <para>
30
 
            Desired magnitude on grid <literal>fg</literal>
31
 
          </para>
32
 
        </listitem>
33
 
      </varlistentry>
34
 
      <varlistentry>
35
 
        <term>wt</term>
36
 
        <listitem>
37
 
          <para>
38
 
            Weighting function on error on grid <literal>fg</literal>
39
 
          </para>
40
 
        </listitem>
41
 
      </varlistentry>
42
 
      <varlistentry>
43
 
        <term>an</term>
44
 
        <listitem>
45
 
          <para>Cosine filter coefficients</para>
46
 
        </listitem>
47
 
      </varlistentry>
48
 
    </variablelist>
49
 
  </refsection>
50
 
  <refsection>
51
 
    <title>Description</title>
52
 
    <para>
53
 
      Minimax approximation of a frequency domain
54
 
      magnitude response. The approximation takes
55
 
      the form <literal>h = sum[a(n)*cos(wn)]</literal>
56
 
      for n=0,1,...,nc. An FIR, linear-phase filter
57
 
      can be obtained from the output of the function
58
 
      by using the following commands
59
 
    </para>
60
 
    <programlisting role=""><![CDATA[ 
61
 
hn(1:nc-1)=an(nc:-1:2)/2;
62
 
hn(nc)=an(1);
63
 
hn(nc+1:2*nc-1)=an(2:nc)/2;
64
 
 ]]></programlisting>
65
 
  </refsection>
66
 
  <refsection>
67
 
    <title>Examples</title>
68
 
    <programlisting role="example"><![CDATA[ 
69
 
// Choose the number of cosine functions and create a dense grid 
70
 
// in [0,.24) and [.26,.5)
71
 
nc=21;ngrid=nc*16;
72
 
fg=.24*(0:ngrid/2-1)/(ngrid/2-1);
73
 
fg(ngrid/2+1:ngrid)=fg(1:ngrid/2)+.26*ones(1:ngrid/2);
74
 
 
75
 
// Specify a low pass filter magnitude for the desired response
76
 
ds(1:ngrid/2)=ones(1:ngrid/2);
77
 
ds(ngrid/2+1:ngrid)=zeros(1:ngrid/2);
78
 
 
79
 
// Specify a uniform weighting function
80
 
wt=ones(fg);
81
 
 
82
 
// Run remezb
83
 
an=remezb(nc,fg,ds,wt)
84
 
 
85
 
// Make a linear phase FIR filter 
86
 
hn(1:nc-1)=an(nc:-1:2)/2;
87
 
hn(nc)=an(1);
88
 
hn(nc+1:2*nc-1)=an(2:nc)/2;
89
 
 
90
 
// Plot the filter's magnitude response
91
 
plot(.5*(0:255)/256,frmag(hn,256));
92
 
 
93
 
// Choose the number of cosine functions and create a dense grid in [0,.5)
94
 
nc=21; ngrid=nc*16;
95
 
fg=.5*(0:(ngrid-1))/ngrid;
96
 
 
97
 
// Specify a triangular shaped magnitude for the desired response
98
 
ds(1:ngrid/2)=(0:ngrid/2-1)/(ngrid/2-1);
99
 
ds(ngrid/2+1:ngrid)=ds(ngrid/2:-1:1);
100
 
 
101
 
// Specify a uniform weighting function
102
 
wt=ones(fg);
103
 
 
104
 
// Run remezb
105
 
an=remezb(nc,fg,ds,wt)
106
 
 
107
 
// Make a linear phase FIR filter 
108
 
hn(1:nc-1)=an(nc:-1:2)/2;
109
 
hn(nc)=an(1);
110
 
hn(nc+1:2*nc-1)=an(2:nc)/2;
111
 
 
112
 
// Plot the filter's magnitude response
113
 
plot(.5*(0:255)/256,frmag(hn,256));
114
 
 ]]></programlisting>
115
 
  </refsection>
116
 
  <refsection role="see also">
117
 
    <title>See Also</title>
118
 
    <simplelist type="inline">
119
 
      <member>
120
 
        <link linkend="eqfir">eqfir</link>
121
 
      </member>
122
 
    </simplelist>
123
 
  </refsection>
124
 
</refentry>