[Kst] extragear/graphics/kst/src/libkstmath

Duncan Hanson duncan.hanson at gmail.com
Thu Jun 22 23:45:57 CEST 2006


SVN commit 554017 by dhanson:

CCBUG:129168 backwards compatibility. not storing _averageLen is kind of strange though...

 M  +3 -2      kstcsd.cpp  


--- trunk/extragear/graphics/kst/src/libkstmath/kstcsd.cpp #554016:554017
@@ -181,6 +181,7 @@
 
   double *tempOutput, *input;
   int tempOutputLen = PSDCalculator::calculateOutputVectorLength(_windowSize, _average, _averageLength);
+  _PSDLen = tempOutputLen;
   tempOutput = new double[tempOutputLen];
 
   input = inVector->value();
@@ -227,7 +228,7 @@
   ts << l2 << "<vectag>" << QStyleSheet::escape(_inputVectors[INVECTOR]->tagName()) << "</vectag>" << endl;
   ts << l2 << "<sampRate>"  << _frequency << "</sampRate>" << endl;
   ts << l2 << "<average>" << _average << "</average>" << endl;
-  ts << l2 << "<fftLen>" << _averageLength << "</fftLen>" << endl;
+  ts << l2 << "<fftLen>" << int(ceil(log(double(_PSDLen*2)) / log(2.0))) << "</fftLen>" << endl;
   ts << l2 << "<removeMean>" << _removeMean << "</removeMean>" << endl;
   ts << l2 << "<apodize>" << _apodize << "</apodize>" << endl;
   ts << l2 << "<apodizefxn>" << _apodizeFxn << "</apodizefxn>" << endl;
@@ -345,7 +346,7 @@
 }
 
 int KstCSD::length() const { 
-  return _averageLength;  
+  return _averageLength;
 }
 
 void KstCSD::setLength(int in_length) {


More information about the Kst mailing list