diff src/FeatureExtractor.cpp @ 166:d23dad16d6f9 refactors

Simplify freq handling
author Chris Cannam
date Thu, 05 Feb 2015 11:53:23 +0000
parents cf1282d1f940
children 001db4c32eb0 ef3c4b451c57
line wrap: on
line diff
--- a/src/FeatureExtractor.cpp	Fri Jan 30 14:54:18 2015 +0000
+++ b/src/FeatureExtractor.cpp	Thu Feb 05 11:53:23 2015 +0000
@@ -24,7 +24,7 @@
 
 using namespace std;
 
-//#define DEBUG_FEATURE_EXTRACTOR 1
+#define DEBUG_FEATURE_EXTRACTOR 1
 
 FeatureExtractor::FeatureExtractor(Parameters parameters) :
     m_params(parameters)
@@ -76,7 +76,9 @@
     int crossoverMidi = lrint(log(crossoverBin * binWidth / refFreq)/
                               log(2.0) * 12 + 69);
 
+#ifdef DEBUG_FEATURE_EXTRACTOR
     cerr << "FeatureExtractor::makeStandardFrequencyMap: refFreq = " << refFreq << endl;
+#endif
     
     int i = 0;
     while (i <= crossoverBin) {
@@ -91,6 +93,11 @@
         if (target >= m_featureSize) target = m_featureSize - 1;
         m_freqMap[i++] = target;
     }
+
+#ifdef DEBUG_FEATURE_EXTRACTOR
+    cerr << "FeatureExtractor: crossover bin is " << crossoverBin << " for midi "
+         << crossoverMidi << endl;
+#endif
 }
 
 void