Mercurial > hg > svgui
comparison layer/SpectrogramLayer.cpp @ 489:363157772fbd
* Restore peak bins mode in spectrogram
author | Chris Cannam |
---|---|
date | Thu, 05 Feb 2009 17:46:34 +0000 |
parents | 5cd6f0d3f42d |
children | aa477ddcadb5 |
comparison
equal
deleted
inserted
replaced
488:5cd6f0d3f42d | 489:363157772fbd |
---|---|
2702 //!!! float values | 2702 //!!! float values |
2703 | 2703 |
2704 for (int sy = sy0; sy < sy1; ++sy) { | 2704 for (int sy = sy0; sy < sy1; ++sy) { |
2705 | 2705 |
2706 float value = 0.f; | 2706 float value = 0.f; |
2707 if (fft) value = values[sy - minbin]; | 2707 if (fft) { |
2708 else value = c[sy]; | 2708 if (m_binDisplay == PeakBins) { |
2709 if (!fft->isLocalPeak(sx, sy)) continue; | |
2710 } | |
2711 value = values[sy - minbin]; | |
2712 } else { | |
2713 if (m_binDisplay == PeakBins) { | |
2714 if (sy == 0 || sy+1 >= c.size() || | |
2715 c.at(sy) < c.at(sy-1) || | |
2716 c.at(sy) < c.at(sy+1)) continue; | |
2717 } | |
2718 value = c.at(sy); | |
2719 } | |
2709 | 2720 |
2710 if (m_colourScale != PhaseColourScale) { | 2721 if (m_colourScale != PhaseColourScale) { |
2711 if (!m_normalizeColumns) { | 2722 if (!m_normalizeColumns) { |
2712 value /= (m_fftSize/2.f); | 2723 value /= (m_fftSize/2.f); |
2713 } | 2724 } |