strange FFT size...

Started by
3 comments, last by Antheus 14 years, 1 month ago
Hi! The FFT my Engine computes to some music is very strange. It works, but the bars on the left are MUCH higher than the bars on the right side. I've seen this in some other apps, too. Is there a way to make them all sized right, like in those WinAmp?
Advertisement
I'm not really an expert in this question but isn't it normal that the low frequencies are boosted? Or is it something else that you meant by bars on the left?
They are not boosted. Lower frequencies just encode more information, higher frequencies are not heard very well by human, so usually they are not present in encoded form of audio (or they are encoded with low weight compared to lower frequencies).
Here you can see the FFT of the song compared to the same song in winamp,at the same position:

FFT - [w]tech and WinAmp

The last *bar* is at position 0, or 0.0000123, whatever, while the left *bars* are very high! In winamp you can see, that everything has got a good height.
It's tricky.

First, the x axis represents various frequencies. The left-most and probably many on the right are discarded.

If the input of 44.1kHz is converted using 2048 buckets, then each bucket covers 44.1kHz/2048 = 21.5 Hz. Human range of hearing is 20-20,000Hz. This means values at index 1..952 would be displayed. It might be more complex, I don't recall right now how exactly mp3s are sampled.


For visualization I sometimes used a simple multiplication. I'd multiply the value at x by log(i), sqrt(i) or even i, where i = 0..n (0..2048) in above case. Or perhaps it was log(f(i)).

The article above suggests a few more ways on how to average the samples. Toying around with median or average might work as well.

This topic is closed to new replies.

Advertisement