# Fourier FFT frequencies [duplicate]

I am using FFT (Fourier) on a dataset that contains the temperature along a rod 1m long. The data is sampled with a spacing of 0.01m, so I have 100 measurements in total.

This gives me a sampling rate of 100 1/m. Now, when I call Fourier I get out a list with 100 numbers in frequency-space, where the first corresponds to 0-frequency.

Say I shift the data so the 0-frequency will be in the center. I am unsure of what the largest and smallest wavevector is.

Is it simply -50 (smallest) and +49 (largest)? Thereby implying that the smallest perturbation my FFT can resolve is 1/0.02 = 50, i.e., 0.02m?

• If you FFT a complex sinusoid with a whole number of cycles over your data set, you can easily find the correspondence between frequency and bin number. – mikado Aug 9 '16 at 21:12

The frequencies $f$ returned by the FFT (Fourier) are

$f={0,d,2d,...,(N/2)d,(-N/2+1)d,(-N/2+2)d,-2d,-d}$,

where $N$ is the number of points in the input series, and the frequency increment is $d=1/T$ where $T$ is the period of the input series. In your case, the "period" $T=1$ meter, so $d=1 m^{-1}$. The special frequency $(N/2) d$ is the Nyquist, or folding, frequency, and is the highest frequency representable by the FFT. There is one zero frequency, one Nyquist frequency, and $(N-2)/2$ positive/negative pairs of other frequencies.

f = d * Join[Range[0, n/2], -n/2 + Range[1, n/2 - 1]]


Shifting the data so that the zero frequency is in the centre requires (for even $N$)

RotateRight[f,Floor[Length[f]/2-1]]


where f is the original list of frequencies. Thus, the list of frequencies to associate with the 100 numbers returned by Fourier is, after shifting:

{-49, -48, -47, ..., -2, -1, 0, 1, 2, ..., 48, 49, 50}