1
$\begingroup$

How do we calculate the phase of a signal with a noninteger period of a signal? For example, if a signal has a frequency of 1kHz and is sampled at 8kHz, 8 samples (1 period) can be used in the FFT or Goertzel to calculate the phase. However, if a signal has a frequency of 900Hz or 1.1kHz and is sampled at 8kHz, then 8 samples (1.11 or 0.909 periods respectively) will produce incorrect phase calculation. How do we compensate for a noninteger sample period?

$\endgroup$
  • $\begingroup$ I'm not sure I see what the problem is, but you could always interpolate to an integer sampling rate. $\endgroup$ – MBaz Nov 3 '16 at 16:30
  • $\begingroup$ the best thing to do to look at signals that are not precisely periodic with the $N$ samples going into the FFT (or are not periodic at all) is to gracefully window (and perhaps zero-pad) the data going in. usually the Kaiser window is the best suited for this. $\endgroup$ – robert bristow-johnson Nov 3 '16 at 18:26
  • 1
    $\begingroup$ If you know what is frequency and amplitude approximately, you can simply use sine curve fitting $\endgroup$ – MimSaad Nov 4 '16 at 17:04
1
$\begingroup$

Do an fftshift (rotate the input vector by N/2) before doing the FFT. Or for a phase measurement at a fixed point in time, start sampling the data earlier so the N/2 time sample in the FFT input vendor is at the time point where you want the measurement, and then flip the sign of the phase of every other bin of the FFT result (the odd numbered ones). This will move the phase reference point to the middle of the data window, where an input sinusoid will not have a discontinuity in phase that changes with frequency. This also allows interpolation of phase between FFT result bins.

The evenness/oddness ratio, and thus the FFT phase, does not change with frequency when a sinusoid's phase is referenced to (for example both generated at and measured with respect to) the center of the FFT aperture.

$\endgroup$

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.