I am asking this because generally, input data such as audio signals are continous array block, and before feeding them into fft routine, one has to convert structure of data from array to array of Complex(re, im) using a loop
When input data do not have imaginary part, we could directly assign or use memcpy, this would have saved lot of time.
CodePudding user response:
Why most fft library use Complex struct instead of two arrays for imaginary and real parts
FFT routines that take an array of some complex type rather than an array of reals and an array of imaginaries are generally provided for the convenience of programs written to use complex types. FFT routines that take an array of reals and an array of imaginaries are more common in routines written for high performance (due to the reduced manipulations needed in SIMD instructions and other aspects of a high-performance FFT implementation).
When input data do not have imaginary part,…
To work with pure-real input data (data that has no imaginary component), you should seek a real-to-complex FFT routine, as this will generally give better performance than using a complex-to-complex FFT routine with the imaginary components set to zeros.