# The Phase Information of the DFT

As known, we can get a 'phase spectrum' from the DFT of a input signal. Assume, we do a DFT on a given equal interval sampled 50Hz AC signal, the signal is a complete whole cycle, but the start sample point may at any point. And I get the amplitude and phase from the DFT, but what's the reference point of the phase?

• "signal is a complete whole cycle" you mean you've sampled 1 period of the sine wave? – Fat32 Jan 15 '15 at 12:46
• Yes. I assume I've sampled exactly an period of sine wave. – diverger Jan 15 '15 at 15:07

For signals that are strictly periodic an exact integer multiple in the FFT aperture, the phase (atan2(imag_component, real_component)) of the result from the most common implementations of an FFT are with respect to the edge of the window at point 0 (the phase at the time that the first sample, that was fed to the FFT, was taken). If you know the exact frequency, and the phase at one point in time, you can calculate the phase at any other point in time (or at nearby points in time if there is noise or other frequency estimator errors), as needed.

However, for signals that are not integer periodic in the FFT length, there will be a circular discontinuity between the last point and point 0. Since the FFT is circular (the only possibility with circular basis vectors), the measurement of phase at a point of discontinuity can be non-intuitive. For sinusoids that are not strict periodic in the FFT length, the sign of the phase also flips between FFT result bins, causing problems with simple linear (or other low order) phase interpolation (e.g. for estimating the phase of a sinusoid that is of a between-bins frequency).

However, an fftshift will move the phase measurement reference to the center of the FFT window (point N/2), where there isn't a discontinuity (assuming the input is continuous). The sign of the phase will no longer keep flipping, allowing easier estimation of interpolated phase.

An fftshift can be done by either rotating the whole input vector, or by flipping the phase (rotating 180 degrees) of every other FFT result bin, and may produce a phase reference point that makes more sense at the center of the FFT aperture or window.

If you assume that for a given DFT length $N$ your signal is given by

$$x[n]=A\cos(2\pi n/N+\phi),\quad n=0,1,\ldots,N-1$$

i.e. its period equals $N$, then the first DFT coefficient (starting to count from $0$) is given by

$$X=A\frac{N}{2}e^{j\phi}$$

• It always use $cos$ not a $sin$? – diverger Jan 15 '15 at 8:47
• However, if one assumes the signal is given by a single sinusoid that might not be integer periodic in the FFT length, the above gives one little clue as to the phase of that single sinusoids. – hotpaw2 Jan 15 '15 at 8:57
• @diverger: Yes. – Matt L. Jan 15 '15 at 9:03
• @hotpaw2: That's my interpretation of "the signal is a complete whole circle". – Matt L. Jan 15 '15 at 9:04