Question

I have a question regarding use of FFT. Using function getBand(int i) with Minim i can extract the amplitude of a specific frequency and do pretty maps of it. Works great.

However, this is a more of a curiosity question. When i look at the values extracted from playing the same song two twice using the same frequency (so the amplitude should be identical) but i get very different values - why is this?

0.0,0.0,0.0,0.0,0.0,0.08706585,0.23708777,0.83046436,0.74603105,0.30447206
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.08706585,0.4790409,0.9608221,0.83046436,0.74603105
Was it helpful?

Solution

Are you sure the inputs are exactly the same in both cases ? If you're just taking a random segment of a song then the output of an FFT will be very different for different starting points in the song.

OTHER TIPS

The mp3 decoding could be flaky and/or the lead-in buffering of the fft routine could be flakey, (different length of silence preceeding the series). In this case it looks like the lead-in is around 2 steps greater in the 2nd output.

Then, if the time interval at which the ffts are performed is longer than the fft window size, a difference in the lead-in can cause the fft windows to land on quite different parts of the series, which could explain the very different values later in the outputs.

The situation should be clearer if you can increase the 'time resolution' (amount of ffts performed per given time) -or increase the fft window size, so the fft measurements arent done sparsely. Idealy they should overlap before we could expect to match a pattern between scans done out of step.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top