Debian Codegraph @

opcodes/pitchamdf.xml

raw symbols SCIP
1
2 <refentry id="pitchamdf">
3 <indexterm id="IndexPitchamdf"><primary>pitchamdf</primary></indexterm>
4 <refentryinfo><title>Instrument Control:Sensing and Control</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>pitchamdf</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>pitchamdf</refname>
13
14 <refpurpose>
15 Follows the pitch of a signal based on the AMDF method.
16 </refpurpose>
17 </refnamediv>
18
19 <refsect1>
20 <title>Description</title>
21 <para>
22 Follows the pitch of a signal based on the AMDF method (Average Magnitude Difference Function). Outputs pitch and amplitude tracking signals. The method is quite fast and should run in realtime. This technique usually works best for monophonic signals.
23 </para>
24 </refsect1>
25
26 <refsect1>
27 <title>Syntax</title>
28 <synopsis>kcps, krms <command>pitchamdf</command> asig, imincps, imaxcps [, icps] [, imedi] \
29 [, idowns] [, iexcps] [, irmsmedi]</synopsis>
30 </refsect1>
31
32 <refsect1>
33 <title>Initialization</title>
34 <para>
35 <emphasis>imincps</emphasis> -- estimated minimum frequency (expressed in Hz) present in the signal
36 </para>
37
38 <para>
39 <emphasis>imaxcps</emphasis> -- estimated maximum frequency present in the signal
40 </para>
41
42 <para>
43 <emphasis>icps</emphasis> (optional, default=0) -- estimated initial frequency of the signal. If 0, icps = (<emphasis>imincps</emphasis>+<emphasis>imaxcps</emphasis>) / 2. The default is 0.
44 </para>
45
46 <para>
47 <emphasis>imedi</emphasis> (optional, default=1) -- size of median filter applied to the output <emphasis>kcps</emphasis>. The size of the filter will be <emphasis>imedi</emphasis>*2+1. If 0, no median filtering will be applied. The default is 1.
48 </para>
49
50 <para>
51 <emphasis>idowns</emphasis> (optional, default=1) -- downsampling factor for <emphasis>asig</emphasis>. Must be an integer. A factor of <emphasis>idowns</emphasis> &gt; 1 results in faster performance, but may result in worse pitch detection. Useful range is 1 - 4. The default is 1.
52 </para>
53
54 <para>
55 <emphasis>iexcps</emphasis> (optional, default=0) -- how frequently pitch analysis is executed, expressed in Hz. If 0, <emphasis>iexcps</emphasis> is set to <emphasis>imincps</emphasis>. This is usually reasonable, but experimentation with other values may lead to better results. Default is 0.
56 </para>
57
58 <para>
59 <emphasis>irmsmedi</emphasis> (optional, default=0) -- size of median filter applied to the output <emphasis>krms</emphasis>. The size of the filter will be <emphasis>irmsmedi</emphasis>*2+1. If 0, no median filtering will be applied. The default is 0.
60 </para>
61 </refsect1>
62
63 <refsect1>
64 <title>Performance</title>
65 <para>
66 <emphasis>kcps</emphasis> -- pitch tracking output
67 </para>
68
69 <para>
70 <emphasis>krms</emphasis> -- amplitude tracking output
71 </para>
72
73 <para>
74 <emphasis>pitchamdf</emphasis> usually works best for monophonic signals, and is quite reliable if appropriate initial values are chosen. Setting <emphasis>imincps</emphasis> and <emphasis>imaxcps</emphasis> as narrow as possible to the range of the signal's pitch, results in better detection and performance.
75 </para>
76
77 <para>
78 Because this process can only detect pitch after an initial delay, setting <emphasis>icps</emphasis> close to the signal's real initial pitch prevents spurious data at the beginning.
79 </para>
80
81 <para>
82 The median filter prevents <emphasis>kcps</emphasis> from jumping. Experiment to determine the optimum value for <emphasis>imedi</emphasis> for a given signal.
83 </para>
84
85 <para>
86 Other initial values can usually be left at the default settings. Lowpass filtering of <emphasis>asig</emphasis> before passing it to <emphasis>pitchamdf</emphasis>, can improve performance, especially with complex waveforms.
87 </para>
88 </refsect1>
89
90 <refsect1>
91 <title>Examples</title>
92 <para>
93 Here is an example of the pitchamdf opcode. It uses the file <ulink url="examples/pitchamdf.csd"><citetitle>pitchamdf.csd</citetitle></ulink>.
94
95 <example>
96 <title>Example of the pitchamdf opcode.</title>
97
98
99
100 <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>
101 <xi:include href="examples-xml/pitchamdf.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
102 </example>
103 </para>
104 </refsect1>
105
106 <refsect1>
107 <title>See also</title>
108 <para><link linkend="ControlSensing"><citetitle>Sensing and Control: Tempo and Pitch estimation</citetitle></link></para>
109 </refsect1>
110
111 <refsect1>
112 <title>Credits</title>
113 <para>
114 <simplelist>
115 <member>Author: Peter Neub&auml;cker</member>
116 <member>Munich, Germany</member>
117 <member>August 1999</member>
118 </simplelist>
119 </para>
120
121 <para>New in Csound version 3.59</para>
122 </refsect1>
123 </refentry>