diff transform/FeatureExtractionModelTransformer.cpp @ 1056:c4898e57eea5 tonioni

Merge from default branch
author Chris Cannam
date Mon, 23 Mar 2015 10:04:48 +0000
parents d9e0e59a1581
children b14064bd1f97
line wrap: on
line diff
--- a/transform/FeatureExtractionModelTransformer.cpp	Mon Nov 10 09:19:49 2014 +0000
+++ b/transform/FeatureExtractionModelTransformer.cpp	Mon Mar 23 10:04:48 2015 +0000
@@ -679,11 +679,17 @@
         if (frequencyDomain) {
             for (int ch = 0; ch < channelCount; ++ch) {
                 int column = (blockFrame - startFrame) / stepSize;
-                fftModels[ch]->getValuesAt(column, reals, imaginaries);
-                for (int i = 0; i <= blockSize/2; ++i) {
-                    buffers[ch][i*2] = reals[i];
-                    buffers[ch][i*2+1] = imaginaries[i];
-                }
+                if (fftModels[ch]->getValuesAt(column, reals, imaginaries)) {
+                    for (int i = 0; i <= blockSize/2; ++i) {
+                        buffers[ch][i*2] = reals[i];
+                        buffers[ch][i*2+1] = imaginaries[i];
+                    }
+                } else {
+                    for (int i = 0; i <= blockSize/2; ++i) {
+                        buffers[ch][i*2] = 0.f;
+                        buffers[ch][i*2+1] = 0.f;
+                    }
+                }                    
                 error = fftModels[ch]->getError();
                 if (error != "") {
                     cerr << "FeatureExtractionModelTransformer::run: Abandoning, error is " << error << endl;