changeset 111:c56861fb0ec9 adaptive_diagonals

A feature hack (that is not going anywhere)
author Chris Cannam
date Thu, 04 Dec 2014 15:44:05 +0000
parents bca0802191fe
children 1a422fa20b51
files src/MatchVampPlugin.cpp src/MatchVampPlugin.h
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/MatchVampPlugin.cpp	Thu Dec 04 15:24:27 2014 +0000
+++ b/src/MatchVampPlugin.cpp	Thu Dec 04 15:44:05 2014 +0000
@@ -473,7 +473,7 @@
     desc.binCount = 1;
     desc.hasKnownExtents = false;
     desc.isQuantized = false;
-    desc.sampleType = OutputDescriptor::VariableSampleRate;
+    desc.sampleType = OutputDescriptor::FixedSampleRate;
     desc.sampleRate = outRate;
     m_distOutNo = list.size();
     list.push_back(desc);
@@ -559,6 +559,8 @@
 
     m_mag1.push_back(magOf(f1));
     m_mag2.push_back(magOf(f2));
+    m_cmag1.push_back(magOf(c1));
+    m_cmag2.push_back(magOf(c2));
 
     FeatureSet returnFeatures;
 
@@ -613,7 +615,7 @@
             int x = pathx[i];
             int y = pathy[i];
             if (x != prevx) {
-                double magSum = m_mag1[y] + m_mag2[x];
+                double magSum = (m_cmag1[y] * m_mag1[y]) + (m_cmag2[x] * m_mag2[x]);
                 double distance = distances[i];
                 float c = magSum - distance;
                 confidence.push_back(c);
--- a/src/MatchVampPlugin.h	Thu Dec 04 15:24:27 2014 +0000
+++ b/src/MatchVampPlugin.h	Thu Dec 04 15:44:05 2014 +0000
@@ -92,6 +92,8 @@
 
     std::vector<float> m_mag1;
     std::vector<float> m_mag2;
+    std::vector<float> m_cmag1;
+    std::vector<float> m_cmag2;
     
     mutable int m_pathOutNo;
     mutable int m_abOutNo;