next Ideal Spectral Interpolation
previous Stretch Operator
up Signal Operators   Contents   Global Contents
global_index Global Index   Index   Search


Zero Padding

Zero padding consists of appending zeros to a signal. It maps a length $ N$ signal to a length $ M>N$ signal, but $ M$ need not be an integer multiple of $ N$:

$\displaystyle \hbox{\sc ZeroPad}_{M,m}(x) \isdef \left\{\begin{array}{ll}
x(m), & 0 \leq m \leq N-1 \\ [5pt]
0, & N\leq m \leq M-1 \\
\end{array}\right.
$

For example,

$\displaystyle \hbox{\sc ZeroPad}_{10}([1,2,3,4,5]) = [1,2,3,4,5,0,0,0,0,0]
$

The above definition is natural when $ x(n)$ represents a signal starting at time 0 and extending for $ N$ samples. If, on the other hand, we are zero-padding a spectrum, or we have a time-domain signal which has nonzero samples for negative time indexes, then the zero padding is normally inserted between samples $ (N-1)/2$ and $ (N+1)/2$ for $ N$ odd (note that $ (N+1)/2 = -(N-1)/2 \mod N$), and similarly for even $ N$. Thus, for spectra, zero padding is inserted at the point $ z=-1$ ( $ \omega=\pi f_s$). Figure 7.5 illustrates this second form of zero padding. It is also used in conjunction with zero-phase FFT windows (discussed further in §7.4.4 below).

Figure 7.5: Illustration of frequency-domain zero padding:
a) Original spectrum $ X=[3,2,1,1,2]$ plotted over the domain $ k\in [0,N-1]$ where $ N=5$ (i.e., as the spectral samples would normally be held in a computer array).
b) $ \hbox{\sc ZeroPad}_{11}(X)$.
c) The same signal $ X$ plotted over the domain $ k\in [-(N-1)/2,(N-1)/2]$ which is more natural for interpreting negative frequencies.
d) $ \hbox{\sc ZeroPad}_{11}(X)$.
\resizebox{\textwidth}{!}{\includegraphics{eps/zpad.eps}}

Using Fourier theorems, we will be able to show that zero padding in the time domain gives bandlimited interpolation in the frequency domain. Similarly, zero padding in the frequency domain gives bandlimited interpolation in the time domain.

It is important to note that bandlimited interpolation is ideal interpolation in digital signal processing.


next Ideal Spectral Interpolation
previous Stretch Operator
up Signal Operators   Contents   Global Contents
global_index Global Index   Index   Search

``Mathematics of the Discrete Fourier Transform (DFT)'', by Julius O. Smith III, (online book).

(Browser settings for best viewing results)
(How to cite this work)
(Order a printed hardcopy)

Copyright © 2003-08-28 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA  (automatic links disclaimer)