[Kst] [Bug 124158] psd normalization is wrong

Duncan Hanson duncan.hanson at gmail.com
Tue Jun 13 23:40:55 CEST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=124158         
duncan.hanson gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From duncan.hanson gmail com  2006-06-13 23:40 -------
SVN commit 551186 by dhanson:

BUG:124158 sqrt(sW/len) for all apodizations.

 M  +9 -1      kstpsdgenerator.cpp  


--- trunk/extragear/graphics/kst/src/libkstmath/kstpsdgenerator.cpp #551185:551186
 @ -126,6 +126,7  @
         w[i] = 1.0 - fabs(x) / a;
         sW += w[i] * w[i];
       }
+      sW = sqrt(sW / double(len));
       for (int i = 0; i < len; ++i) {
         w[i] /= sW;
       }
 @ -137,6 +138,7  @
         w[i] = 0.42 + 0.5 * cos(M_PI * x / a) + 0.08 * cos(2 * M_PI * x/a);
         sW += w[i] * w[i];
       }
+      sW = sqrt(sW / double(len));
       for (int i = 0; i < len; ++i) {
         w[i] /= sW;
       }
 @ -148,6 +150,7  @
         w[i] = pow(1.0 - (x * x) / (a * a), 2.0);
         sW += w[i] * w[i];
       }
+      sW = sqrt(sW / double(len));
       for (int i = 0; i < len; ++i) {
         w[i] /= sW;
       }
 @ -159,6 +162,7  @
         w[i] = cos(M_PI * x / (2.0 * a));
         sW += w[i] * w[i];
       }
+      sW = sqrt(sW / double(len));
       for (int i = 0; i < len; ++i) {
         w[i] /= sW;
       }
 @ -169,6 +173,7  @
         x = i - a;
         w[i] = exp(-1.0 * x * x/(2.0 * gaussianSigma * gaussianSigma));
       }
+      sW = sqrt(sW / double(len));
       for (int i = 0; i < len; ++i) {
         w[i] /= sW;
       }
 @ -179,7 +184,8  @
         x = i - a;
         w[i] = 0.53836 + 0.46164 * cos(M_PI * x / a);
         sW += w[i] * w[i];
-      }  
+      }
+      sW = sqrt(sW / double(len));
       for (int i = 0; i < len; ++i) {
         w[i] /= sW;
       }
 @ -191,6 +197,7  @
         w[i] = pow(cos(M_PI * x/(2.0 * a)), 2.0);
         sW += w[i] * w[i];
       }
+      sW = sqrt(sW / double(len));
       for (int i = 0; i < len; ++i) {
         w[i] /= sW;
       }
 @ -202,6 +209,7  @
         w[i] = 1.0 - x * x / (a * a);
         sW += w[i] * w[i];
       }
+      sW = sqrt(sW / double(len));
       for (int i = 0; i < len; ++i) {
         w[i] /= sW;
       }


More information about the Kst mailing list