FFT simple question, getting bass, mids, and highs


I searched a lot about using ofxFFT and the principe of FFT analysis but I didn’t manage to find the good tips for achieving what I want to do.

I’m looking for a way to getting approxmiated values of low frequencies, mid frequencies and high frequencies of the sound.

Thanks for taking the tim to read me and forgive my english,

I allow myself to “up” the topic because I haven’t found any answer since the day I’ve started this discussion, any help is appreciated !

Thank you very much,

When you get the FFT of a sound using ofSoundGetSpectrum() what you’re actually getting is the range of values for the sound, so for instance in the 071 examples the soundPlayerFFT example shows getting 128 different samples that are going to range from the lowest frequency range to the highest frequency range. So one way to get the “lows” would be to look at the beginning 3rd of the array, “mids” the middle 3rd, and “highs” upper 3rd. I’ve always liked this explanation of FFT: http://www.cs.tut.fi/sgn/arg/intro/basics.html hope that helps a little.

Hi All ,

I was playing around with ofxFFT from Kyle’s repo to do some microphone based FFT work a few months ago and put together this little example : https://vimeo.com/29234695

I was looking for a way to visually set the ranges and bin size in realtime. The source code is up @ https://github.com/benMcChesney/ofFFtPlayground . I think I wrote it in 0062 but I can upgrade it to 0071 quickly if you think it would be useful to you.


Thanks for your answers, it’s really helpfull to me ! In a first time, I will try with ofSoundGetSpectrum() which seems to be a lot easir to use than Kyle’s library (but the use of this library seems to be awesome in the results, like in Ben’s example)

I tried to compile the example that you provided on Github (ofFftPlayground) but I can’t compile it because of some MSA’s libs errors… I need to dig in the code a little more to try correcting these problems ! But, if you have a 0071 version in the box, I’m interested to take a look at :slight_smile:

Have a great weekend !

it’s more complicate than cut in 3 equal part the frequency range between 20hz and 20khz
some people consider bass under 1khz and high up to 12khz
I found this, which is interesting :

sub bass : 0 > 100hz
mid bass : 80 > 500hz
mid range: 400 > 2khz
upper mid: 1k > 6khz
high freq: 4k > 12khz
Very high freq: 10k > 20khz and above


I’ve been meaning to update the example anyway. I’ll try get it updated to 0071 either today or tomorrow. Are you using xcode or code::blocks ?

It’s cool, thank you :slight_smile: I’m using Xcode 3 !