# Question about zero padding example in Lyons book on Understanding DSP

I have been reading "Understanding Digital Signal Processing" by Richard Lyons and I find the example in Section 3.11 on zero-padding a little confusing. Incidentally IMHO this is the best written DSP book (by far) and that is why I get concerned if I don't fully understand something.

In Figure 3-21 we see the DFT input of three cycles and the corresponding DFT output. It seems odd that this DFT is plotted over the CFT of the continuous-time three-cycle pulse. My thought is that the DFT input is just three cycles, and it "has no idea" that the waveform is zero outside that range, so the comparison to the CFT seems irrelevant. But perhaps it is just done to as a base for later comparison.

But as zero-padding is added, you could imagine that you are just making the DFT input waveform appear more and more like the continuous time waveform, and thus the DFT becomes more similar to the CFT, which I don't believe is the right intuition. Instead, the example is supposed to show the effects of zero padding. Is my confusion caused by the particular example waveform chosen (which is like a zero-padded pulse), or am I missing something?

On the left side of Figure 3-21(a) the discrete 16-sample input sequence is represented by the dots. (The lightly-shaded sinusoidal curve is shown for reference only!)

On the right side of Figure 3-21(a) the dots represent the magnitudes of the first seven samples of the 16-point DFT output sequence. The lightly-shaded |sin(x)/x| curve is the magnitude of the continuous "discrete-time Fourier transform" (DTFT) of the 16 input samples. Notice that the DFT dots are "discrete samples"of the DTFT curve.

When we "zero-pad" the input sequence, by appending zero-valued input samples, and perform a larger-sized DFT our larger-sized DFT output magnitude sequence now samples the continuous DTFT magnitude curve more often.

• Thanks for the answer. While I understand the mechanics of what is going on, I have to say that it still bothers me (conceptually) that we are somehow extracting more spectral information without adding any information to the input. In a similar vein, we are somehow making the DFT operator "know" that those three cycles are a pulse, without adding any more real input information I will try playing around with other zero-padding examples to try to straighten out my thinking. Dec 19, 2023 at 15:10
• @gschro, see my second answer. Dec 19, 2023 at 17:28

@gschro, I understand your puzzlement. Find the equation for computing a DTFT, in a textbook or on the Internet, and carefully examine it. In that equation $$omega$$ is a continuous frequency variable measured in radians/sample. The DTFT equation allows us to write down on a piece of paper the equation for the magnitude of the continuous DTFT of the 16-sample input sequence.

The DTFT equation will have 16 terms on its right side. If we plug in some value for $$omega$$ in the DTFT equation we’ll have a 16-term equation whose sum is a single point of the input signal’s continuous Fourier transform. If you take the magnitude of that 16-term equation you will have calculated one point on light-shaded curve in my Figure 3-12(a)’s right side.

So the magnitude of the DTFT equation completely describes (yielding all possible information of) the light-shaded spectral curve with infinitely-fine granularity. The DTFT equation, and the spectral curve, give us ALL possible information regarding the input signal’s continuous Fourier transform magnitude.

A 16-point DFT magnitude sequence merely gives us 16 samples of the continuous Fourier transform magnitude curve. Zero padding, and a larger-sized DFT, merely gives us additional samples of the continuous Fourier transform magnitude curve. Zero padding does not give us any new information about that spectral curve because we already knew EVERYTHING about the curve from our DTFT equation.

I hope what I've written here makes sense.

• Hay Rick, I'm glad to see you hangin' here. I got your first edition hiding around here somewhere. (It was cool reviewing it for the AES sometime in the 1990s. At that time we had a dearth of good practical DSP books. Now not so much.) Dunno if the figures are numbered the same. Dec 19, 2023 at 22:55
• Hi Robert. Your book review was probably back in 1996. My book's Figure 3-21 is the same in all three editions. (You've been in the DSP business for a long time!) Merry Christmas Robert. Dec 19, 2023 at 23:24