I am just trying to understand what the values sent back from computeSpectrum(bytes,true,0)
mean. I have values ranging from 0 to 1 for each float i read from the byte array but does each value represent a range of Hz
Thanks!
I am just trying to understand what the values sent back from computeSpectrum(bytes,true,0)
mean. I have values ranging from 0 to 1 for each float i read from the byte array but does each value represent a range of Hz
Thanks!
In my opinion each of the values represents the amount of energy a band of frequency has, considering the resolution.
The ByteArray returned (well, modified) by computeSpectrum() contains 512 bytes. The first are for the left channel and the second for the right channel. Each byte represents the normalized energy level for 1 of 256 frequency bands. The bands are divided linearly from ~6 hz to ~11khz with a bandwidth of 43.0664062 Hz (source: http://blog.benstucki.net/?p=60). So each float value you're looking at is the energy of that frequency band. Be aware that you might want to compensate for the linear distribution if you don't want visually skewed results.