Mercurial > hg > svgui
comparison layer/SpectrogramLayer.cpp @ 1055:00891cfaa4d3 3.0-integration
Make normalise-hybrid logic the same in both draw methods
author | Chris Cannam |
---|---|
date | Mon, 13 Jun 2016 11:44:03 +0100 |
parents | 5e5873c24142 |
children | b4fd6c67fce5 |
comparison
equal
deleted
inserted
replaced
1054:5e5873c24142 | 1055:00891cfaa4d3 |
---|---|
2263 if (m_colourScale == PhaseColourScale) { | 2263 if (m_colourScale == PhaseColourScale) { |
2264 fft->getPhasesAt(sx, values, minbin, maxbin - minbin + 1); | 2264 fft->getPhasesAt(sx, values, minbin, maxbin - minbin + 1); |
2265 } else if (m_normalization == NormalizeColumns) { | 2265 } else if (m_normalization == NormalizeColumns) { |
2266 fft->getNormalizedMagnitudesAt(sx, values, minbin, maxbin - minbin + 1); | 2266 fft->getNormalizedMagnitudesAt(sx, values, minbin, maxbin - minbin + 1); |
2267 } else if (m_normalization == NormalizeHybrid) { | 2267 } else if (m_normalization == NormalizeHybrid) { |
2268 float max = fft->getNormalizedMagnitudesAt(sx, values, minbin, maxbin - minbin + 1); | 2268 float max = fft->getNormalizedMagnitudesAt |
2269 if (max > 0.f) { | 2269 (sx, values, minbin, maxbin - minbin + 1); |
2270 for (int i = minbin; i <= maxbin; ++i) { | 2270 float scale = log10f(max + 1.f); |
2271 values[i - minbin] = float(values[i - minbin] * | 2271 for (int i = minbin; i <= maxbin; ++i) { |
2272 log10f(max)); | 2272 values[i - minbin] *= scale; |
2273 } | |
2274 } | 2273 } |
2275 } else { | 2274 } else { |
2276 fft->getMagnitudesAt(sx, values, minbin, maxbin - minbin + 1); | 2275 fft->getMagnitudesAt(sx, values, minbin, maxbin - minbin + 1); |
2277 } | 2276 } |
2278 psx = sx; | 2277 psx = sx; |