FFT and sampling calculator

Type a sample rate and FFT size to get bin width, frame time and time step, or a frequency to see where it lands after sampling.

Arrow up doubles the size, arrow down halves it.

FFT resolution

Bin width—
Frame length—
Useful bins—
Time step—
RBW (ENBW)—
Scallop loss—
%

Work backwards: what FFT size gives the detail I need?

    Common sample rates

    Sample rateNyquistBin widthFrameYour signal shows at
    Worked out in your browser. Nothing is sent anywhere.

    How to use the FFT calculator

    1. Set the sample rate. Type it, or tap 44.1k, 48k, 96k or 192k. You can type 48k or 2.4M, and pick Hz, kHz, MHz or GHz.
    2. Set the FFT size. Type the number of samples or tap a size. The arrow keys double or halve it. Sizes that are not a power of two work too.
    3. Read the answers. Bin width, frame length, useful bins and time step update as you type. Choose a window and an overlap to see the RBW and the hop.
    4. Check aliasing. Open Aliasing (on a wide screen it sits beside the first part) and type a signal frequency. The folding diagram shows where it lands.
    5. Work backwards if you know the detail you need: type the bin width and press Use. Then press Copy results or Share link.

    Worked examples

    48 kHz and an 8,192-point FFT

    The bin width is the sample rate divided by the FFT size: 48,000 ÷ 8,192 = 5.859375 Hz, so about 5.86 Hz. The frame is the FFT size divided by the sample rate: 8,192 ÷ 48,000 = 0.17067 s, about 171 ms. You get 4,097 useful bins, from 0 Hz up to 24 kHz.

    With 50 % overlap a new frame starts every 4,096 samples, which is a time step of 85.3 ms. The Hann window widens each bin to an RBW of 1.5 bins, or 8.79 Hz.

    A 30 kHz tone sampled at 48 kHz

    The Nyquist frequency is half of 48 kHz, so 24 kHz. A 30 kHz tone is 6 kHz above it, so it folds back to 24 − 6 = 18 kHz. The same answer comes from |30 − 48| = 18 kHz. The alias is mirrored: if the tone rises to 31 kHz, the false tone falls to 17 kHz.

    zone 1: seen as it iszone 2: folded, mirrored 024 kHz 024 kHz48 kHz real tone 30 kHz shows up at 18 kHz real frequency → · up the side: where it shows up after sampling
    Every frequency on the bottom axis maps to one point on the zigzag. Read across to the left to see where it appears.

    A signal that folds many times

    A 100 kHz tone at 48 kHz sits in Nyquist zone 5. It folds at 24, 48, 72 and 96 kHz and lands at 100 − 2 × 48 = 4 kHz. Type 100 kHz in the tool to see the four folds on the diagram.

    Working backwards from 1 Hz

    Say you want 1 Hz bins at 48 kHz. The exact size is 48,000 ÷ 1 = 48,000 samples, which is not a power of two, so the tool suggests 65,536. That gives 0.732 Hz bins and a 1.37 s frame. If you mean an RBW of 1 Hz with the Hann window, you need 1.5 times as many samples, at least 72,000, so 131,072. A long frame like this is fine for steady tones, but a short drum hit gets lost inside it.

    Use cases

    Pick an FFT size for hum

    Mains hum sits at 50 or 60 Hz with harmonics every 50 or 60 Hz. With 11.7 Hz bins (4,096 at 48 kHz) those peaks smear together near the bottom of the graph. A 32,768-point FFT gives 1.46 Hz bins and a 683 ms frame, which is what the hum preset of the live spectrum analyzer uses. To split 49.75 Hz from 50 Hz you need about 0.25 Hz: type that under Work backwards and you get 262,144 samples, a 5.5 s frame.

    Choose a sample rate

    Bat calls around 40 kHz need a sample rate above 80 kHz. Real converters only pass about 45 % of the rate, so 96 kHz (good to about 43 kHz) is the safe pick. The harmonics option helps with plugins too: at 44.1 kHz, the 4th harmonic of a 7 kHz tone is 28 kHz, which folds to 16.1 kHz. That is not a harmonic of 7 kHz, so it sounds harsh. Plugins that oversample avoid it. For the sum and difference tones of two signals, see mixing products.

    Check an SDR for images

    An RTL-SDR in direct-sampling mode samples at 28.8 MHz, so its Nyquist frequency is 14.4 MHz. A 20 MHz signal folds to 8.8 MHz, and a strong 100 MHz FM station can land at 13.6 MHz, right in the 22 m shortwave band. If you hear a station where none should be, type both numbers here. A low-pass filter below 14.4 MHz in front of the input stops it.

    Formulas

    These are the formulas the calculator uses. fs is the sample rate and N is the FFT size.

    • Bin width: Δf = fs ÷ N. Frame length: T = N ÷ fs = 1 ÷ Δf.
    • Useful bins: N ÷ 2 + 1 (rounded down for odd N), from 0 Hz to fs ÷ 2.
    • Hop: N × (1 − overlap); the time step is the hop ÷ fs.
    • RBW: ENBW × Δf, where ENBW = N × Σw² ÷ (Σw)² for the window w. Hann gives 1.5 bins; flat-top gives 3.77.
    • Nyquist: fN = fs ÷ 2. Alias: |f − k × fs|, where k is f ÷ fs rounded to the nearest whole number. The zone is f ÷ fN, rounded up.
    • Working backwards: N = fs ÷ Δf, rounded up to the next power of two.

    Zero-padding only fills in points between the bins; the real detail still comes from the samples you have. To see why the window changes the RBW, read about window functions, or start with FFT explained. More lessons are in spectrum analyzer basics.

    FAQ

    What is the Nyquist frequency?

    Half the sample rate: the highest frequency that can be sampled without aliasing. At 48 kHz it is 24 kHz.

    What is aliasing?

    A frequency above Nyquist folds back and appears as a false lower frequency. At 48 kHz, a 30 kHz tone shows up at 18 kHz.

    How do I get finer frequency detail?

    Use a bigger FFT or a lower sample rate; both lengthen the time window, so the result reacts more slowly.

    Does zero-padding add resolution?

    It makes the curve smoother but does not separate close tones better. Only more real samples do that.

    Written and tested by the SpectrumAnalyzer.app team · Last checked

    How we tested: Checked against answers worked out by hand: 48 kHz with an 8,192-point FFT gives 5.859375 Hz bins and a 170.67 ms frame, a 30 kHz tone sampled at 48 kHz shows up at 18 kHz, 100 kHz at 48 kHz shows up at 4 kHz after 4 folds, and the Hann window's ENBW is 1.500 bins.