rbn42 / panon

An Audio Visualizer Widget in KDE Plasma
GNU General Public License v3.0
192 stars 30 forks source link

[BUG] Incorrect harmonics appear when volume of sound goes beyond a certain level #59

Open ShawkMusic opened 3 years ago

ShawkMusic commented 3 years ago

Desktop (please complete the following information):

Describe the bug When I play a pure sinewave I should only see one hump going up, because sinewaves don't have any harmonics. Panon displays this correctly, but only if the volume of the sinewave is below a certain level. If it's above that level, it starts showing a bunch of incorrect harmonics, This is what it shows when I play a single sinewave at 155Hz at a low volume (this is displayed correctly): Screenshot_2021_06_20_(03:53:52)

This is what it shows when I play a single sinewave at 155Hz at a higher volume (notice how there are many more humps that shouldn't be there): Screenshot_2021_06_20_(03:29:35)

rbn42 commented 3 years ago

Confirmed. panon uses numpy's FFT to visualize wave data. Apparently it draws more than necessary humps for low frequency signals.

So, does anyone know a better algorithm than FFT for real-time audio visulization?

https://user-images.githubusercontent.com/8784753/123059348-43780f00-d43c-11eb-9387-a30e5d38417b.mp4