diff data/model/FFTModel.cpp @ 1270:bac86d3fc6c9 bqfft

Branch to use bqfft code and remove FFTapi
author Chris Cannam
date Mon, 21 Nov 2016 15:05:57 +0000
parents 200c60de27ca
children 6463046bd21d
line wrap: on
line diff
--- a/data/model/FFTModel.cpp	Fri Nov 18 23:30:15 2016 +0000
+++ b/data/model/FFTModel.cpp	Mon Nov 21 15:05:57 2016 +0000
@@ -52,6 +52,8 @@
         throw invalid_argument("FFTModel window size must be at least FFT size");
     }
 
+    m_fft.initFloat();
+
     connect(model, SIGNAL(modelChanged()), this, SIGNAL(modelChanged()));
     connect(model, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)),
             this, SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)));
@@ -223,6 +225,8 @@
         return m_savedData.data;
     }
 
+    Profiler profiler("FFTModel::getSourceData (cache miss)");
+    
     if (range.first < m_savedData.range.second &&
         range.first >= m_savedData.range.first &&
         range.second > m_savedData.range.second) {
@@ -309,7 +313,12 @@
     
     auto samples = getSourceSamples(n);
     m_windower.cut(samples.data());
-    auto col = m_fft.process(samples);
+    breakfastquay::v_fftshift(samples.data(), m_fftSize);
+
+    vector<complex<float>> col(m_fftSize/2 + 1);
+    
+    m_fft.forwardInterleaved(samples.data(),
+                             reinterpret_cast<float *>(col.data()));
 
     SavedColumn sc { n, col };
     if (m_cached.size() >= m_cacheSize) {