Understanding the FFT frequency resolution calculator — concept and principle
A fast Fourier transform (FFT) splits a block of N samples into N frequency "bins". How finely those bins divide the spectrum, and how much time each block covers, depend only on the sample rate and the FFT size. This calculator gives the bin width, the frame duration and the number of usable bins up to the Nyquist frequency, so you can choose settings for spectrum analysers, tuners, vibration monitoring or audio plugins.
How it is calculated
- Bin width (frequency resolution): Δf = f_s / N, in Hz.
- Frame time: T = N / f_s, shown in milliseconds (× 1000).
- Bins up to Nyquist: N / 2.
f_s is the sample rate in hertz and N is the number of samples per FFT, often a power of two such as 1,024, 4,096 or 16,384.
The principle
The discrete Fourier transform compares the block of samples with sine waves that fit a whole number of cycles into the block. The slowest such wave completes one cycle in T seconds, so its frequency is 1/T; the others are integer multiples of it. Since T = N/f_s, the spacing is f_s/N. For a real-valued signal, the bins above f_s/2 mirror those below, so only about half carry new information. This creates the basic time–frequency trade-off: finer frequency detail needs a longer block, which blurs changes in time.
Worked example
- Inputs: f_s = 48,000 Hz, N = 4,096.
- Bin width: 48,000 / 4,096 = 11.71875 Hz.
- Frame time: 4,096 / 48,000 = 0.08533 s = 85.33 ms.
- Bins up to Nyquist: 4,096 / 2 = 2,048, covering 0 to 24,000 Hz.
| FFT size | Bin width (Hz) |
|---|---|
| 1,024 | 46.875 |
| 2,048 | 23.4375 |
| 3,072 | 15.625 |
| 4,096 | 11.71875 |
| 5,120 | 9.375 |
| 6,144 | 7.8125 |
| 8,192 | 5.859375 |
How to read the result
With 11.7 Hz bins you can separate tones roughly that far apart, which is fine in the treble but coarse in the bass, where adjacent semitones near 50 Hz differ by only about 3 Hz. To resolve them, increase N or lower the sample rate; to track fast transients, use a smaller N. Typical audio analysers use 2,048 to 8,192 points at 44.1 or 48 kHz, and overlap successive frames by 50–75% to smooth the display in time.
Common mistakes
- Believing that zero-padding improves true resolution: it interpolates the spectrum but cannot separate tones closer than about the bin width of the real data length.
- Forgetting window functions: a Hann or other window widens the main peak by a factor that depends on the window, so practical resolution is coarser than Δf.
- Counting bins: including both DC and the Nyquist bin gives N/2 + 1 values.
Frequently asked questions
Does N have to be a power of two?
No, but radix-2 FFT algorithms are fastest for powers of two, so most software prefers them.
What FFT size gives about 1.5 Hz resolution?
At 48 kHz, N = 32,768 gives 1.46 Hz bins, with frames of about 0.68 s.
What is a spectrogram's time step?
The hop size (N minus the overlap) divided by f_s; with 50% overlap at the default inputs it is about 42.67 ms.
Sources: J. W. Cooley and J. W. Tukey, "An Algorithm for the Machine Calculation of Complex Fourier Series," Mathematics of Computation, 1965 · F. J. Harris, "On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform," Proceedings of the IEEE, 1978