diff layer/SpectrogramLayer.cpp @ 252:8d89f8869cfb

* don't store fft values scaled by fftsize/2; that's a special requirement for the spectrogram, and other applications will not expect it -- make the spectrogram do that scaling itself * add a higher-resolution memory cache (still polar, though) as an alternative to the 16-bit compact cache * don't use the memory cache if we want rectangular coords (unless the disc cache is totally infeasible) as conversion slows it down anyway * avoid redundant rectangular -> polar -> rectangular conversion when storing values in a rectangular-mode disc cache
author Chris Cannam
date Fri, 01 Jun 2007 13:56:35 +0000
parents 3fe622570b35
children 1b1e6947c124
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp	Fri May 18 16:47:38 2007 +0000
+++ b/layer/SpectrogramLayer.cpp	Fri Jun 01 13:56:35 2007 +0000
@@ -1477,7 +1477,7 @@
                     if (!have || value < phaseMin) { phaseMin = value; }
                     if (!have || value > phaseMax) { phaseMax = value; }
 
-                    value = fft->getMagnitudeAt(s, q);
+                    value = fft->getMagnitudeAt(s, q) / (m_fftSize/2);
                     if (!have || value < min) { min = value; }
                     if (!have || value > max) { max = value; }
                     
@@ -2140,7 +2140,7 @@
                     mag.sample(value);
                     value *= m_gain;
                 } else {
-                    value = fft->getMagnitudeAt(s, q);
+                    value = fft->getMagnitudeAt(s, q) / (m_fftSize/2);
                     mag.sample(value);
                     value *= m_gain;
                 }