| 1 | |
| 2 | <refentry id="GEN05"> |
| 3 | <indexterm id="IndexGEN05"><primary>GEN05</primary></indexterm> |
| 4 | <refmeta> |
| 5 | <refentrytitle>GEN05</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | <refnamediv> |
| 9 | <refname>GEN05</refname> |
| 10 | <refpurpose> |
| 11 | Constructs functions from segments of exponential curves. |
| 12 | </refpurpose> |
| 13 | </refnamediv> |
| 14 | |
| 15 | <refsect1> |
| 16 | <title>Description</title> |
| 17 | <para> |
| 18 | Constructs functions from segments of exponential curves. |
| 19 | </para> |
| 20 | </refsect1> |
| 21 | |
| 22 | <refsect1> |
| 23 | <title>Syntax</title> |
| 24 | <synopsis><command>f</command> # time size 5 a n1 b n2 c ...</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 power-of-2 plus 1 (see <link linkend="f"><citetitle>f statement</citetitle></link>). |
| 31 | </para> |
| 32 | |
| 33 | <para> |
| 34 | <emphasis>a, b, c,</emphasis> etc. -- ordinate values, in odd-numbered pfields p5, p7, p9, . . . These must be nonzero and must be alike in sign. |
| 35 | </para> |
| 36 | |
| 37 | <para> |
| 38 | <emphasis>n1, n2</emphasis>, etc. -- length of segment (no. of |
| 39 | storage locations), in even-numbered pfields. Cannot be |
| 40 | negative, but a zero is meaningful for specifying discontinuous |
| 41 | waveforms. The sum <emphasis>n1</emphasis> + |
| 42 | <emphasis>n2</emphasis> + .... will normally equal |
| 43 | <emphasis>size</emphasis> for fully specified functions. If the |
| 44 | sum is smaller, the function locations not included will be set |
| 45 | to zero; if the sum is greater, only the first |
| 46 | <emphasis>size</emphasis> locations will be stored. Note that |
| 47 | the values are rounded to integers before use. |
| 48 | </para> |
| 49 | |
| 50 | <note> |
| 51 | <title>Note</title> |
| 52 | <para> |
| 53 | <itemizedlist> |
| 54 | <listitem> |
| 55 | <para> |
| 56 | If p4 is positive, functions are post-normalized (rescaled to a maximum absolute value of 1 after generation). A negative p4 will cause rescaling to be skipped. |
| 57 | </para> |
| 58 | </listitem> |
| 59 | |
| 60 | <listitem> |
| 61 | <para> |
| 62 | Discrete-point linear interpolation implies an increase or decrease along a segment by equal differences between adjacent locations; exponential interpolation implies that the progression is by equal ratio. In both forms the interpolation from <emphasis>a</emphasis> to <emphasis>b</emphasis> is such as to assume that the value <emphasis>b</emphasis> will be attained in the n + 1th location. For discontinuous functions, and for the segment encompassing the end location, this value will not actually be reached, although it may eventually appear as a result of final scaling. |
| 63 | </para> |
| 64 | </listitem> |
| 65 | </itemizedlist> |
| 66 | </para> |
| 67 | </note> |
| 68 | </refsect1> |
| 69 | |
| 70 | <refsect1> |
| 71 | <title>Examples</title> |
| 72 | <para> |
| 73 | Here is a simple example of the GEN05 routine. It uses the files <ulink url="examples/gen05.csd"><citetitle>gen05.csd</citetitle></ulink>. |
| 74 | <example> |
| 75 | <title>An example of the GEN05 routine.</title> |
| 76 | <xi:include href="examples-xml/gen05.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 77 | </example> |
| 78 | |
| 79 | <textobject> |
| 80 | <phrase>These are the diagrams of the waveforms of the GEN05 routines, as used in the example:</phrase> |
| 81 | </textobject> |
| 82 | |
| 83 | <mediaobject> |
| 84 | <imageobject> |
| 85 | <imagedata fileref="images/gen05_1.png" format="PNG"/> |
| 86 | </imageobject> |
| 87 | |
| 88 | <textobject> |
| 89 | <phrase>f 2 0 129 5 1 100 0.0001 29 - waveform that goes over 100 points from 1 to 0.0001, stay there for 29 points</phrase> |
| 90 | </textobject> |
| 91 | |
| 92 | <caption> |
| 93 | <para>f 2 0 129 5 1 100 0.0001 29 - waveform that goes over 100 points from 1 to 0.0001, stay there for 29 points</para> |
| 94 | </caption> |
| 95 | </mediaobject> |
| 96 | |
| 97 | <mediaobject> |
| 98 | <imageobject> |
| 99 | <imagedata fileref="images/gen05_2.png" format="PNG"/> |
| 100 | </imageobject> |
| 101 | |
| 102 | <textobject> |
| 103 | <phrase>f 3 0 129 5 0.00001 87 1 22 .5 20 0.0001 - waveform that goes from 0.00001 to 1 in 87 points, then from 1 to .5 in 22 points and then from .5 to 0.0001 in 20 points</phrase> |
| 104 | </textobject> |
| 105 | |
| 106 | <caption> |
| 107 | <para>f 3 0 129 5 0.00001 87 1 22 .5 20 0.0001 - waveform that goes from 0.00001 to 1 in 87 points, then from 1 to .5 in 22 points and then from .5 to 0.0001 in 20 points</para> |
| 108 | </caption> |
| 109 | </mediaobject> |
| 110 | |
| 111 | </para> |
| 112 | </refsect1> |
| 113 | |
| 114 | <refsect1> |
| 115 | <title>See Also</title> |
| 116 | <para> |
| 117 | <link linkend="GEN06"><citetitle>GEN06</citetitle></link>, |
| 118 | <link linkend="GEN07"><citetitle>GEN07</citetitle></link>, and |
| 119 | <link linkend="GEN08"><citetitle>GEN08</citetitle></link> |
| 120 | </para> |
| 121 | </refsect1> |
| 122 | |
| 123 | </refentry> |