# ArrayIndexOutOfBoundsException on FFT analyze when bands above 2^14

**URL:** <https://discourse.processing.org/t/arrayindexoutofboundsexception-on-fft-analyze-when-bands-above-2-14/9980>\
**Category:** Libraries\
**Created:** [April 4, 2019, 10:04pm UTC](https://discourse.processing.org/t/arrayindexoutofboundsexception-on-fft-analyze-when-bands-above-2-14/9980 "2019-04-04T22:04:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [April 5, 2019, 12:57am UTC](https://discourse.processing.org/t/arrayindexoutofboundsexception-on-fft-analyze-when-bands-above-2-14/9980/2 "2019-04-05T00:57:02Z")

</div>

hi, seems like i could not help you  
[Frequencies not adding up](https://discourse.processing.org/t/frequencies-not-adding-up/9170/4) 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.

---

_[View the full topic](https://discourse.processing.org/t/arrayindexoutofboundsexception-on-fft-analyze-when-bands-above-2-14/9980)._
