# Calculating phase with noninteger periods of a sinusoid

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?

• I'm not sure I see what the problem is, but you could always interpolate to an integer sampling rate. – MBaz Nov 3 '16 at 16:30
• 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. – robert bristow-johnson Nov 3 '16 at 18:26
• If you know what is frequency and amplitude approximately, you can simply use sine curve fitting – MimSaad Nov 4 '16 at 17:04