comparison 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
comparison
equal deleted inserted replaced
251:948a3b05798b 252:8d89f8869cfb
1475 1475
1476 value = fft->getPhaseAt(s, q); 1476 value = fft->getPhaseAt(s, q);
1477 if (!have || value < phaseMin) { phaseMin = value; } 1477 if (!have || value < phaseMin) { phaseMin = value; }
1478 if (!have || value > phaseMax) { phaseMax = value; } 1478 if (!have || value > phaseMax) { phaseMax = value; }
1479 1479
1480 value = fft->getMagnitudeAt(s, q); 1480 value = fft->getMagnitudeAt(s, q) / (m_fftSize/2);
1481 if (!have || value < min) { min = value; } 1481 if (!have || value < min) { min = value; }
1482 if (!have || value > max) { max = value; } 1482 if (!have || value > max) { max = value; }
1483 1483
1484 have = true; 1484 have = true;
1485 } 1485 }
2138 } else if (m_normalizeColumns) { 2138 } else if (m_normalizeColumns) {
2139 value = fft->getNormalizedMagnitudeAt(s, q); 2139 value = fft->getNormalizedMagnitudeAt(s, q);
2140 mag.sample(value); 2140 mag.sample(value);
2141 value *= m_gain; 2141 value *= m_gain;
2142 } else { 2142 } else {
2143 value = fft->getMagnitudeAt(s, q); 2143 value = fft->getMagnitudeAt(s, q) / (m_fftSize/2);
2144 mag.sample(value); 2144 mag.sample(value);
2145 value *= m_gain; 2145 value *= m_gain;
2146 } 2146 }
2147 2147
2148 if (interpolate) { 2148 if (interpolate) {