22 #ifndef CircularPeaksToPCP_hxx
23 #define CircularPeaksToPCP_hxx
42 typedef std::vector<std::pair<double, double> >
PeakList;
43 typedef std::vector<double>
PCP;
46 bool _windowingActivated;
47 static const unsigned nSemitones=12;
51 _output.resize(nSemitones);
52 _windowingActivated=
false;
59 _windowingActivated=
true;
63 return value* (0.54 - 0.46*std::cos(2*M_PI*(position+.5)));
67 for (
unsigned i=0; i<nSemitones; i++)
69 const unsigned nPeaks=peaks.size();
70 for (
unsigned i=0; i<nPeaks; i++)
72 int quantizedSemitone =
int(peaks[i].first + .5);
73 unsigned semitone = (quantizedSemitone+nSemitones)%nSemitones;
74 if (_windowingActivated)
75 _output[semitone] +=
windowedValue(peaks[i].first,peaks[i].second);
77 _output[semitone] += peaks[i].second;
89 #endif// CircularPeaksToPCP_hxx