Chris Lomont was kind enough to provide us with a neat FFT implementation using C#. The source can be found here. The RealFFT(double[] data, bool forward)
function is half way down, just read the function summary (it's short :)).
I am using the RealFFT
function which, as stated (function summary), accepts an array of samples all of which are real valued (no imaginary component). However, it also states that The output is complex valued after the first two entries, stored in alternating real and imaginary parts.
I can't seem to get this straight. After doing FFT you always get real and imaginary component. So how can they be packed in the array that got into function as argument (which is half the size because only real numbers)?