visualizer: scale spectrum along with window's width

This commit is contained in:
Andrzej Rybczak
2015-01-17 09:43:09 +01:00
parent 8657cdbf4d
commit 8e31f81ca9
2 changed files with 2 additions and 1 deletions

View File

@@ -418,7 +418,7 @@ void Visualizer::DrawFrequencySpectrum(int16_t *buf, ssize_t samples, size_t y_o
for (int j = 0; j < bins_per_bar; ++j)
bar_height += m_freq_magnitudes[x*bins_per_bar+j];
// buff higher frequencies
bar_height *= log2(2 + x);
bar_height *= log2(2 + x) * 100.0/win_width;
// moderately normalize the heights
bar_height = pow(bar_height, 0.5);