summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/screens/visualizer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/screens/visualizer.cpp b/src/screens/visualizer.cpp
index 937f1ceb..d027d548 100644
--- a/src/screens/visualizer.cpp
+++ b/src/screens/visualizer.cpp
@@ -447,7 +447,11 @@ void Visualizer::DrawFrequencySpectrum(const int16_t *buf, ssize_t samples, size
m_bar_heights.clear();
const size_t win_width = w.getWidth();
- for (size_t x = 0, cur_bin = 0; x < win_width; ++x)
+
+ size_t cur_bin = 0;
+ while (cur_bin < m_fftw_results && Bin2Hz(cur_bin) < m_dft_logspace[0])
+ ++cur_bin;
+ for (size_t x = 0; x < win_width; ++x)
{
double bar_height = 0;