changeset 1159:444d133b5ab7 3.0-integration

Merge from branch "tony-2.0-integration"
author Chris Cannam
date Thu, 04 Feb 2016 11:13:39 +0000
parents 2dc27f0f97ad (current diff) e94719f941ba (diff)
children ea636412f9fe
files data/model/FFTModel.cpp data/model/FFTModel.h
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/data/fft/FFTapi.h	Fri Jan 22 18:12:06 2016 +0000
+++ b/data/fft/FFTapi.h	Thu Feb 04 11:13:39 2016 +0000
@@ -75,7 +75,7 @@
         fftf_free(m_output);
     }
 
-    std::vector<std::complex<float> > process(std::vector<float> in) const {
+    std::vector<std::complex<float> > process(const std::vector<float> &in) const {
         const int hs = m_size/2;
         for (int i = 0; i < hs; ++i) {
             m_input[i] = in[i + hs];
--- a/data/model/FFTModel.cpp	Fri Jan 22 18:12:06 2016 +0000
+++ b/data/model/FFTModel.cpp	Thu Feb 04 11:13:39 2016 +0000
@@ -149,7 +149,7 @@
     return true;
 }
 
-bool
+float
 FFTModel::getNormalizedMagnitudesAt(int x, float *values, int minbin, int count) const
 {
     if (!getMagnitudesAt(x, values, minbin, count)) return false;
@@ -163,7 +163,7 @@
             values[i] /= max;
         }
     }
-    return true;
+    return max;
 }
 
 bool
--- a/data/model/FFTModel.h	Fri Jan 22 18:12:06 2016 +0000
+++ b/data/model/FFTModel.h	Thu Feb 04 11:13:39 2016 +0000
@@ -101,7 +101,7 @@
     float getPhaseAt(int x, int y) const;
     void getValuesAt(int x, int y, float &real, float &imaginary) const;
     bool getMagnitudesAt(int x, float *values, int minbin = 0, int count = 0) const;
-    bool getNormalizedMagnitudesAt(int x, float *values, int minbin = 0, int count = 0) const;
+    float getNormalizedMagnitudesAt(int x, float *values, int minbin = 0, int count = 0) const; // returns maximum of unnormalized magnitudes
     bool getPhasesAt(int x, float *values, int minbin = 0, int count = 0) const;
     bool getValuesAt(int x, float *reals, float *imaginaries, int minbin = 0, int count = 0) const;