3
<indexterm id="IndexDiff"><primary>diff</primary></indexterm>
4
<refentryinfo><title>Signal Modifiers:Sample Level Operators</title></refentryinfo>
6
<refentrytitle>diff</refentrytitle>
12
<refname>diff</refname>
14
Modify a signal by differentiation.
19
<title>Description</title>
21
Modify a signal by differentiation.
27
<synopsis>ares <command>diff</command> asig [, iskip]</synopsis>
29
<synopsis>kres <command>diff</command> ksig [, iskip]</synopsis>
33
<title>Initialization</title>
35
<emphasis>iskip</emphasis> (optional) -- initial disposition of internal save space (see <link linkend="reson"><citetitle>reson</citetitle></link>). The default value is 0.
40
<title>Performance</title>
42
<link linkend="integ"><citetitle>integ</citetitle></link> and <emphasis>diff</emphasis> perform integration and differentiation on an input control signal or audio signal. Each is the converse of the other, and applying both will reconstruct the original signal. Since these units are special cases of low-pass and high-pass filters, they produce a scaled (and phase shifted) output that is frequency-dependent. Thus <emphasis>diff</emphasis> of a sine produces a cosine, with amplitude <emphasis>2 * sin(pi * Hz / <emphasis>sr</emphasis>)</emphasis> that of the original (for each component partial); <emphasis>integ</emphasis> will inversely affect the magnitudes of its component inputs. With this understanding, these units can provide useful signal modification.
47
<title>Examples</title>
49
Here is an example of the diff opcode. It uses the file <ulink url="examples/diff.csd"><citetitle>diff.csd</citetitle></ulink>.
52
<title>Example of the diff opcode.</title>
56
<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>
57
<xi:include href="examples-xml/diff.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
63
<title>See Also</title>
65
<link linkend="downsamp"><citetitle>downsamp</citetitle></link>,
66
<link linkend="integ"><citetitle>integ</citetitle></link>,
67
<link linkend="interp"><citetitle>interp</citetitle></link>,
68
<link linkend="samphold"><citetitle>samphold</citetitle></link>,
69
<link linkend="upsamp"><citetitle>upsamp</citetitle></link>
74
<title>Credits</title>
75
<para>Example written by &namekevin;.</para>
3
<indexterm id="IndexDiff"><primary>diff</primary></indexterm>
4
<refentryinfo><title>Signal Modifiers:Sample Level Operators</title></refentryinfo>
6
<refentrytitle>diff</refentrytitle>
10
<refname>diff</refname>
12
Modify a signal by differentiation.
17
<title>Description</title>
19
Modify a signal by differentiation.
25
<synopsis>ares <command>diff</command> asig [, iskip]</synopsis>
27
<synopsis>kres <command>diff</command> ksig [, iskip]</synopsis>
31
<title>Initialization</title>
33
<emphasis>iskip</emphasis> (optional) -- initial disposition of internal save space (see <link linkend="reson"><citetitle>reson</citetitle></link>). The default value is 0.
38
<title>Performance</title>
40
<link linkend="integ"><citetitle>integ</citetitle></link> and <emphasis>diff</emphasis> perform integration and differentiation on an input control signal or audio signal. Each is the converse of the other, and applying both will reconstruct the original signal. Since these units are special cases of low-pass and high-pass filters, they produce a scaled (and phase shifted) output that is frequency-dependent. Thus <emphasis>diff</emphasis> of a sine produces a cosine, with amplitude 2 * <emphasis>pi</emphasis> * Hz / <emphasis>sr</emphasis> that of the original (for each component partial); <emphasis>integ</emphasis> will inversely affect the magnitudes of its component inputs. With this understanding, these units can provide useful signal modification.
45
<title>Examples</title>
47
Here is an example of the diff opcode. It uses the file <ulink url="examples/diff.csd"><citetitle>diff.csd</citetitle></ulink>.
49
<title>Example of the diff opcode.</title>
50
<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>
51
<xi:include href="examples-xml/diff.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
57
<title>See Also</title>
59
<link linkend="downsamp"><citetitle>downsamp</citetitle></link>,
60
<link linkend="integ"><citetitle>integ</citetitle></link>,
61
<link linkend="interp"><citetitle>interp</citetitle></link>,
62
<link linkend="samphold"><citetitle>samphold</citetitle></link>,
63
<link linkend="upsamp"><citetitle>upsamp</citetitle></link>