comparison 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
comparison
equal deleted inserted replaced
1007:ba404199345f 1056:c4898e57eea5
677 // channelCount is either m_input.getModel()->channelCount or 1 677 // channelCount is either m_input.getModel()->channelCount or 1
678 678
679 if (frequencyDomain) { 679 if (frequencyDomain) {
680 for (int ch = 0; ch < channelCount; ++ch) { 680 for (int ch = 0; ch < channelCount; ++ch) {
681 int column = (blockFrame - startFrame) / stepSize; 681 int column = (blockFrame - startFrame) / stepSize;
682 fftModels[ch]->getValuesAt(column, reals, imaginaries); 682 if (fftModels[ch]->getValuesAt(column, reals, imaginaries)) {
683 for (int i = 0; i <= blockSize/2; ++i) { 683 for (int i = 0; i <= blockSize/2; ++i) {
684 buffers[ch][i*2] = reals[i]; 684 buffers[ch][i*2] = reals[i];
685 buffers[ch][i*2+1] = imaginaries[i]; 685 buffers[ch][i*2+1] = imaginaries[i];
686 } 686 }
687 } else {
688 for (int i = 0; i <= blockSize/2; ++i) {
689 buffers[ch][i*2] = 0.f;
690 buffers[ch][i*2+1] = 0.f;
691 }
692 }
687 error = fftModels[ch]->getError(); 693 error = fftModels[ch]->getError();
688 if (error != "") { 694 if (error != "") {
689 cerr << "FeatureExtractionModelTransformer::run: Abandoning, error is " << error << endl; 695 cerr << "FeatureExtractionModelTransformer::run: Abandoning, error is " << error << endl;
690 m_abandoned = true; 696 m_abandoned = true;
691 m_message = error; 697 m_message = error;