heyspencerb
Member
Like the title says, can you get both real and imaginary FFT data from AudioAnalyzeFFT1024? I am trying to use this:
https://github.com/adamstark/BTrack
beat detection algorithm in my audio project but it requires real and imaginary FFT data. In the function void AudioAnalyzeFFT1024::update(void) I found this code:
but I can't really find much other mention of the imaginary FFT data, and its a little confusing how I would get the real and imaginary data out of that. I am trying to match this format from the beat detection code:
https://github.com/adamstark/BTrack
beat detection algorithm in my audio project but it requires real and imaginary FFT data. In the function void AudioAnalyzeFFT1024::update(void) I found this code:
Code:
// TODO: support averaging multiple copies
for (int i=0; i < 512; i++) {
uint32_t tmp = *((uint32_t *)buffer + i); // real & imag
uint32_t magsq = multiply_16tx16t_add_16bx16b(tmp, tmp);
output[i] = sqrt_uint32_approx(magsq);
}
but I can't really find much other mention of the imaginary FFT data, and its a little confusing how I would get the real and imaginary data out of that. I am trying to match this format from the beat detection code:
Code:
// store real and imaginary parts of FFT
for (int i = 0; i < frameSize; i++)
{
complexOut[i][0] = fftOut[i].r;
complexOut[i][1] = fftOut[i].i;
}