ArrayIndexOutOfBoundsException on FFT analyze when bands above 2^14

hi, seems like i could not help you
Frequencies not adding up here,
with a explanation about bands, sorry.

now for this question, yes, for speed that DFT is done in
array with integer pointer, using integer values
( and not double or floating point …) so the band limit on your computer seems reasonable.

again, processing is not doing a FFT, it just sends a sample array
and when you set ( using sound lib )
bands = 512;
it sends 1024 sample batches
and your FFT shows your 440Hz as a max on about band 10.
here some tests of your modified code ( show print FFT )

// pls set :
int bands = 512;
// and test:
// Hz
// 50 in band 1
// 440 in band 10
// 10,000 in band 232
// 20,000 in band 464 of 512 *

( * my computer/sound card or my ears not work for this )

so 512 bands is what you have to use.

actually when you complain about frequency resolution of FFT
it should be on the low range ( < 50Hz ) if that is a issue.

1 Like