Index: FFT_ooura.cxx =================================================================== --- FFT_ooura.cxx (revision 10015) +++ FFT_ooura.cxx (working copy) @@ -90,92 +90,47 @@ mOutput.Produce(); return toReturn; } - - bool FFT_ooura::Do(const Audio& in, Spectrum &out){ - TData *inbuffer; - - CLAM_DEBUG_ASSERT(GetExecState() == Running, - "FFT_ooura: Do(): Not in execution mode"); - CLAM_DEBUG_ASSERT(isPowerOfTwo(mSize), - "FFT_ooura: Do(): Not a power of two"); - + + + bool FFT_ooura::Do(const Audio& in, Spectrum &out){ + //will use a non in-place version avoiding copying the input buffer + fftbuffer = in.GetBuffer().GetPtr(); out.SetSpectralRange(in.GetSampleRate()/2); + rdft(mSize, 1, fftbuffer, ip, w); + ToMagPhase(out); - switch(mState) { - case sComplex: - inbuffer = in.GetBuffer().GetPtr(); - // Buffer dump. This is a kludge; the right way to do this - // is using a non-inplace version of rdft (which would - // not reduce performance). - for (int i=0; i& outbuffer = out.GetComplexArray(); - - outbuffer[0].SetReal(fftbuffer[0]); // Real Values - outbuffer[0].SetImag(0); // Real Values - outbuffer[mSize/2].SetReal(fftbuffer[1]); - outbuffer[mSize/2].SetImag(0); - - for (int i=1; i