# FFT frequencies

**URL:** <https://discourse.processing.org/t/fft-frequencies/6626>\
**Category:** Libraries\
**Created:** [December 15, 2018, 1:15pm UTC](https://discourse.processing.org/t/fft-frequencies/6626 "2018-12-15T13:15:35Z")\
**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:** [December 15, 2018, 2:00pm UTC](https://discourse.processing.org/t/fft-frequencies/6626/2 "2018-12-15T14:00:56Z")

</div>

hi, i can not answer about the mentioned “stock library”  
as i never used it, is it good? where you get it from ?

but about FFT  
let us just assume you would have imported / use the

> [http://code.compartmental.net/minim/](http://code.compartmental.net/minim/)

sound library,  
then there are examples to find like

> processing IDE 3.4 / File /Examples /  
> Contributes Libraries / Minim / Basics /  
> AnalyzeSound

using that example you could make following changes ( to understand )

in

```auto
setup () {
//.. add
  println("jingle.bufferSize() "+jingle.bufferSize());
  println("jingle.sampleRate() "+jingle.sampleRate());
  println("fft.specSize()"+fft.specSize());
}

```

you could even in the play loop add

```auto
//...
  for(int i = 0; i < fft.specSize(); i++)
  {
    // draw the line for frequency band i, scaling it up a bit so we can see it
    line( i, height, i, height - fft.getBand(i)*8 );
    print(" i: "+i+" "+fft.getBand(i));
  }
  println("\nnext");
}

```

ok, when you talk about

> 512 bands

i think you mean samples ( for the FFT input buffer ) to analyze  
see also: song.bufferSize()

so with 512 samples  
you would get back a array  
fft with 256 +1 “bands”  
where [0] is not a frequency, more a average offset  
and [1] a sinus what fits inside the 512 samples  
and the value is the amplitude of it.  
_insofar the real frequency is not known, as the samples might be 512 measurements over a month of moonshine intensity…_  
only the

> song.sampleRate()

brings it in relation to the real world.

now what can be in [2]?  
amplitude of 2 sinus in the 512 samples…

---

_[View the full topic](https://discourse.processing.org/t/fft-frequencies/6626)._
