Debian Codegraph @

scoregens/gen03.xml

raw symbols SCIP
1
2 <refentry id="GEN03">
3 <indexterm id="IndexGEN03"><primary>GEN03</primary></indexterm>
4 <refmeta>
5 <refentrytitle>GEN03</refentrytitle>
6 </refmeta>
7
8 <refnamediv>
9 <refname>GEN03</refname>
10 <refpurpose>
11 Generates a stored function table by evaluating a polynomial.
12 </refpurpose>
13 </refnamediv>
14
15 <refsect1>
16 <title>Description</title>
17 <para>
18 This subroutine generates a stored function table by evaluating a polynomial in x over a fixed interval and with specified coefficients.
19 </para>
20 </refsect1>
21
22 <refsect1>
23 <title>Syntax</title>
24 <synopsis><command>f</command> # time size 3 xval1 xval2 c0 c1 c2 ... cn</synopsis>
25 </refsect1>
26
27 <refsect1>
28 <title>Initialization</title>
29 <para>
30 <emphasis>size </emphasis> -- number of points in the table. Must be a power of 2 or a power-of-2 plus 1.
31 </para>
32
33 <para>
34 <emphasis>xval1, xval2 </emphasis> -- left and right values of the x interval over which the polynomial is defined (<emphasis>xval1</emphasis> &lt; <emphasis>xval2</emphasis>). These will produce the 1st stored value and the (power-of-2 plus l)th stored value respectively in the generated function table.
35 </para>
36
37 <para>
38 <emphasis>c0, c1, c2, ..., cn</emphasis> -- coefficients of the nth-order polynomial
39 </para>
40
41 <para>
42 <emphasis>C<subscript>0</subscript></emphasis> + <emphasis>C<subscript>1</subscript>x</emphasis> +
43 <emphasis>C<subscript>2</subscript>x<superscript>2</superscript></emphasis> + . . . +
44 <emphasis>C<subscript>n</subscript>x<superscript>n</superscript></emphasis>
45 </para>
46
47 <para>
48 Coefficients may be positive or negative real numbers; a zero denotes a missing term in the polynomial. The coefficient list begins in p7, providing a current upper limit of 144 terms.
49 </para>
50
51 <note>
52 <title>Note</title>
53 <para>
54 <itemizedlist>
55 <listitem>
56 <para>
57 The defined segment [fn(<emphasis>xval1</emphasis>), fn(<emphasis>xval2</emphasis>)] is evenly distributed. Thus a 512-point table over the interval [-1,1] will have its origin at location 257 (at the start of the 2nd half). Provided the extended guard point is requested, both fn(-1) and fn(1) will exist in the table.
58 </para>
59 </listitem>
60
61 <listitem>
62 <para>
63 <emphasis>GEN03</emphasis> is useful in conjunction with <link linkend="table"><citetitle>table</citetitle></link> or <link linkend="tablei"><citetitle>tablei</citetitle></link> for audio waveshaping (sound modification by non-linear distortion). Coefficients to produce a particular formant from a sinusoidal lookup index of known amplitude can be determined at preprocessing time using algorithms such as Chebyshev formulae. See also <link linkend="GEN13"><citetitle>GEN13</citetitle></link>.
64 </para>
65 </listitem>
66 </itemizedlist>
67 </para>
68 </note>
69 </refsect1>
70
71 <refsect1>
72 <title>Examples</title>
73 <para>
74 Here is an example of the GEN03 generator. It uses the file <ulink url="examples/gen03.csd"><citetitle>gen03.csd</citetitle></ulink>.
75 <example>
76 <title>Example of the GEN03 generator.</title>
77 <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
78 <xi:include href="examples-xml/gen03.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
79 </example>
80 <textobject>
81 <phrase>These are the diagrams of the waveforms of the GEN03 routines, as used in the example:</phrase>
82 </textobject>
83
84 <mediaobject>
85 <imageobject>
86 <imagedata fileref="images/gen03_1.png" format="PNG"/>
87 </imageobject>
88
89 <textobject>
90 <phrase>f4 0 513 3 1 1 0 1 - first-order Chebyshev: x</phrase>
91 </textobject>
92
93 <caption>
94 <para>f4 0 513 3 1 1 0 1 - first-order Chebyshev: x</para>
95 </caption>
96 </mediaobject>
97
98 <mediaobject>
99 <imageobject>
100 <imagedata fileref="images/gen03_2.png" format="PNG"/>
101 </imageobject>
102
103 <textobject>
104 <phrase>f6 0 513 3 -1 1 -1 0 2 - second-order Chebyshev: 2x2 - 1</phrase>
105 </textobject>
106
107 <caption>
108 <para>f6 0 513 3 -1 1 -1 0 2 - second-order Chebyshev: 2x2 - 1</para>
109 </caption>
110 </mediaobject>
111
112 <mediaobject>
113 <imageobject>
114 <imagedata fileref="images/gen03_3.png" format="PNG"/>
115 </imageobject>
116
117 <textobject>
118 <phrase>f8 0 513 3 -1 1 0 -3 0 4 - third-order Chebyshev: 4x3 - 3x</phrase>
119 </textobject>
120
121 <caption>
122 <para>f8 0 513 3 -1 1 0 -3 0 4 - third-order Chebyshev: 4x3 - 3x</para>
123 </caption>
124 </mediaobject>
125
126 <mediaobject>
127 <imageobject>
128 <imagedata fileref="images/gen03_4.png" format="PNG"/>
129 </imageobject>
130
131 <textobject>
132 <phrase>f10 0 513 3 -1 10 0 -7 0 56 0 -112 0 64 - seventh-order Chebyshev: 64x7 - 112x5 + 56x3 - 7x</phrase>
133 </textobject>
134
135 <caption>
136 <para>f10 0 513 3 -1 10 0 -7 0 56 0 -112 0 64 - seventh-order Chebyshev: 64x7 - 112x5 + 56x3 - 7x</para>
137 </caption>
138 </mediaobject>
139
140 <mediaobject>
141 <imageobject>
142 <imagedata fileref="images/gen03_5.png" format="PNG"/>
143 </imageobject>
144
145 <textobject>
146 <phrase>f12 0 513 3 -1 1 5 4 3 2 2 1 - a 4th order polynomial function over the x-interval -1 to 1</phrase>
147 </textobject>
148
149 <caption>
150 <para>f12 0 513 3 -1 1 5 4 3 2 2 1 - a 4th order polynomial function over the x-interval -1 to 1</para>
151 </caption>
152 </mediaobject>
153
154 </para>
155 </refsect1>
156
157 <refsect1>
158 <title>See Also</title>
159 <para>
160 <link linkend="GEN13"><citetitle>GEN13</citetitle></link>,
161 <link linkend="GEN14"><citetitle>GEN14</citetitle></link>, and
162 <link linkend="GEN15"><citetitle>GEN15</citetitle></link>.
163 <para> Information about the Chebyshev polynomials on Wikipedia: <ulink url="http://en.wikipedia.org/wiki/Chebyshev_polynomials"><citetitle>http://en.wikipedia.org/wiki/Chebyshev_polynomials</citetitle></ulink></para>
164 </para>
165 </refsect1>
166 </refentry>