📐

Frequency Error Calculator

Calculate FFT frequency resolution, bin width, Nyquist frequency, and measurement uncertainty based on your sample rate and FFT size. Get lab-report-ready formatted results.

🛡 All calculations are performed locally in your browser. No data is sent to any server.

Parameters

Hz
Common:
Hz
Enter a target to get the recommended FFT size

FFT Analysis Results

Frequency Resolution
10.77
Hz per bin
Bin Width
10.77 Hz
Nyquist Frequency
22050 Hz
Total Bins
2048
Time Window
92.88 ms
Effective Resolution (with window)
21.53 Hz
Hanning window widens mainlobe by 2x
Core Formulas
Resolution = Sample Rate / FFT Size
= 44100 / 4096 = 10.77 Hz

Windowing Function Impact

Window Mainlobe Width (bins) Effective Resolution Sidelobe Level Best For

Recommended FFT Sizes for Target Resolutions

Target Resolution Required FFT Size Actual Resolution Time Window

Frequency Bin Width Diagram

▬ Frequency Bins ▬ Nyquist Limit

How to Use This Calculator

  1. Set your sample rate — Enter the sample rate of your audio system or select a common preset (44100 Hz for CD quality, 48000 Hz for professional audio, 96000 Hz for high-resolution recording).
  2. Choose an FFT size — Select the number of samples per FFT frame. Larger sizes give finer frequency resolution but require more processing time and longer time windows.
  3. Select a window function — The windowing function affects the trade-off between frequency resolution and spectral leakage. Hanning is a solid default for most applications.
  4. Read your results — The calculator instantly shows frequency resolution, bin width, Nyquist frequency, total bins, and time window duration. Use the copy button for lab-report-ready formatted output.

Understanding the Results

  • Frequency Resolution (Hz/bin) — The minimum frequency difference that can be distinguished between two spectral components. Equal to Sample Rate / FFT Size.
  • Bin Width — Identical to frequency resolution; each FFT output bin spans this many Hz. A 10.77 Hz bin width means the FFT cannot distinguish two tones less than 10.77 Hz apart.
  • Nyquist Frequency — The highest frequency that can be accurately represented, equal to half the sample rate. Frequencies above Nyquist alias to lower frequencies.
  • Total Bins — The number of unique frequency bins in the FFT output, equal to FFT Size / 2. Each bin represents one frequency resolution step.
  • Time Window Duration — The length of audio needed to fill one FFT frame: FFT Size / Sample Rate. Longer windows give better frequency resolution but worse time resolution.
  • Effective Resolution — The actual resolving power after windowing. Non-rectangular windows widen the mainlobe, reducing resolution by a factor proportional to the window's mainlobe width.

Technical Background

The Fast Fourier Transform (FFT) converts a discrete time-domain signal into its frequency-domain representation. The fundamental relationship governing FFT frequency resolution is:

Frequency Resolution = Sample Rate / FFT Size

This means that for a 44100 Hz sample rate with an FFT size of 4096, the frequency resolution is 44100 / 4096 = 10.77 Hz. You cannot resolve two frequency components closer than 10.77 Hz apart. To improve resolution, you must either increase the FFT size (which requires a longer time window) or decrease the sample rate (which reduces the maximum representable frequency).

The Nyquist-Shannon sampling theorem establishes that a signal must be sampled at a rate at least twice its highest frequency component to avoid aliasing. The Nyquist frequency (Sample Rate / 2) therefore defines the upper bound of your frequency analysis. Any energy above Nyquist folds back into the spectrum as aliased artifacts.

Windowing functions are applied to the time-domain signal before the FFT to reduce spectral leakage. When a signal's frequency does not align exactly with an FFT bin center, energy "leaks" into adjacent bins. A rectangular window (no windowing) has the narrowest mainlobe (best resolution) but the highest sidelobes (worst leakage). The Hanning window doubles the mainlobe width but suppresses sidelobes by about 31 dB. The Blackman window triples the mainlobe width with sidelobes down 58 dB, making it excellent for detecting weak signals near strong ones.

There is always a fundamental trade-off: finer frequency resolution requires longer time windows. A 1 Hz resolution at 44100 Hz sampling requires an FFT size of at least 44100 samples, corresponding to a 1-second time window. This means you cannot track frequency changes faster than once per second at that resolution. This time-frequency uncertainty principle is analogous to the Heisenberg uncertainty principle in quantum mechanics and is inherent to all Fourier analysis.

Frequently Asked Questions

What FFT size should I use for music analysis?
For general music analysis at 44100 Hz, an FFT size of 4096 (10.77 Hz resolution) is a good starting point. For pitch detection of low-frequency instruments (bass guitar, kick drum), use 8192 or 16384 to resolve the closely-spaced harmonics. For real-time visualization where time resolution matters more, 2048 or even 1024 may be preferable despite coarser frequency resolution.
Why does the window function affect frequency resolution?
Window functions taper the signal toward zero at the edges of the FFT frame to reduce spectral leakage. This tapering effectively broadens the mainlobe of the frequency response, which means each spectral peak occupies more bins. A Hanning window doubles the mainlobe width (2 bins instead of 1), so your effective resolution is halved compared to rectangular windowing. The trade-off is significantly reduced sidelobe leakage.
How do I calculate the measurement uncertainty of an FFT-based frequency measurement?
The worst-case measurement uncertainty of a simple peak-picking FFT approach is plus or minus half the bin width. For a 44100 Hz sample rate with 4096-point FFT, the bin width is 10.77 Hz, so the uncertainty is about 5.38 Hz. You can reduce this with zero-padding, parabolic interpolation, or phase-based methods, which can achieve sub-bin accuracy down to approximately 1/10th of a bin width.
What is the difference between FFT size and zero-padding?
Increasing the FFT size with actual signal data improves true frequency resolution because you are providing more independent samples. Zero-padding (appending zeros to reach a larger FFT size) increases the number of output bins and interpolates the spectrum, making peaks easier to locate, but does not improve the fundamental frequency resolution. True resolution is determined only by the duration of actual signal data.
Can I resolve two tones closer than one bin width apart?
Not with a standard FFT and simple peak detection. Two tones within one bin width will merge into a single broad peak. To resolve them, you need either a larger FFT size (longer observation window), super-resolution methods like MUSIC or ESPRIT, or parametric spectral estimation. The Rayleigh criterion states that two tones are resolvable when their separation equals at least the mainlobe width of the window function.
Why is frequency resolution inversely proportional to time window length?
This is a fundamental property of Fourier analysis known as the time-frequency uncertainty principle. A signal must be observed for at least T seconds to resolve frequency components spaced 1/T Hz apart. Short windows give good time resolution but poor frequency resolution; long windows give the opposite. This is not a limitation of the FFT algorithm itself but a mathematical property of any spectral analysis method.