fft zero padding calculator
FFT Zero Padding Calculator guide
Appending zeros before an FFT samples the spectrum of the measured record at more frequencies. It gives a smoother view of a peak while preserving the data and observation duration that determine how closely separated tones can be distinguished.
Play the instrument ↑- Default result
- 11.71875 Hz padded grid spacing
Calculation and units
Original grid spacing is Fs/N for N measured samples. After padding to M samples, spacing is Fs/M and the number of zeros is M − N. The nominal observation window is N/Fs. All length inputs count samples per channel.
Worked examples
Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.
Fourfold padding
Recorded samples = 1024 · FFT length after padding = 4096 · Sample rate (Hz) = 48000.
11.71875 Hz padded grid spacing. Append 3072 zeros. Original grid 46.875 Hz. Observation window N/Fs = 21.333333 ms.
The plotted grid is four times denser than the unpadded transform while the captured time span stays fixed.
No padding
Recorded samples = 1024 · FFT length after padding = 1024 · Sample rate (Hz) = 48000.
46.875 Hz padded grid spacing. Append 0 zeros. Original grid 46.875 Hz. Observation window N/Fs = 21.333333 ms.
The original and padded grid coincide, and no extra samples are appended.
Non-power-of-two FFT
Recorded samples = 1000 · FFT length after padding = 3000 · Sample rate (Hz) = 48000.
16 Hz padded grid spacing. Append 2000 zeros. Original grid 48 Hz. Observation window N/Fs = 20.833333 ms.
Grid spacing depends on the actual transform length even when that length is not a power of two.
Longer real recording
Recorded samples = 4096 · FFT length after padding = 4096 · Sample rate (Hz) = 48000.
11.71875 Hz padded grid spacing. Append 0 zeros. Original grid 11.71875 Hz. Observation window N/Fs = 85.333333 ms.
Compare this with fourfold padding. Both outputs have the same bin spacing, but this case records four times as much signal.
CD-rate audio
Recorded samples = 441 · FFT length after padding = 4410 · Sample rate (Hz) = 44100.
10 Hz padded grid spacing. Append 3969 zeros. Original grid 100 Hz. Observation window N/Fs = 10 ms.
Ten milliseconds of measured audio are followed by zeros. The apparent frequency step does not extend the measured waveform.
Single recorded sample
Recorded samples = 1 · FFT length after padding = 8 · Sample rate (Hz) = 8.
1 Hz padded grid spacing. Append 7 zeros. Original grid 8 Hz. Observation window N/Fs = 125 ms.
An eight-point transform of one impulse can have eight bins while supplying no extra evidence about distinct pitches.
Interpreting the result
Try two cases with the same final transform length. In one, acquire more actual samples. In the other, append zeros. They have equal displayed bin spacing but different observation windows, which changes how much information the measurements carry.
A practical comparison is to record two close tones with a fixed window, then plot the same record using an unpadded FFT and a generously padded FFT. The second plot samples the same windowed spectrum at more locations. Next make a longer recording of the unchanged tones and repeat the first transform with an appropriately longer window. The shape and width of each peak can now change because the data span has changed. Keep the window type, sample rate and amplitude normalization visible when comparing plots, otherwise a change in peak height or width may be attributed to the wrong operation.
Measurement and model limits
Window choice, record duration, signal-to-noise ratio and spectral leakage affect peak separation. Padding does not create new independent observations. If reporting amplitude, use a normalization appropriate to the original record and window.
Music theory tools → · Moving Average Filter Calculator → · MathWorks on amplitude estimation and padding →
Answers before you play
Common questions
Must the FFT length be a power of two?
Many modern FFT libraries support other lengths. Some sizes execute faster, but the grid expression still uses the chosen length.
What if M equals N?
No zeros are added. The original and final grid spacing are the same.
Why reject M smaller than N?
That would truncate measured samples, a different operation that changes the waveform being analyzed.
Can a smoother peak reveal its frequency more precisely?
Padding can help locate the sampled maximum of an isolated peak. It does not provide the separating power of a longer real recording.