Here's a code excerpt:
Code: Select all
vDSP_ctoz((COMPLEX *)inBuffer, 2, &sigFFT, 1, bufferSize / 2);
vDSP_fft_zrip(fftSetup, &sigFFT, 1, log2n, FFT_FORWARD);
vDSP_zvmul (&sigFFT, 1, &irFFT, 1, &sigFFT, 1, bufferSize, 1); // this goes wrong
vDSP_fft_zrip(fftSetup, &sigFFT, 1, log2n, FFT_INVERSE);
vDSP_ztoc(&sigFFT, 1, (COMPLEX *)resultBuffer, 2, bufferSize / 2);
float scale = 1.0 / (2*bufferSize);
vDSP_vsmul(resultBuffer, 1, &scale, resultBuffer, 1, bufferSize);
I'm pretty sure the problem is in this zvmul() operation, because I get the orgiginal inBuffer back when commenting the line out. I also ensured that irFFT ist OK by inverse transforming and verifying the result. Anybody have a clue? What is it I'm not seeing?
