comparison src/Silvet.cpp @ 235:b5a8836dd2a4 norm eval-norm-rN

Try using the Flatten Dynamics plugin instead of norm-to-max-so-far
author Chris Cannam
date Thu, 17 Jul 2014 16:42:48 +0100
parents 5ba328aae5be
children 70773820e719
comparison
equal deleted inserted replaced
234:8aa810eeff40 235:b5a8836dd2a4
388 m_postFilter.push_back(new MedianFilter<double>(3)); 388 m_postFilter.push_back(new MedianFilter<double>(3));
389 } 389 }
390 m_pianoRoll.clear(); 390 m_pianoRoll.clear();
391 m_columnCount = 0; 391 m_columnCount = 0;
392 m_startTime = RealTime::zeroTime; 392 m_startTime = RealTime::zeroTime;
393 m_signalMax = 0.0;
394 } 393 }
395 394
396 Silvet::FeatureSet 395 Silvet::FeatureSet
397 Silvet::process(const float *const *inputBuffers, Vamp::RealTime timestamp) 396 Silvet::process(const float *const *inputBuffers, Vamp::RealTime timestamp)
398 { 397 {
401 } 400 }
402 401
403 vector<double> data; 402 vector<double> data;
404 for (int i = 0; i < m_blockSize; ++i) { 403 for (int i = 0; i < m_blockSize; ++i) {
405 double d = inputBuffers[0][i]; 404 double d = inputBuffers[0][i];
406 if (fabs(d) > m_signalMax) { 405 data.push_back(d);
407 m_signalMax = fabs(d);
408 }
409 }
410 for (int i = 0; i < m_blockSize; ++i) {
411 double d = inputBuffers[0][i];
412 if (m_signalMax > 0.0) {
413 data.push_back(d / m_signalMax * 0.5);
414 } else {
415 data.push_back(0.0);
416 }
417 } 406 }
418 407
419 if (m_resampler) { 408 if (m_resampler) {
420 data = m_resampler->process(data.data(), data.size()); 409 data = m_resampler->process(data.data(), data.size());
421 } 410 }