Search code examples
algorithmmathaudiosignal-processingfft

Why does FFT produce complex numbers instead of real numbers?


All the FFT implementations we have come across result in complex values (with real and imaginary parts), even if the input to the algorithm was a discrete set of real numbers (integers).

Is it not possible to represent frequency domain in terms of real numbers only?


Solution

  • The FFT is fundamentally a change of basis. The basis into which the FFT changes your original signal is a set of sine waves instead. In order for that basis to describe all the possible inputs it needs to be able to represent phase as well as amplitude; the phase is represented using complex numbers.

    For example, suppose you FFT a signal containing only a single sine wave. Depending on phase you might well get an entirely real FFT result. But if you shift the phase of your input a few degrees, how else can the FFT output represent that input?

    edit: This is a somewhat loose explanation, but I'm just trying to motivate the intuition.