Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /proc/self/root/usr/share/doc/libclam-doc/html/ |
Current File : //proc/self/root/usr/share/doc/libclam-doc/html/CircularPeaksToPCP_8hxx_source.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>CLAM-Development: CircularPeaksToPCP.hxx Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">CLAM-Development  <span id="projectnumber">1.4.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_098894a2b9860dda60979d343b8f7997.html">Processing</a></li><li class="navelem"><a class="el" href="dir_3bb38452a33e18a9d5968b07586046b5.html">Analysis</a></li><li class="navelem"><a class="el" href="dir_76e2947c4d923eccc32a85b24227ca35.html">Tonal</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">CircularPeaksToPCP.hxx</div> </div> </div><!--header--> <div class="contents"> <a href="CircularPeaksToPCP_8hxx.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div> <div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright (c) 2001-2006 MUSIC TECHNOLOGY GROUP (MTG)</span></div> <div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * UNIVERSITAT POMPEU FABRA</span></div> <div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div> <div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> *</span></div> <div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div> <div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div> <div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div> <div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * (at your option) any later version.</span></div> <div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> *</span></div> <div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div> <div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div> <div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div> <div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * GNU General Public License for more details.</span></div> <div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> *</span></div> <div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div> <div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div> <div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span></div> <div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> *</span></div> <div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> */</span></div> <div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div> <div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef CircularPeaksToPCP_hxx</span></div> <div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor"></span><span class="preprocessor">#define CircularPeaksToPCP_hxx</span></div> <div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor"></span><span class="preprocessor">#include <list></span></div> <div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <vector></span></div> <div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <cmath></span></div> <div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div> <div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">namespace </span>Simac</div> <div class="line"><a name="l00029"></a><span class="lineno"> 29</span> {</div> <div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div> <div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="classSimac_1_1CircularPeaksToPCP.html"> 39</a></span> <span class="keyword">class </span><a class="code" href="classSimac_1_1CircularPeaksToPCP.html" title="This processing constructs a PCP doing the weighted histogram of the energy of a set of circular chro...">CircularPeaksToPCP</a></div> <div class="line"><a name="l00040"></a><span class="lineno"> 40</span> {</div> <div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">public</span>:</div> <div class="line"><a name="l00042"></a><span class="lineno"><a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a083892bc423f5226d32c0a92c61e0344"> 42</a></span>  <span class="keyword">typedef</span> std::vector<std::pair<double, double> > <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a083892bc423f5226d32c0a92c61e0344">PeakList</a>;</div> <div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a7a069f822e4a826e88b00716385a6051"> 43</a></span>  <span class="keyword">typedef</span> std::vector<double> <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a7a069f822e4a826e88b00716385a6051">PCP</a>;</div> <div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="keyword">private</span>:</div> <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a7a069f822e4a826e88b00716385a6051">PCP</a> _output;</div> <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keywordtype">bool</span> _windowingActivated;</div> <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> nSemitones=12;</div> <div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="keyword">public</span>:</div> <div class="line"><a name="l00049"></a><span class="lineno"><a class="code" href="classSimac_1_1CircularPeaksToPCP.html#abd70196f55ec1387ffe12075f68a6047"> 49</a></span>  <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#abd70196f55ec1387ffe12075f68a6047">CircularPeaksToPCP</a>()</div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  {</div> <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  _output.resize(nSemitones);</div> <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  _windowingActivated=<span class="keyword">false</span>;</div> <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  }</div> <div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="classSimac_1_1CircularPeaksToPCP.html#aa9ed06fd155caf0101fa3e441e9b98f1"> 54</a></span>  <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#aa9ed06fd155caf0101fa3e441e9b98f1">~CircularPeaksToPCP</a>()</div> <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  {</div> <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  }</div> <div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a2f58e5f8364e7403e4c11a00aada783c"> 57</a></span>  <span class="keywordtype">void</span> <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a2f58e5f8364e7403e4c11a00aada783c">activateWindowing</a>()</div> <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  {</div> <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  _windowingActivated=<span class="keyword">true</span>;</div> <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  }</div> <div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="classSimac_1_1CircularPeaksToPCP.html#aa97c1326abcf762eb2d9d3c1efd5da80"> 61</a></span>  <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#aa97c1326abcf762eb2d9d3c1efd5da80">windowedValue</a>(<span class="keywordtype">double</span> position, <span class="keywordtype">double</span> value)</div> <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  {</div> <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keywordflow">return</span> value* (0.54 - 0.46*std::cos(2*M_PI*(position+.5)));</div> <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  }</div> <div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a08b7d519f83ced1310ce488c3bd8ec02"> 65</a></span>  <span class="keywordtype">void</span> <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a08b7d519f83ced1310ce488c3bd8ec02">doIt</a>(<span class="keyword">const</span> <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a083892bc423f5226d32c0a92c61e0344">PeakList</a> & peaks)</div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  {</div> <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i=0; i<nSemitones; i++)</div> <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  _output[i]=0;</div> <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> nPeaks=peaks.size();</div> <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i=0; i<nPeaks; i++)</div> <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  {</div> <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordtype">int</span> quantizedSemitone = <a class="code" href="classint.html">int</a>(peaks[i].first + .5);</div> <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keywordtype">unsigned</span> semitone = (quantizedSemitone+nSemitones)%nSemitones;</div> <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keywordflow">if</span> (_windowingActivated)</div> <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  _output[semitone] += <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#aa97c1326abcf762eb2d9d3c1efd5da80">windowedValue</a>(peaks[i].first,peaks[i].second);</div> <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keywordflow">else</span></div> <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  _output[semitone] += peaks[i].second;</div> <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  }</div> <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  }</div> <div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div> <div class="line"><a name="l00081"></a><span class="lineno"><a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a2b48ce3813f5fb33798f860ea6d25e7c"> 81</a></span>  <span class="keyword">const</span> <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a7a069f822e4a826e88b00716385a6051">PCP</a> & <a class="code" href="classSimac_1_1CircularPeaksToPCP.html#a2b48ce3813f5fb33798f860ea6d25e7c">output</a>()<span class="keyword"> const</span></div> <div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="keyword"> </span>{</div> <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordflow">return</span> _output;</div> <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  }</div> <div class="line"><a name="l00085"></a><span class="lineno"> 85</span> };</div> <div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div> <div class="line"><a name="l00087"></a><span class="lineno"> 87</span> } <span class="comment">// namespace Simac</span></div> <div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div> <div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="preprocessor">#endif// CircularPeaksToPCP_hxx</span></div> <div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="preprocessor"></span></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.1 </small></address> </body> </html>
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare