# Measuring Phase Difference at DC bin aliased frequency using FFT

I have a code in which two complex signals (I/Q) are created having same frequency but with phase difference. FFT of both signals is taken and atan2 is used to compute phase after which the difference between both phases is calculated.

While changing the input frequency it was observed that for the case where the signal frequency is integer multiple of Fs such that its FFT peak lies on DC bin, the correct phase difference is still obtained. How can phase calculated from DC bins give the correct value. Can anyone explain the underlying logic?

It works because the signals are complex. If they were real (actually a sum of two complex signals each) it would not. With a pure complex tone, as you sweep the frequency up it just loops around the DFT bins, no bin more special than another.

A confirmation of this is that a phase shift in a pure complex tone will rotate all the DFT bins the same, whereas for real valued signals the rotations will be "pinned" to real values at the DC and Nyquist (when N even) bins.

The "DC bin" does not represent DC exclusively, but has also some low frequency energy. How much depends on the fft size and sampling rate. Simple example: if your fft size is 1000 and your sampling rate is 1000Hz, then the dc bin represents frequencies from 0 to 0.5Hz, as the distance between fft bins is 1Hz. So, a phase can be calculated for the DC bin.

• And can phase also be calculated if the signal frequency is exactly an integer multiple of the sampling frequency? e.g Fin=200 or 300 KHz and Fs=100KHz? Commented Apr 2, 2020 at 9:53
• Why not? It does not matter, wether contribution is "genuine" or from aliasing.
– Max
Commented Apr 2, 2020 at 9:57
• as per my understanding (which may be incorrect) alias to dc bin would mean that the sampled signal is essentially a straight line at some DC offset. How can that signal contain phase information? Commented Apr 2, 2020 at 10:55
• It's alias to DC bin but it is not really DC only! It contains phase information for frequencies between 0Hz and $f_s/(2N)$ .
– Max
Commented Apr 2, 2020 at 11:05
• Thanks for your input. I wanted to mark both answers as correct but since i can only choose one I have chosen Cedron's because of the statement that it will only work with complex signals not real ones. Commented Apr 3, 2020 at 5:36