Sign in to follow this  
WuTz

strange FFT size...

Recommended Posts

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 this post


Link to post
Share on other sites
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 this post


Link to post
Share on other sites
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 this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this