5
$\begingroup$

It is widely accepted that zero padding cannot reconstruct more information that is originally present in the sample data, which I think is intuitive, because zero padding adds no more information.

But in a case I found that it seems to be against the claim:

It shows DFTs of a two-mode signal with different zero paddings. With naive DFT we cannot distinguish the two modes in frequency spectrum, while we can make it with zero padding.

Is there something deep here?

$\endgroup$

3 Answers 3

11
$\begingroup$

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‎‎

$\endgroup$
5
$\begingroup$

What zero padding cannot do is help you resolve frequencies that cannot be resolved without it.

Without zero-padding, the resolution is 1 Hz and the DFT can in fact resolve the tones at 440 and 441 Hz, as clearly shown by @OverLordGoldDragon's plot.

Try changing the tones to 440 Hz and 440.2 Hz. You'll find that zero-padding doesn't help to resolve them.

$\endgroup$
3
  • 7
    $\begingroup$ Also, try a single tone at 440.5 Hz. It will appear exactly like the two frequency input, and the zero padding will falsely make it appear as two separate tones. $\endgroup$
    – Ben Voigt
    Commented Mar 17, 2022 at 16:42
  • $\begingroup$ @BenVoigt That sounded curious to me, so I tried it - it didn't look like two frequency input. Here red is 440.5 Hz and blue is 440 Hz + 441 Hz: jpa.kapsi.fi/stuff/pix/fft_two_freqs.png $\endgroup$
    – jpa
    Commented Mar 18, 2022 at 6:25
  • $\begingroup$ @jpa: So what's going on is there is a subtle phase difference between the single sinusoid and the sum-of-two-sinusoids, that causes the fake coefficient to be large or zero. But try the two sinusoid case again, with one sin and one cos, zero pad, and plot... and now that fake coefficient will be large much like the one sinusoid case. That center coefficient is not distinguishing between the one vs two component cases, but rather is related to the phase of the components vs the phase of the windowing function (zero padding is equivalent to windowing) $\endgroup$
    – Ben Voigt
    Commented Mar 18, 2022 at 16:24
3
$\begingroup$

Zero-padding doesn't make it possible to resolve more information than is present in the original signal, but it can make it easier to visually interpret the information that has been extracted. The situation is somewhat analogous to the difference between displaying a simple connect-the-dots plot of a 1024-sample capture of a sine wave whose frequency is 511/1024 times the sample rate, versus filtering the captured waveform with a perfect brick-wall filter. Both the original captured waveform and the brick-wall-filtered output will accurately record that if the original signal has no components above Nyquist, it must have been a sine wave with frequency 511/1024 times the sample rate, but the connect-the-dots output will "look" more like the superposition of a 511/1024 wave and a 513/1024 wave (which in turn looks like a modulated 512/1024 wave).

Depending upon what is being done with the results of the convolution or reconstruction, such filtering may or may not make a signal more useful. If one is trying to capture a square wave, a brick wall filter will produce a signal with transient spikes that extend beyond the swing range of the original signal. Use of such a filter before sampling may cause the result to more accurately represent the frequency content of the original signal than would using a Bessel filter with a gentler roll off, but would be counter-productive if one is interested in measuring the peak voltage in the original signal.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.