Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 461
steve landiss Avatar asked Apr 24 '12 19:04

steve landiss


People also ask

Why is FFT output complex?

The output of an FFT is complex because it contains magnitude _and_ phase. If the output is I,Q (cartesian coordinates) then the magnitude is the length of the vector from 0,0 to I,Q or sqrt(i^2 + q^2). The phase of the signal is atan2(Q,I). Note that the FFT transforms Voltage samples into Voltages per frequency bin.

Is the FFT of a real signal real?

Most real-world signals are real-valued. Therefore, you can use the real fast Fourier transform (FFT) for most applications. You also can use the complex FFT by setting the imaginary part of the signal to zero.

What do the real and imaginary parts of FFT represent?

The real portion of an FFT result is how much each frequency component resembles a cosine wave, the imaginary component, how much each component resembles a sine wave.

Why is FFT output mirrored?

The reason for the mirroring is because I use an FFT on real numbers (real FFT). The normal FFT as everyone knows works on complex numbers. Hence the imaginary part is "set" to 0 in the real FFT, resulting in a mirroring around the middle (or technically speaking the mirroring is around 0 and N/2).


2 Answers

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.

like image 114
zmccord Avatar answered Sep 28 '22 00:09

zmccord


The FFT provides you with amplitude and phase. The amplitude is encoded as the magnitude of the complex number (sqrt(x^2+y^2)) while the phase is encoded as the angle (atan2(y,x)). To have a strictly real result from the FFT, the incoming signal must have even symmetry (i.e. x[n]=conj(x[N-n])).

If all you care about is intensity, the magnitude of the complex number is sufficient for analysis.

like image 27
antijon Avatar answered Sep 27 '22 23:09

antijon