changeset 133:b18b07474e11

* Fix to empty columns being returned from FFTDataServer to transform
author Chris Cannam
date Mon, 03 Jul 2006 15:00:32 +0000
parents 06aba53ea0cf
children 53dfcd7db419
files transform/FeatureExtractionPluginTransform.cpp
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/transform/FeatureExtractionPluginTransform.cpp	Fri Jun 30 11:47:52 2006 +0000
+++ b/transform/FeatureExtractionPluginTransform.cpp	Mon Jul 03 15:00:32 2006 +0000
@@ -288,6 +288,14 @@
                     fftAdapters[ch]->getValuesAt
                         (column, i, buffers[ch][i*2], buffers[ch][i*2+1]);
                 }
+                //!!!
+                float sum = 0.0;
+                for (size_t i = 0; i < m_blockSize/2; ++i) {
+                    sum += buffers[ch][i*2];
+                }
+                if (fabs(sum) < 0.0001) {
+                    std::cerr << "WARNING: small sum for column " << column << " (sum is " << sum << ")" << std::endl;
+                }
             } else {
                 getFrames(ch, channelCount, 
                           blockFrame, m_blockSize, buffers[ch]);