| 1 | |
| 2 | <refentry id="resonz"> |
| 3 | <indexterm id="IndexResonz"><primary>resonz</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Modifiers:Standard Filters:Resonant</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>resonz</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>resonz</refname> |
| 13 | <refpurpose> |
| 14 | A bandpass filter with variable frequency response. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Implementations of a second-order, two-pole two-zero bandpass filter with variable frequency response. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>ares <command>resonz</command> asig, xcf, xbw [, iscl] [, iskip]</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Initialization</title> |
| 32 | <para> |
| 33 | The optional initialization variables for <emphasis>resonr</emphasis> and <emphasis>resonz</emphasis> are identical to the i-time variables for <link linkend="reson"><citetitle>reson</citetitle></link>. |
| 34 | </para> |
| 35 | |
| 36 | <para> |
| 37 | <emphasis>iskip</emphasis> -- initial disposition of internal data space. Since filtering incorporates a feedback loop of previous output, the initial status of the storage space used is significant. A zero value will clear the space; a non-zero value will allow previous information to remain. The default value is 0. |
| 38 | </para> |
| 39 | |
| 40 | <para> |
| 41 | <emphasis>iscl</emphasis> -- coded scaling factor for resonators. A value of 1 signifies a peak response factor of 1, i.e. all frequencies other than <emphasis>kcf</emphasis> are attenuated in accordance with the (normalized) response curve. A value of 2 raises the response factor so that its overall RMS value equals 1. This intended equalization of input and output power assumes all frequencies are physically present; hence it is most applicable to white noise. A zero value signifies no scaling of the signal, leaving that to some later adjustment (see <link linkend="balance"><citetitle>balance</citetitle></link>). The default value is 0. |
| 42 | </para> |
| 43 | </refsect1> |
| 44 | |
| 45 | <refsect1> |
| 46 | <title>Performance</title> |
| 47 | <para> |
| 48 | <emphasis>resonr</emphasis> and <emphasis>resonz</emphasis> are variations of the classic two-pole bandpass resonator (<link linkend="reson"><citetitle>reson</citetitle></link>). Both filters have two zeroes in their transfer functions, in addition to the two poles. <emphasis>resonz</emphasis> has its zeroes located at z = 1 and z = -1. <emphasis>resonr</emphasis> has its zeroes located at +sqrt(<emphasis>R</emphasis>) and -sqrt(<emphasis>R</emphasis>), where <emphasis>R</emphasis> is the radius of the poles in the complex z-plane. The addition of zeroes to <emphasis>resonr</emphasis> and <emphasis>resonz</emphasis> results in the improved selectivity of the magnitude response of these filters at cutoff frequencies close to 0, at the expense of less selectivity of frequencies above the cutoff peak. |
| 49 | </para> |
| 50 | |
| 51 | <para> |
| 52 | <emphasis>resonr</emphasis> and <emphasis>resonz</emphasis> are very close to constant-gain as the center frequency is swept, resulting in a more efficient control of the magnitude response than with traditional two-pole resonators such as <emphasis>reson</emphasis>. |
| 53 | </para> |
| 54 | |
| 55 | <para> |
| 56 | <emphasis>resonr</emphasis> and <emphasis>resonz</emphasis> produce a sound that is considerably different from <emphasis>reson</emphasis>, especially for lower center frequencies; trial and error is the best way of determining which resonator is best suited for a particular application. |
| 57 | </para> |
| 58 | |
| 59 | <para> |
| 60 | <emphasis>asig</emphasis> -- input signal to be filtered |
| 61 | </para> |
| 62 | |
| 63 | <para> |
| 64 | <emphasis>xcf</emphasis> -- cutoff or resonant frequency of the filter, measured in Hz |
| 65 | </para> |
| 66 | |
| 67 | <para> |
| 68 | <emphasis>xbw</emphasis> -- bandwidth of the filter (the Hz difference between the upper and lower half-power points) |
| 69 | </para> |
| 70 | </refsect1> |
| 71 | |
| 72 | <refsect1> |
| 73 | <title>Technical History</title> |
| 74 | <para> |
| 75 | <emphasis>resonr</emphasis> and <emphasis>resonz</emphasis> were originally described in an article by Julius O. Smith and James B. Angell.<superscript>1</superscript> Smith and Angell recommended the <emphasis>resonz</emphasis> form (zeros at +1 and -1) when computational efficiency was the main concern, as it has one less multiply per sample, while <emphasis>resonr</emphasis> (zeroes at + and - the square root of the pole radius R) was recommended for situations when a perfectly constant-gain center peak was required. |
| 76 | </para> |
| 77 | |
| 78 | <para> |
| 79 | Ken Steiglitz, in a later article <superscript>2</superscript>, demonstrated that <emphasis>resonz</emphasis> had constant gain at the true peak of the filter, as opposed to <emphasis>resonr</emphasis>, which displayed constant gain at the pole angle. Steiglitz also recommended <emphasis>resonz</emphasis> for its sharper notches in the gain curve at zero and Nyquist frequency. Steiglitz's recent book <superscript>3</superscript> features a thorough technical discussion of <emphasis>reson</emphasis> and <emphasis>resonz</emphasis>, while Dodge and Jerse's textbook <superscript>4</superscript> illustrates the differences in the response curves of <emphasis>reson</emphasis> and <emphasis>resonz</emphasis>. |
| 80 | </para> |
| 81 | </refsect1> |
| 82 | |
| 83 | <refsect1> |
| 84 | <title>Examples</title> |
| 85 | <para> |
| 86 | Here is an example of the resonr and resonz opcodes. It uses the file <ulink url="examples/resonr.csd"><citetitle>resonr.csd</citetitle></ulink>. |
| 87 | <example> |
| 88 | <title>Example of the resonr and resonz opcodes.</title> |
| 89 | <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> |
| 90 | <xi:include href="examples-xml/resonr.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 91 | </example> |
| 92 | </para> |
| 93 | </refsect1> |
| 94 | |
| 95 | <refsect1> |
| 96 | <title>References</title> |
| 97 | <para> |
| 98 | <orderedlist> |
| 99 | <listitem> |
| 100 | <para> |
| 101 | Smith, Julius O. and Angell, James B., "A Constant-Gain Resonator Tuned by a Single Coefficient," <emphasis>Computer Music Journal</emphasis>, vol. 6, no. 4, pp. 36-39, Winter 1982. |
| 102 | </para> |
| 103 | </listitem> |
| 104 | |
| 105 | <listitem> |
| 106 | <para> |
| 107 | Steiglitz, Ken, "A Note on Constant-Gain Digital Resonators," <emphasis>Computer Music Journal</emphasis>, vol. 18, no. 4, pp. 8-10, Winter 1994. |
| 108 | </para> |
| 109 | </listitem> |
| 110 | |
| 111 | <listitem> |
| 112 | <para> |
| 113 | Ken Steiglitz, <emphasis>A Digital Signal Processing Primer, with Applications to Digital Audio and Computer Music</emphasis>. Addison-Wesley Publishing Company, Menlo Park, CA, 1996. |
| 114 | </para> |
| 115 | </listitem> |
| 116 | |
| 117 | <listitem> |
| 118 | <para> |
| 119 | Dodge, Charles and Jerse, Thomas A., <emphasis>Computer Music: Synthesis, Composition, and Performance</emphasis>. New York: Schirmer Books, 1997, 2nd edition, pp. 211-214. |
| 120 | </para> |
| 121 | </listitem> |
| 122 | </orderedlist> |
| 123 | </para> |
| 124 | </refsect1> |
| 125 | |
| 126 | <refsect1> |
| 127 | <title>See also</title> |
| 128 | <para><link linkend="SigmodStandard"><citetitle>Standard Filters: Resonant Low-pass filters</citetitle></link></para> |
| 129 | </refsect1> |
| 130 | |
| 131 | <refsect1> |
| 132 | <title>Credits</title> |
| 133 | <para> |
| 134 | <simplelist> |
| 135 | <member>Author: &namesean;</member> |
| 136 | <member>Seattle, Washington</member> |
| 137 | <member>1999</member> |
| 138 | </simplelist> |
| 139 | </para> |
| 140 | |
| 141 | <para>New in Csound version 3.55</para> |
| 142 | <para>Audio rate parameters introduced in version 6.02</para> |
| 143 | <para>November 2013.</para> |
| 144 | </refsect1> |
| 145 | </refentry> |