How to set DSP FFt Window Size?

(Darryl Vo) #1

I was curious how you set it since the default is 2048. I also had a question about FFT itself. A sample rate of 2048 means it will create 2048 " mini ranges" over which the frequencies will be calculated?

(Nicholas Wilcox) #2
int window = 512;
fftDsp->setParameterInt(FMOD_DSP_FFT_WINDOWSIZE, window);

The number of frequency bins is half the FFT size.

(Darryl Vo) #3

the number of frequency bins is half the fft window size?
oh thats what this comment was referring too?
“Only read/display half of the buffer typically for analysis as the 2nd half is usually the same data reversed due to the nature of the way FFT works.”

(Nicholas Wilcox) #4

Yes. To be precise the first half of the FFT buffer contains the positive frequencies, which is what you’re interested in. The second half contains the negative frequencies, which is symmetrical to the positive frequencies.