Mercurial > hg > qm-vamp-plugins
diff plugins/BeatTrack.cpp @ 153:38502a1595ff
Update for new DetectionFunction api
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Mon, 21 Oct 2013 12:02:51 +0100 |
parents | 87c13eccd52e |
children | f96ea0e4b475 |
line wrap: on
line diff
--- a/plugins/BeatTrack.cpp Thu Sep 05 13:21:26 2013 +0100 +++ b/plugins/BeatTrack.cpp Mon Oct 21 12:02:51 2013 +0100 @@ -367,25 +367,22 @@ return FeatureSet(); } - size_t len = m_d->dfConfig.frameLength / 2; + size_t len = m_d->dfConfig.frameLength / 2 + 1; - double *magnitudes = new double[len]; - double *phases = new double[len]; + double *reals = new double[len]; + double *imags = new double[len]; // We only support a single input channel for (size_t i = 0; i < len; ++i) { - - magnitudes[i] = sqrt(inputBuffers[0][i*2 ] * inputBuffers[0][i*2 ] + - inputBuffers[0][i*2+1] * inputBuffers[0][i*2+1]); - - phases[i] = atan2(-inputBuffers[0][i*2+1], inputBuffers[0][i*2]); + reals[i] = inputBuffers[0][i*2]; + imags[i] = inputBuffers[0][i*2+1]; } - double output = m_d->df->process(magnitudes, phases); + double output = m_d->df->processFrequencyDomain(reals, imags); - delete[] magnitudes; - delete[] phases; + delete[] reals; + delete[] imags; if (m_d->dfOutput.empty()) m_d->origin = timestamp;