| 1 |
<refentry id="chuap"> |
| 2 |
<indexterm id="Indexchuap"><primary>chuap</primary></indexterm> |
| 3 |
<refentryinfo><title>Signal Generators:Models and Emulations</title></refentryinfo> |
| 4 |
<refmeta> |
| 5 |
<refentrytitle>chuap</refentrytitle> |
| 6 |
</refmeta> |
| 7 |
|
| 8 |
<refnamediv> |
| 9 |
<refname>chuap</refname> |
| 10 |
<refpurpose> |
| 11 |
Simulates Chua's oscillator, an LRC oscillator with an active resistor, proved capable of bifurcation and chaotic attractors, with k-rate control of circuit elements. |
| 12 |
</refpurpose> |
| 13 |
</refnamediv> |
| 14 |
|
| 15 |
<refsect1> |
| 16 |
<title>Description</title> |
| 17 |
<para>Plugin opcode in chua. This opcode is part of the plugin repository and has to be installed separately. |
| 18 |
The plugin repository can be found here: <ulink url="https://github.com/csound/plugins"><citetitle>https://github.com/csound/plugins</citetitle></ulink></para> |
| 19 |
<para> |
| 20 |
Simulates Chua's oscillator, an LRC oscillator with an active resistor, proved capable of bifurcation and chaotic attractors, with k-rate control of circuit elements. |
| 21 |
</para> |
| 22 |
</refsect1> |
| 23 |
|
| 24 |
<refsect1> |
| 25 |
<title>Syntax</title> |
| 26 |
<synopsis>aI3, aV2, aV1 <command>chuap</command> kL, kR0, kC2, kG, kGa, kGb, kE, kC1, iI3, iV2, iV1, ktime_step</synopsis> |
| 27 |
</refsect1> |
| 28 |
|
| 29 |
<refsect1> |
| 30 |
<title>Initialization</title> |
| 31 |
<para> |
| 32 |
<emphasis>iI3</emphasis> -- Initial current at G |
| 33 |
</para> |
| 34 |
<para> |
| 35 |
<emphasis>iV2</emphasis> -- Initial voltage at C2 |
| 36 |
</para> |
| 37 |
<para> |
| 38 |
<emphasis>iV1</emphasis> -- Initial voltage at C1 |
| 39 |
</para> |
| 40 |
</refsect1> |
| 41 |
|
| 42 |
<refsect1> |
| 43 |
<title>Performance</title> |
| 44 |
<para> |
| 45 |
<emphasis>kL</emphasis> -- Inductor L (L1 in the diagram) |
| 46 |
</para> |
| 47 |
<para> |
| 48 |
<emphasis>kR0</emphasis> -- Resistor R0 (R0 in the diagram) |
| 49 |
</para> |
| 50 |
<para> |
| 51 |
<emphasis>kC1</emphasis> -- Capacitor C1 |
| 52 |
</para> |
| 53 |
<para> |
| 54 |
<emphasis>kC2</emphasis> -- Capacitor C2 |
| 55 |
</para> |
| 56 |
<para> |
| 57 |
<emphasis>kG</emphasis> -- Resistor G (part of the active resistor, R1 in the diagram). The G parameter is the time step, which is needed to get the same slope of |
| 58 |
the piecewise discontinuity from Ga and Gb for all sampling rates. |
| 59 |
</para> |
| 60 |
<para> |
| 61 |
<emphasis>kGa</emphasis> -- Resistor V (nonlinearity term of the active resistor, one of the R2's in the diagram) |
| 62 |
</para> |
| 63 |
<para> |
| 64 |
<emphasis>kGb</emphasis> -- Resistor V (nonlinearity term of the active resistor, one of the R2's in the diagram) |
| 65 |
</para> |
| 66 |
<para> |
| 67 |
<emphasis>kE</emphasis> -- Size of the piecewise discontinuity simulating the active resistor |
| 68 |
</para> |
| 69 |
<para> |
| 70 |
<emphasis>ktime_step</emphasis> -- Delta time in the difference equation, can be used to more or less control pitch. |
| 71 |
</para> |
| 72 |
<para> |
| 73 |
<emphasis>Chua's oscillator</emphasis> is a simple LRC oscillator with an active resistor. The oscillator can be driven |
| 74 |
into period bifurcation, and thus to chaos, because of the nonlinear response of the active resistor. |
| 75 |
</para> |
| 76 |
<mediaobject> |
| 77 |
<imageobject> |
| 78 |
|
| 79 |
<imagedata fileref="images/Chua_circuit.png" format="PNG"/> |
| 80 |
</imageobject> |
| 81 |
<caption> |
| 82 |
<para>Diagram of Chua's Oscillator Circuit</para> |
| 83 |
</caption> |
| 84 |
</mediaobject> |
| 85 |
<para> |
| 86 |
The circuit is described by a set of three ordinary differential equations called Chua's equations: |
| 87 |
</para> |
| 88 |
<literallayout> |
| 89 |
dI3 R0 1 |
| 90 |
--- = - -- I3 - - V2 |
| 91 |
dt L L |
| 92 |
|
| 93 |
dV2 1 G |
| 94 |
--- = -- I3 - -- (V2 - V1) |
| 95 |
dt C2 C2 |
| 96 |
|
| 97 |
dV1 G 1 |
| 98 |
--- = -- (V2 - V1) - -- f(V1) |
| 99 |
dt C1 C1 |
| 100 |
</literallayout> |
| 101 |
<para> |
| 102 |
where f() is a piecewise discontinuity simulating the active resistor: |
| 103 |
</para> |
| 104 |
<literallayout> |
| 105 |
f(V1) = Gb V1 + - (Ga - Gb)(|V1 + E| - |V1 - E|) |
| 106 |
</literallayout> |
| 107 |
<para>A solution of these equations (I3,V2,V1)(t) starting from an initial state (I3,V2,V1)(0) is called a trajectory of Chua's |
| 108 |
oscillator. The Csound implementation is a difference equation simulation of Chua's oscillator with Runge-Kutta integration. |
| 109 |
</para> |
| 110 |
<note> |
| 111 |
<para>This algorithm uses internal non linear feedback loops which causes audio result to depend on the orchestra |
| 112 |
sampling rate. For example, if you develop a project with <emphasis>sr</emphasis>=48000Hz and if you want to produce |
| 113 |
an audio CD from it, you should record a file with <emphasis>sr</emphasis>=48000Hz and then downsample the file to 44100Hz |
| 114 |
using the <link linkend="src_conv"><citetitle>src_conv</citetitle></link> utility.</para> |
| 115 |
</note> |
| 116 |
<warning> |
| 117 |
Be careful! Some sets of parameters will produce amplitude spikes or positive feedback that could damage your speakers. |
| 118 |
</warning> |
| 119 |
</refsect1> |
| 120 |
|
| 121 |
<refsect1> |
| 122 |
<title>Examples</title> |
| 123 |
<para> |
| 124 |
Here is an example of the chuap opcode. It uses the file <ulink url="examples/chuap.csd"><citetitle>chuap.csd</citetitle></ulink>. |
| 125 |
<example> |
| 126 |
<title>Example of the chuap opcode.</title> |
| 127 |
<xi:include href="examples-xml/chuap.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 128 |
</example> |
| 129 |
</para> |
| 130 |
</refsect1> |
| 131 |
|
| 132 |
<refsect1> |
| 133 |
<title>See Also</title> |
| 134 |
<para> |
| 135 |
<link linkend="SiggenModels"><citetitle>Models and Emulations</citetitle></link> |
| 136 |
</para> |
| 137 |
</refsect1> |
| 138 |
|
| 139 |
<refsect1> |
| 140 |
<title>Credits</title> |
| 141 |
<para> |
| 142 |
<simplelist> |
| 143 |
<member>Inventor of Chua's oscillator: <ulink url="http://www.eecs.berkeley.edu/~chua"><citetitle>Leon O. Chua</citetitle></ulink></member> |
| 144 |
<member>Author of MATLAB simulation: James Patrick McEvoy <ulink url="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=3541"><citetitle>MATLAB Adventures in Bifurcations and Chaos (ABC++)</citetitle></ulink></member> |
| 145 |
<member>Author of Csound port: Michael Gogins</member> |
| 146 |
</simplelist> |
| 147 |
</para> |
| 148 |
<para>New in Csound version 5.09</para> |
| 149 |
<para>Note added by &namepinot;, August 2009</para> |
| 150 |
</refsect1> |
| 151 |
</refentry> |