comparison code-doc/ZeroCrossing_8cpp-source.html @ 35:0976232e353b website

* Update for 2.1 release; add wiki link
author cannam
date Fri, 25 Sep 2009 15:40:18 +0000
parents cc0be37dc9d3
children
comparison
equal deleted inserted replaced
34:4b4db9230e94 35:0976232e353b
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3 <title>VampPluginSDK: ZeroCrossing.cpp Source File</title> 3 <title>VampPluginSDK: ZeroCrossing.cpp Source File</title>
4 <link href="tabs.css" rel="stylesheet" type="text/css">
4 <link href="doxygen.css" rel="stylesheet" type="text/css"> 5 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 <link href="tabs.css" rel="stylesheet" type="text/css">
6 </head><body> 6 </head><body>
7 <!-- Generated by Doxygen 1.5.6 --> 7 <!-- Generated by Doxygen 1.5.8 -->
8 <div class="navigation" id="top"> 8 <div class="navigation" id="top">
9 <div class="tabs"> 9 <div class="tabs">
10 <ul> 10 <ul>
11 <li><a href="main.html"><span>Main&nbsp;Page</span></a></li> 11 <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
12 <li><a href="namespaces.html"><span>Namespaces</span></a></li> 12 <li><a href="namespaces.html"><span>Namespaces</span></a></li>
13 <li><a href="annotated.html"><span>Classes</span></a></li> 13 <li><a href="annotated.html"><span>Classes</span></a></li>
14 <li class="current"><a href="files.html"><span>Files</span></a></li> 14 <li class="current"><a href="files.html"><span>Files</span></a></li>
15 <li><a href="dirs.html"><span>Directories</span></a></li> 15 <li><a href="dirs.html"><span>Directories</span></a></li>
16 </ul>
17 </div>
18 <div class="tabs">
19 <ul>
20 <li><a href="files.html"><span>File&nbsp;List</span></a></li>
21 <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
16 </ul> 22 </ul>
17 </div> 23 </div>
18 <div class="navpath"><a class="el" href="dir_35887283b966ca996e4ff77f459c38ce.html">examples</a> 24 <div class="navpath"><a class="el" href="dir_35887283b966ca996e4ff77f459c38ce.html">examples</a>
19 </div> 25 </div>
20 </div> 26 </div>
132 <a name="l00111"></a><a class="code" href="classZeroCrossing.html#c9d590a6feb1fc9a37d7892aefe2b688">00111</a> <a class="code" href="classZeroCrossing.html#c9d590a6feb1fc9a37d7892aefe2b688" title="Get the outputs of this plugin.">ZeroCrossing::getOutputDescriptors</a>()<span class="keyword"> const</span> 138 <a name="l00111"></a><a class="code" href="classZeroCrossing.html#c9d590a6feb1fc9a37d7892aefe2b688">00111</a> <a class="code" href="classZeroCrossing.html#c9d590a6feb1fc9a37d7892aefe2b688" title="Get the outputs of this plugin.">ZeroCrossing::getOutputDescriptors</a>()<span class="keyword"> const</span>
133 <a name="l00112"></a>00112 <span class="keyword"></span>{ 139 <a name="l00112"></a>00112 <span class="keyword"></span>{
134 <a name="l00113"></a>00113 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">OutputList</a> list; 140 <a name="l00113"></a>00113 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">OutputList</a> list;
135 <a name="l00114"></a>00114 141 <a name="l00114"></a>00114
136 <a name="l00115"></a>00115 <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html">OutputDescriptor</a> zc; 142 <a name="l00115"></a>00115 <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html">OutputDescriptor</a> zc;
137 <a name="l00116"></a>00116 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e2c893ddb1860589517ab7eaa989a18b" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"counts"</span>; 143 <a name="l00116"></a>00116 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#2e6f77bcb12d4c95da25348ac85b8696" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"counts"</span>;
138 <a name="l00117"></a>00117 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#b824b2b34ee50f897a30901c620e8d87" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Zero Crossing Counts"</span>; 144 <a name="l00117"></a>00117 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0992e05ea70425878365ba85663400a7" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Zero Crossing Counts"</span>;
139 <a name="l00118"></a>00118 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f9b4fe8f78e7126ead820ba5dc55efd1" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"The number of zero crossing points per processing block"</span>; 145 <a name="l00118"></a>00118 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#8b44602d8ccea8bb862fd766e74efa1c" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"The number of zero crossing points per processing block"</span>;
140 <a name="l00119"></a>00119 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#a057a8833fa037f06ac9f7b85b85d5e4" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">"crossings"</span>; 146 <a name="l00119"></a>00119 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#52f4b3d8d7070cc9c5ab4aa6ff0c01a0" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">"crossings"</span>;
141 <a name="l00120"></a>00120 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f0e577e1a256ff6eed6ea42133fec77d" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a> = <span class="keyword">true</span>; 147 <a name="l00120"></a>00120 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0653d3a85fdc226e60fd5e612b399e0c" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a> = <span class="keyword">true</span>;
142 <a name="l00121"></a>00121 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#fdd006959a995e40ef7d565a3a4df6dc" title="The number of values per result of the output.">binCount</a> = 1; 148 <a name="l00121"></a>00121 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#238a4781ebb4151832cbf521feb0fedc" title="The number of values per result of the output.">binCount</a> = 1;
143 <a name="l00122"></a>00122 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e9ccb65f99f477096b65dd031f4c5e31" title="True if the results in each output bin fall within a fixed numeric range (minimum...">hasKnownExtents</a> = <span class="keyword">false</span>; 149 <a name="l00122"></a>00122 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#4b8d0d88bee613709e91b48402e28c8e" title="True if the results in each output bin fall within a fixed numeric range (minimum...">hasKnownExtents</a> = <span class="keyword">false</span>;
144 <a name="l00123"></a>00123 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#1b4858928d23bfd7d5bc557c82a83fb4" title="True if the output values are quantized to a particular resolution.">isQuantized</a> = <span class="keyword">true</span>; 150 <a name="l00123"></a>00123 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#43673cd31b2b65af427a8e8b8746b6e8" title="True if the output values are quantized to a particular resolution.">isQuantized</a> = <span class="keyword">true</span>;
145 <a name="l00124"></a>00124 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#3bed37153067b625b95acb40b60dbf0b" title="Quantization resolution of the output values (e.g.">quantizeStep</a> = 1.0; 151 <a name="l00124"></a>00124 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#674cd333889514cf8408c18762fede12" title="Quantization resolution of the output values (e.g.">quantizeStep</a> = 1.0;
146 <a name="l00125"></a>00125 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0d1194980d44e31b25ef3b4b070d6b5d" title="Positioning in time of the output results.">sampleType</a> = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448c0459d5d0d2198d21e8bc90abe4fdccca" title="Results from each process() align with that call&amp;#39;s block start.">OutputDescriptor::OneSamplePerStep</a>; 152 <a name="l00125"></a>00125 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#3cd2e0b7a6da19c32bbb6809a83d9adf" title="Positioning in time of the output results.">sampleType</a> = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448c8915f78de285a79dd415e0c6012d1ead" title="Results from each process() align with that call&amp;#39;s block start.">OutputDescriptor::OneSamplePerStep</a>;
147 <a name="l00126"></a>00126 list.push_back(zc); 153 <a name="l00126"></a>00126 list.push_back(zc);
148 <a name="l00127"></a>00127 154 <a name="l00127"></a>00127
149 <a name="l00128"></a>00128 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e2c893ddb1860589517ab7eaa989a18b" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"zerocrossings"</span>; 155 <a name="l00128"></a>00128 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#2e6f77bcb12d4c95da25348ac85b8696" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"zerocrossings"</span>;
150 <a name="l00129"></a>00129 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#b824b2b34ee50f897a30901c620e8d87" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Zero Crossings"</span>; 156 <a name="l00129"></a>00129 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0992e05ea70425878365ba85663400a7" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Zero Crossings"</span>;
151 <a name="l00130"></a>00130 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f9b4fe8f78e7126ead820ba5dc55efd1" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"The locations of zero crossing points"</span>; 157 <a name="l00130"></a>00130 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#8b44602d8ccea8bb862fd766e74efa1c" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"The locations of zero crossing points"</span>;
152 <a name="l00131"></a>00131 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#a057a8833fa037f06ac9f7b85b85d5e4" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">""</span>; 158 <a name="l00131"></a>00131 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#52f4b3d8d7070cc9c5ab4aa6ff0c01a0" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">""</span>;
153 <a name="l00132"></a>00132 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f0e577e1a256ff6eed6ea42133fec77d" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a> = <span class="keyword">true</span>; 159 <a name="l00132"></a>00132 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0653d3a85fdc226e60fd5e612b399e0c" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a> = <span class="keyword">true</span>;
154 <a name="l00133"></a>00133 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#fdd006959a995e40ef7d565a3a4df6dc" title="The number of values per result of the output.">binCount</a> = 0; 160 <a name="l00133"></a>00133 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#238a4781ebb4151832cbf521feb0fedc" title="The number of values per result of the output.">binCount</a> = 0;
155 <a name="l00134"></a>00134 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0d1194980d44e31b25ef3b4b070d6b5d" title="Positioning in time of the output results.">sampleType</a> = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448cdea995a737867f7b22b52f1c43c5432e" title="Results are unevenly spaced and have individual timestamps.">OutputDescriptor::VariableSampleRate</a>; 161 <a name="l00134"></a>00134 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#3cd2e0b7a6da19c32bbb6809a83d9adf" title="Positioning in time of the output results.">sampleType</a> = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448c95be613508cf4009a7dc2f70ddf99547" title="Results are unevenly spaced and have individual timestamps.">OutputDescriptor::VariableSampleRate</a>;
156 <a name="l00135"></a>00135 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#dd0cbbdfa9c91764037c39365b1d42af" title="Sample rate of the output results, as samples per second.">sampleRate</a> = <a class="code" href="classVamp_1_1Plugin.html#59b9dd82a4f4eb946cd0474cc81abc23">m_inputSampleRate</a>; 162 <a name="l00135"></a>00135 zc.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e49cc87dcb0f09b59feb85d2b78e80ef" title="Sample rate of the output results, as samples per second.">sampleRate</a> = <a class="code" href="classVamp_1_1Plugin.html#59b9dd82a4f4eb946cd0474cc81abc23">m_inputSampleRate</a>;
157 <a name="l00136"></a>00136 list.push_back(zc); 163 <a name="l00136"></a>00136 list.push_back(zc);
158 <a name="l00137"></a>00137 164 <a name="l00137"></a>00137
159 <a name="l00138"></a>00138 <span class="keywordflow">return</span> list; 165 <a name="l00138"></a>00138 <span class="keywordflow">return</span> list;
160 <a name="l00139"></a>00139 } 166 <a name="l00139"></a>00139 }
161 <a name="l00140"></a>00140 167 <a name="l00140"></a>00140
187 <a name="l00166"></a>00166 } 193 <a name="l00166"></a>00166 }
188 <a name="l00167"></a>00167 194 <a name="l00167"></a>00167
189 <a name="l00168"></a>00168 <span class="keywordflow">if</span> (crossing) { 195 <a name="l00168"></a>00168 <span class="keywordflow">if</span> (crossing) {
190 <a name="l00169"></a>00169 ++count; 196 <a name="l00169"></a>00169 ++count;
191 <a name="l00170"></a>00170 <a class="code" href="structVamp_1_1Plugin_1_1Feature.html">Feature</a> feature; 197 <a name="l00170"></a>00170 <a class="code" href="structVamp_1_1Plugin_1_1Feature.html">Feature</a> feature;
192 <a name="l00171"></a>00171 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#98907091d0b6a589720ae35ae588a82b" title="True if an output feature has its own timestamp.">hasTimestamp</a> = <span class="keyword">true</span>; 198 <a name="l00171"></a>00171 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#116bb1b3420a067fc1290b75982fdf62" title="True if an output feature has its own timestamp.">hasTimestamp</a> = <span class="keyword">true</span>;
193 <a name="l00172"></a>00172 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#caa605f36839c07e76f4882f5e22d8d7" title="Timestamp of the output feature.">timestamp</a> = timestamp + 199 <a name="l00172"></a>00172 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#aaf212bd458dc5e6f441bf7606121311" title="Timestamp of the output feature.">timestamp</a> = timestamp +
194 <a name="l00173"></a>00173 <a class="code" href="structVamp_1_1RealTime.html#939b4b1d1ca190db69a418883f16ce8a" title="Convert a sample frame at the given sample rate into a RealTime.">Vamp::RealTime::frame2RealTime</a>(i, (<span class="keywordtype">size_t</span>)<a class="code" href="classVamp_1_1Plugin.html#59b9dd82a4f4eb946cd0474cc81abc23">m_inputSampleRate</a>); 200 <a name="l00173"></a>00173 <a class="code" href="structVamp_1_1RealTime.html#939b4b1d1ca190db69a418883f16ce8a" title="Convert a sample frame at the given sample rate into a RealTime.">Vamp::RealTime::frame2RealTime</a>(i, (<span class="keywordtype">size_t</span>)<a class="code" href="classVamp_1_1Plugin.html#59b9dd82a4f4eb946cd0474cc81abc23">m_inputSampleRate</a>);
195 <a name="l00174"></a>00174 returnFeatures[1].push_back(feature); 201 <a name="l00174"></a>00174 returnFeatures[1].push_back(feature);
196 <a name="l00175"></a>00175 } 202 <a name="l00175"></a>00175 }
197 <a name="l00176"></a>00176 203 <a name="l00176"></a>00176
198 <a name="l00177"></a>00177 prev = sample; 204 <a name="l00177"></a>00177 prev = sample;
199 <a name="l00178"></a>00178 } 205 <a name="l00178"></a>00178 }
200 <a name="l00179"></a>00179 206 <a name="l00179"></a>00179
201 <a name="l00180"></a>00180 <a class="code" href="classZeroCrossing.html#0f2d9f2cab0a8a30344e1f2c0ebb8ee8">m_previousSample</a> = prev; 207 <a name="l00180"></a>00180 <a class="code" href="classZeroCrossing.html#0f2d9f2cab0a8a30344e1f2c0ebb8ee8">m_previousSample</a> = prev;
202 <a name="l00181"></a>00181 208 <a name="l00181"></a>00181
203 <a name="l00182"></a>00182 <a class="code" href="structVamp_1_1Plugin_1_1Feature.html">Feature</a> feature; 209 <a name="l00182"></a>00182 <a class="code" href="structVamp_1_1Plugin_1_1Feature.html">Feature</a> feature;
204 <a name="l00183"></a>00183 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#98907091d0b6a589720ae35ae588a82b" title="True if an output feature has its own timestamp.">hasTimestamp</a> = <span class="keyword">false</span>; 210 <a name="l00183"></a>00183 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#116bb1b3420a067fc1290b75982fdf62" title="True if an output feature has its own timestamp.">hasTimestamp</a> = <span class="keyword">false</span>;
205 <a name="l00184"></a>00184 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>.push_back(count); 211 <a name="l00184"></a>00184 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>.push_back(<span class="keywordtype">float</span>(count));
206 <a name="l00185"></a>00185 212 <a name="l00185"></a>00185
207 <a name="l00186"></a>00186 returnFeatures[0].push_back(feature); 213 <a name="l00186"></a>00186 returnFeatures[0].push_back(feature);
208 <a name="l00187"></a>00187 <span class="keywordflow">return</span> returnFeatures; 214 <a name="l00187"></a>00187 <span class="keywordflow">return</span> returnFeatures;
209 <a name="l00188"></a>00188 } 215 <a name="l00188"></a>00188 }
210 <a name="l00189"></a>00189 216 <a name="l00189"></a>00189
213 <a name="l00192"></a>00192 { 219 <a name="l00192"></a>00192 {
214 <a name="l00193"></a>00193 <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a>(); 220 <a name="l00193"></a>00193 <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a>();
215 <a name="l00194"></a>00194 } 221 <a name="l00194"></a>00194 }
216 <a name="l00195"></a>00195 222 <a name="l00195"></a>00195
217 </pre></div></div> 223 </pre></div></div>
218 <hr size="1"><address style="text-align: right;"><small>Generated on Mon Dec 8 14:37:18 2008 for VampPluginSDK by&nbsp; 224 <hr size="1"><address style="text-align: right;"><small>Generated on Thu Sep 24 13:40:13 2009 for VampPluginSDK by&nbsp;
219 <a href="http://www.doxygen.org/index.html"> 225 <a href="http://www.doxygen.org/index.html">
220 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> 226 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
221 </body> 227 </body>
222 </html> 228 </html>