| 1 | |
| 2 | <refentry id="GEN14"> |
| 3 | <indexterm id="IndexGEN14"><primary>GEN14</primary></indexterm> |
| 4 | <refmeta> |
| 5 | <refentrytitle>GEN14</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | <refnamediv> |
| 9 | <refname>GEN14</refname> |
| 10 | <refpurpose> |
| 11 | Stores a polynomial whose coefficients derive from Chebyshevs of the second kind. |
| 12 | </refpurpose> |
| 13 | </refnamediv> |
| 14 | |
| 15 | <refsect1> |
| 16 | <title>Description</title> |
| 17 | <para> |
| 18 | Uses Chebyshev coefficients to generate stored polynomial functions which, under waveshaping, can be used to split a sinusoid into harmonic partials having a pre-definable spectrum. |
| 19 | </para> |
| 20 | </refsect1> |
| 21 | |
| 22 | <refsect1> |
| 23 | <title>Syntax</title> |
| 24 | <synopsis><command>f</command> # time size 14 xint xamp h0 h1 h2 ...</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 (see <link linkend="f"><citetitle>f statement</citetitle></link>). The normal value is power-of-2 plus 1. |
| 31 | </para> |
| 32 | |
| 33 | <para> |
| 34 | <emphasis>xint</emphasis> -- provides the left and right values [<emphasis>-xint, +xint</emphasis>] of the x interval over which the polynomial is to be drawn. These subroutines both call <link linkend="GEN03"><citetitle>GEN03</citetitle></link> to draw their functions; the p5 value here is therefore expanded to a negative-positive p5, p6 pair before <emphasis>GEN03</emphasis> is actually called. The normal value is 1. |
| 35 | </para> |
| 36 | |
| 37 | <para> |
| 38 | <emphasis>xamp </emphasis> -- amplitude scaling factor of the sinusoid input that is expected to produce the following spectrum. |
| 39 | </para> |
| 40 | |
| 41 | <para> |
| 42 | <emphasis>h0, h1, h2,</emphasis> etc. -- relative strength of partials 0 (DC), 1 (fundamental), 2 ... that will result when a sinusoid of amplitude |
| 43 | |
| 44 | <literallayout> |
| 45 | xamp * int(size/2)/xint |
| 46 | </literallayout> |
| 47 | |
| 48 | is waveshaped using this function table. These values thus describe a frequency spectrum associated with a particular factor <emphasis>xamp</emphasis> of the input signal. |
| 49 | </para> |
| 50 | |
| 51 | <note> |
| 52 | <title>Note</title> |
| 53 | <para> |
| 54 | <itemizedlist> |
| 55 | <listitem> |
| 56 | <para> |
| 57 | <link linkend="GEN13"><citetitle>GEN13</citetitle></link> is the function generator normally employed in standard waveshaping. It stores a polynomial whose coefficients derive from the Chebyshev polynomials of the first kind, so that a driving sinusoid of strength <emphasis>xamp</emphasis> will exhibit the specified spectrum at output. Note that the evolution of this spectrum is generally not linear with varying <emphasis>xamp</emphasis>. However, it is bandlimited (the only partials to appear will be those specified at generation time); and the partials will tend to occur and to develop in ascending order (the lower partials dominating at low <emphasis>xamp</emphasis>, and the spectral richness increasing for higher values of <emphasis>xamp</emphasis>). A negative <emphasis>hn</emphasis> value implies a 180 degree phase shift of that partial; the requested full-amplitude spectrum will not be affected by this shift, although the evolution of several of its component partials may be. The pattern +,+,-,-,+,+,... for <emphasis>h0,h1,h2..</emphasis>. will minimize the normalization problem for low <emphasis>xamp</emphasis> values (see above), but does not necessarily provide the smoothest pattern of evolution. |
| 58 | </para> |
| 59 | </listitem> |
| 60 | |
| 61 | <listitem> |
| 62 | <para> |
| 63 | <emphasis>GEN14</emphasis> stores a polynomial whose coefficients derive from Chebyshevs of the second kind. |
| 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 GEN14 generator. It uses the file <ulink url="examples/gen14.csd"><citetitle>gen14.csd</citetitle></ulink>. |
| 75 | <example> |
| 76 | <title>Example of the GEN14 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/gen14.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 GEN14 routines, as used in the example:</phrase> |
| 82 | </textobject> |
| 83 | |
| 84 | <mediaobject> |
| 85 | <imageobject> |
| 86 | <imagedata fileref="images/gen14_1.png" format="PNG"/> |
| 87 | </imageobject> |
| 88 | |
| 89 | <textobject> |
| 90 | <phrase>f28 0 4097 13 1 1 1 0 .8 0 .5 0 .2 - waveshaping function: GEN13, odd harmonics</phrase> |
| 91 | </textobject> |
| 92 | |
| 93 | <caption> |
| 94 | <para>f28 0 4097 13 1 1 1 0 .8 0 .5 0 .2 - waveshaping function: GEN13, odd harmonics</para> |
| 95 | </caption> |
| 96 | </mediaobject> |
| 97 | |
| 98 | <mediaobject> |
| 99 | <imageobject> |
| 100 | <imagedata fileref="images/gen14_2.png" format="PNG"/> |
| 101 | </imageobject> |
| 102 | |
| 103 | <textobject> |
| 104 | <phrase>f29 0 4097 14 1 1 1 0 .8 0 .5 0 .2 - waveshaping function: GEN14, the same odd harmonics</phrase> |
| 105 | </textobject> |
| 106 | |
| 107 | <caption> |
| 108 | <para>f29 0 4097 14 1 1 1 0 .8 0 .5 0 .2 - waveshaping function: GEN14, the same odd harmonics</para> |
| 109 | </caption> |
| 110 | </mediaobject> |
| 111 | |
| 112 | <mediaobject> |
| 113 | <imageobject> |
| 114 | <imagedata fileref="images/gen14_3.png" format="PNG"/> |
| 115 | </imageobject> |
| 116 | |
| 117 | <textobject> |
| 118 | <phrase>f30 0 4097 13 1 1 0 1 0 .6 0 .4 0 .1 - waveshaping function: GEN13, even harmonics</phrase> |
| 119 | </textobject> |
| 120 | |
| 121 | <caption> |
| 122 | <para>f30 0 4097 13 1 1 0 1 0 .6 0 .4 0 .1 - waveshaping function: GEN13, even harmonics</para> |
| 123 | </caption> |
| 124 | </mediaobject> |
| 125 | |
| 126 | <mediaobject> |
| 127 | <imageobject> |
| 128 | <imagedata fileref="images/gen14_4.png" format="PNG"/> |
| 129 | </imageobject> |
| 130 | |
| 131 | <textobject> |
| 132 | <phrase>f31 0 4097 14 1 1 0 1 0 .6 0 .4 0 .1 - waveshaping function: GEN14, the same even harmonics</phrase> |
| 133 | </textobject> |
| 134 | |
| 135 | <caption> |
| 136 | <para>f31 0 4097 14 1 1 0 1 0 .6 0 .4 0 .1 - waveshaping function: GEN14, the same even harmonics</para> |
| 137 | </caption> |
| 138 | </mediaobject> |
| 139 | |
| 140 | </para> |
| 141 | </refsect1> |
| 142 | |
| 143 | |
| 144 | <refsect1> |
| 145 | <title>See Also</title> |
| 146 | <para> |
| 147 | <link linkend="GEN03"><citetitle>GEN03</citetitle></link>, |
| 148 | <link linkend="GEN13"><citetitle>GEN13</citetitle></link>, and |
| 149 | <link linkend="GEN15"><citetitle>GEN15</citetitle></link>. |
| 150 | <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> |
| 151 | </para> |
| 152 | </refsect1> |
| 153 | </refentry> |