Sign up ×

Say I pass 512 samples into my FFT








share|cite|improve this question
You are aware of being able to decompose a complex number into its magnitude and phase, yes? – J. M. Nov 8 '10 at 11:37
This paper, by Barry Kulp, gives a technique for using two adjacent bin values for interpolating the exact frequency: Hope it's of use. – mtrw Dec 22 '10 at 22:15

5 Answers 5



share|cite|improve this answer



Quadratic Interpolation of Spectral Peaks

share|cite|improve this answer






share|cite|improve this answer


share|cite|improve this answer
up vote 1 down vote accepted

In the end I derived a formula that calculates the exact frequency from the rate at which each bin rotates.

My result can be seen here:

To understand bin rotation, just look at a single bin. So let's consider theta = 2pi/12, so exp(i.n.theta) for n in {0, ..., 11} will give us our twelve 12th-roots of unity; if you look on the complex plane it will make a 12 pointed star.

Now if the signal matches that frequency, Ie 12 samples makes one wave, then repeatedly projecting that signal onto that star ( proj[k] = sig[k]*star[k%12] ) will stretch out one spine (the one corresponding to the maximum positive amplitude of sig[k], the peak of the sine wave if you like) and will squash or negatively stretch (depending on whether the sine wave is vertically centred, i.e. DC offset = 0) the diametrically opposite spine.

If you keep a running vector sum of the last 12 projections, the result will come out in this direction, by symmetry. And the angle of the result gives the bin phase, and length gives the bin magnitude.

And the phase remains constant. So no bin rotation.

But now if you change the input frequency to {13 samples = one wave}, you can see that this vector sum is now going to rotate 1/12 of a cycle If a peak corresponds to an angle of 0, the next peak will no longer line up, it will correspond to 1/12 of a revolution

And this is the bin rotation.

While I wouldn't expect the reader to derive the answer from this basis, it will hopefully give some intuitive understanding of what is going on.

share|cite|improve this answer

Your Answer


