···335335#else
336336337337 kiss_fft_cpx out[FFT_SIZE + 1];
338338- // Use the newest samples for FFT (they're at the end of the buffer)
339339- kiss_fftr(fftcfg, sampleBuf + AUDIO_BUFFER_SIZE - (FFT_SIZE * 2), out);
338338+ // Align FFT and VQT to start from the same temporal position
339339+ kiss_fftr(fftcfg, sampleBuf + AUDIO_BUFFER_SIZE - VQT_FFT_SIZE, out);
340340341341 float peakValue = fPeakMinValue;
342342 for (int i = 0; i < FFT_SIZE; i++)
+1-1
src/ext/vqt.c
···263263 // Copy audio data from the shared buffer
264264 // sampleBuf is defined in fft.c as extern
265265 extern float sampleBuf[];
266266- // Use the newest samples for VQT (they're at the end of the buffer)
266266+ // Align FFT and VQT to start from the same temporal position
267267 #define AUDIO_BUFFER_SIZE (VQT_FFT_SIZE > (FFT_SIZE * 2) ? VQT_FFT_SIZE : (FFT_SIZE * 2))
268268 memcpy(vqtAudioBuffer, sampleBuf + AUDIO_BUFFER_SIZE - VQT_FFT_SIZE, VQT_FFT_SIZE * sizeof(float));
269269