0
$\begingroup$

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?

$\endgroup$
0
$\begingroup$

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.

| improve this answer | |
$\endgroup$
0
$\begingroup$

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.

| improve this answer | |
$\endgroup$
  • $\begingroup$ 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? $\endgroup$ – emerald_waves Apr 2 at 9:53
  • $\begingroup$ Why not? It does not matter, wether contribution is "genuine" or from aliasing. $\endgroup$ – Max Apr 2 at 9:57
  • $\begingroup$ 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? $\endgroup$ – emerald_waves Apr 2 at 10:55
  • $\begingroup$ 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)$ . $\endgroup$ – Max Apr 2 at 11:05
  • $\begingroup$ 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. $\endgroup$ – emerald_waves Apr 3 at 5:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.