Been experimenting with FFT on a generated sinusoid and found something strange that doesn't seem to be described anywhere (though I may be missing something of course).
A sinusoid that exactly corresponds to a bin gives what we all know: an amplitude and a phase shift of the sinusoid in that bin.
However, for a frequency that falls between two bins the phase shift of the strongest bin expressed in polar angle seems to be shifted by almost exactly the amount by which the peak frequency is shifted from the strongest bin number. The phase shifts of the neighbouring bins also seem to show some correlation but it is not as strong.
For example, if the distance between bins is $\Delta = 44Hz$, I generate $f = 440Hz$, I get a clear sinusoid at bin $i = 10$ that yields phase angle $\phi = 0$ (the sinusoid itself is shifted by a quarter period for simplicity, hence $0$).
If I generate say
$f = 440Hz + k·\Delta$, where $k \in [-0.5, 0.5]$
then $\phi$ for the strongest bin 10 looks like $k·\pi$.
Some sample measurements:
$k=-0.5 \Rightarrow \phi=-0.499·\pi$
$k=-0.25 \Rightarrow \phi=-0.252·\pi$
$k=-0.15 \Rightarrow \phi=-0.151·\pi$
$k=-0.05 \Rightarrow \phi=-0.054·\pi$
The deviation gets bigger as you move towards the bin, though it's pretty good near the middle. Is this some kind of a parabolic correlation?
So what's the math behind this? Why do these values seem correlated?
And if they are correlated, could this be used for finding the peak frequency with some precision?
$$ f = k - \frac{N}{2\pi} \delta $$
From (24)
$$ \arg(X[k]) = -\delta (N-1)/2 + \phi $$
Arg is the angle of the bin value. If you haven't been able to put these together by tomorrow, I will post the details. Remember, this is treating your signal as an approximation, which is why it isn't exact. Notice that a priori knowledge of $\phi$ is needed for this approach. This is why all the bin frequency formulas have more than one bin value used. The phase is then implicitly used.
– Cedron Dawg Nov 14 '19 at 20:55