# strange FFT size...

## Recommended Posts

WuTz    100
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?

##### Share on other sites
snake5    1587
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?

##### Share on other sites
bubu LV    1436
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).

##### Share on other sites
WuTz    100
Here you can see the FFT of the song compared to the same song in winamp,at the same position:

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.

##### Share on other sites
Antheus    2409
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.