ArticlePDF Available

# Signal sinc‐interpolation: A fast computer algorithm

Authors:

## Abstract and Figures

An efficient algorithm for discrete signal sinc-interpolation that is suitable for use in image and signal processing is described. Being mathematically equivalent to the commonly used zero padding interpolation method, the algorithm surpasses it in terms of flexibility, computational complexity and usage of computer memory.
Content may be subject to copyright.
Bioimaging 4(1996) 225–231. Printed in the UK
Signal sinc-interpolation: a fast
computer algorithm
L P Yaroslavsky
Interdisciplinary Department, Engineering faculty, Tel-Aviv University, Tel-Aviv,
69978, Israel
Submitted 24 April 1996, accepted 13 August 1996
Abstract. An efﬁcient algorithm for discrete signal sinc-interpolation that is suitable
for use in image and signal processing is described. Being mathematically equivalent to
the commonly used zero padding interpolation method, the algorithm surpasses it in
terms of ﬂexibility, computational complexity and usage of computer memory.
Keywords: image processing, interpolation
1. Introduction
Discrete signal interpolation is a very common operation
in digital signal and image processing. It is required
when one needs resolution in the signal domain higher
than that corresponding to the sampling rate. Typical
examples are signal positioning and object location with
subpixel accuracy, image zooming and other geometrical
transformations. The most commonly used signal
interpolation methods are nearest neighbor and linear and
bilinear (in 2-D) interpolation methods. They are popular
due to their computational simplicity. Unfortunately, these
simple approaches have low interpolation accuracy and
produce considerable aliasing artifacts.
The nearest neighbor and bilinear interpolation methods
correspond to zero and ﬁrst order spline models,
respectively. General polynomial spline interpolation
is asymptotically equivalent to sinc-interpolation ,
the most accurate method for representing signals with
monotonically decreasing spectra. When properly used,
this method entirely avoids aliasing errors. In sinc-
interpolation, a continuous signal a(x)is restored from its
samples {an}taken with a discretization interval 1x in the
following way:
a(x) =
n=∞
X
n=−∞
ansinc(π(x /1x n)) (1)
where
sinc(x) =sin x
x(2)
On leave from the Institute of Information Transmission Problems,
Russian Academy of Sciences, Moscow, Bolshoi Karetny 19, Russia.
is the interpolation sinc-function. In digital signal
processing, the exact sinc-interpolation is replaced by the
signal interpolation from its ﬁnite number of Nsamples
a(x) =
N1
X
k=0
ak
sin(π M(x/1x k)/N )
Nsin(π(x/1x k)/N)(3)
with a function
sincd(M;N;x) =sin(πM x/N )
Nsinx/N ) (4)
that is a discrete analog of the sinc-function (2) and
approximates it to the accuracy of boundary effects. M
is a parameter equal to N1,N or N+1 depending on
the algorithmic implementation of the interpolation formula
(3). The well known and commonly used digital signal
processing method for discrete sinc-interpolation is ‘zero
Fourier transform (DFT) spectrum with an appropriate
number of zeros and performing the inverse transformation
of the padded spectrum. Since the number of signal samples
has (usually) to be a power of two, and therefore an even
number, to permit the fast Fourier transform to be used,
three methods of zero padding are possible.
Let {αr}be DFT coefﬁcients of a discrete signal
{an,n=0,1,...,N 1}:
α
r=1
N
N1
X
n=0
a
nexpi2πnr
N.(5)
In the ﬁrst method the signal spectral coefﬁcient αN/2
0966-9051/96/040225+07\$19.50 c
1996 IOP Publishing Ltd 225
L P Yaroslavsky
Figure 1. Interpolation functions for different versions of discrete sinc-interpolation.
interpolation by equation (3) with M=N1, while in
the second method this coefﬁcient is repeated twice which
results in the interpolation by equation (3) with M=N+1.
The third method is a combination of the ﬁrst two methods
when the coefﬁcient αN/2is halved and then repeated
twice as in the second method. This results in a signal
interpolation with a function
sincd(±1;N;x) =(sincd(N 1;N;x)
+sincd(N +1;N;x))/2 (6)
that converges to zero faster than the functions (4) with
M=N±1 (see ﬁgure 1, where the interpolation functions
(4), for M=N1 and M=N+1, and (6) are plotted
from top to bottom, respectively) and therefore produces
fewer boundary effects.
The computational complexity of this method is
O(N L logNL), where L(the expansion factor) is the
number of interpolated signal samples per initial one. One
can reduce this complexity to O(N L logN) with the use
of so-called ‘pruned’ FFT algorithms [2–4]. They exploit
the fact that among NL samples of the zero padded
spectrum only Nsamples are nonzero. However, the ‘zero
very inefﬁcient storage-wise because it requires a buffer
memory for NL signal samples while actually working
with the sequences of Nsamples; the use of most widely
226
Signal sinc-interpolation: a fast computer algorithm
Figure 2. An algorithm for discrete sinc-interpolation.
used FFT subroutines requires Lto be a power of two
which does not allow signal expansion by arbitrary factors;
implementation of the ‘pruned FFT’ algorithms requires
cumbersome programming.
In the following, we present an alternative method of
sinc-interpolation which eliminates these restrictions. The
method is based on the so-called shifted DFTs [4–6].
2. Discrete sinc-interpolation by shifted DFTs
Shifted DFTs (SDFTs) take into account the possibility of
an arbitrary shift of signal discretization sample points with
relation to the signal coordinate system and are deﬁned as
αu,v
r=1
N
N1
X
n=0nanexpi2πnv
Noexp i2π(n +u)r
N(7)
for the direct SDFT and
au,v
n=1
N
N1
X
r=0nαrexpi2πru
No
×expi2πn(r +v)
N(8)
for the inverse DFT and arbitrary shift parameters
(u, v). These parameters describe respective shifts (in
fractions of the corresponding discretization intervals)
of the signal and its spectrum sampling points with
relation to the corresponding coordinate systems. These
deﬁnitions are obtained by eliminating irrelevant phase
factors exp(±i2πuv/N) from the formulas
au,v
nu,v
r)=1
N
N1
X
r(n)=0
αu,v
r(an)
exp(+)i2π(n +u)(r +v)
N(9)
that are obvious generalizations of the conventional DFTs
(5) that account for shifts (u, v) of samples in signal and
spectral domain.
A possibility of signal interpolation by SDFT follows
from the fact that one can perform direct and inverse SDFTs
with different shifts in the signal domain. With respective
shifts (u, v) and (p, q) for the direct and inverse DFTs, this
will result in a signal
˜au/p,v /q
n=1
N
M1
X
r=0nαu,v
rexpi2πrp
No
×expi2πn(r +q)
N
=
N1
X
k=0
akexpi2πkv+M1
2/N
×sincd(M;N;kn+up)
×expi2πnq+M1
2
×expi2πM1
N(u p)(10)
which, with an appropriate choice of the parameters,
coincides with the sincd-interpolated signal (3) for x/1x =
kp+u. For instance, when u=0 and q=v=
(M 1)/2,
a0/p,v/q
n=(N1
X
k=0
aksincd(M;N;kn+up))
×expiπM1
Np.(11)
This expression suggests an algorithm for discrete sinc-
interpolation as shown in ﬁgure 2. The algorithm involves
direct and inverse FFTs and modulations of the input signal,
its spectrum, and the output signal by corresponding phase
multipliers that provide the required signal shift. When
M=N1, interpolation is equivalent to the ﬁrst version
of the zero padding algorithm. When M=N+1,
interpolation is equivalent to the second version of the
zero padding algorithm. When M=N, the algorithm
implements interpolation by a function
sincd(N;N;x) =sin(πx )
Nsin(πx/N)(12)
that approximates continuous sinc-interpolation most
closely and that cannot be implemented by zero padding
methods for even N. In terms of the speed of convergence
227
L P Yaroslavsky
Figure 3. A modiﬁed algorithm for discrete sinc-interpolation.
to zero and boundary effects in signal interpolation, this
function behaves as the functions (4) with M=N±1as
shown in ﬁgures 1(a) and (b).
One can eliminate modulations of input and output
signals required by the algorithm of ﬁgure 2 if the signal
spectrum modulation coefﬁcients {µr=exp(i2πrp/N)}
are made pair-wise complex conjugate {µr=µ
Nr}to
guarantee that the interpolation function, being DFT of the
set of coefﬁcients {µr}, is a real valued function. The
algorithm is shown, modiﬁed in this way, in ﬁgure 3. One
can show that selections of a parameter A=0 and A=2
in the multiplier µN/2in this modiﬁed algorithm correspond
to signal interpolation with function (4) where M=N1
and M=N+1, respectively (that is, to the above ﬁrst
and the second methods of spectrum zero padding) while
the selection A=1 corresponds to signal interpolation by
function (6). One can regard the selection A=1 as a kind
of spectrum shaping with a window function
Wr=(1/2 for r=N/2
1 elsewhere. (13)
With this shaping, a sharp spectrum limitation (WN/2=0or
1) is substituted by a softer one. This explains why function
(6) converges to zero faster than function (5). Naturally,
one can include in this algorithm arbitrary spectrum shaping
windows without any increase of the computational cost.
3. Applications and computational complexity of
SDFT-based sinc-interpolation
We will describe three basic applications of the
above SDFT-based sinc-interpolation algorithms: signal
translation, signal interpolation in the vicinity of an
individual signal sample and signal zooming.
For signal translation by a fraction pof the sampling
interval, one needs to perform one pass of the above
algorithms with shift parameter p. This requires
O(N logN) operations. A typical application example of
signal translation is image rotation by a 3 pass algorithm
[7–9]. The algorithm decomposes image rotation into three
successive image shearings, in the x, y and then again in
the xdirections, that can be performed by corresponding
row- and column-wise translations. This is illustrated in
ﬁgure 4 for an image rotation by 30. The advantages
of the SDFT-based interpolation algorithm over the zero
padding algorithm in this application are: (i) arbitrary
shift versus a quantized shift by (1/L) with Lequal to
a power of two and (ii) reduced computational complexity
(O(N logN) operations versus O(N L logNL) operations
for the zero padding algorithm and conventional FFT, or
O(N L logN) operations for the zero padding algorithm and
‘pruned’ FFT).
Signal interpolation in the vicinity of an individual
signal sample is required, for instance, when one
needs to determine the position of a signal maximum
with subpixel accuracy. With the use of the above
algorithms this will require performing Ltimes, for
only single output signal sample, the inverse DFT with
shift parameters {pk,k=1,...,L
}, that correspond to
the required positions of Ladditional signal samples
(for uniform subpixel spacing pk=k/(L +1)). The
computational complexity of this process is only O(NL)
versus O(N L logNL) or O(N L logN) operations for zero
spectrum of NL samples is needed).
In signal and image L-fold expansion (magniﬁcation),
one needs to perform (L 1)consecutive signal shifts by
1/L. The computational complexity of this procedure is
O(N(L 1)logN), as for the zero padding algorithms
implemented by pruned FFTs, although the SDFT-based
algorithms remain advantageous when compared to zero
padding. They are much simpler in programming, and more
ﬂexible in terms of the expansion factor. In addition, they
are more storage-wise efﬁcient. This advantage may be of
importance in hardware implementation. Note also that,
with the described SDFT based interpolation algorithms,
signal expansion is also possible when the expansion factor
228
Signal sinc-interpolation: a fast computer algorithm
Initial image First pass
Second pass Third pass: rotated image
Figure 4. Image rotation by a three-pass algorithm of successive image shearings (fragments of black background seen in ﬁgures
represent circular shift effects).
is an arbitrary rational number rather than an integer
number. If, for instance, the expansion factor is m/n,
expansion has to be performed in two steps. First, m-fold
signal expansion is performed by the above algorithms and
then every nth sample has to be taken from the interpolated
signal. Examples of 2-, 5/2- and 3-fold expansion of an
image fragment are illustrated in ﬁgure 5.
Two-dimensional (multi-dimensional) signal discrete
interpolation is more involved than the one-dimensional
case, just as two-dimensional (multi-dimensional) sampling
is more involved than one-dimensional sampling . The
most common and simple implementation is sampling
in a rectangular grid. Such sampling corresponds to
separable 2-D (or, respectively, multi-dimensional) sinc-
interpolation when the interpolation function is a product of
single-dimensional sinc-functions (2) of the corresponding
coordinates. Its discrete implementation is, obviously, a
separable discrete sinc-interpolation consecutively applied
to each coordinate. In order to estimate the computational
complexity of 2-D signal expansion (zooming) let Lxand
Lybe expansion coefﬁcients in two dimensions of a 2-D
signal of Nx·Nysamples. Separable interpolation requires
in this case
ONyNxlogNx+Ny(Nx(Lx1)log Nx)
=O(NyNxLxlogNx)
229
L P Yaroslavsky
Initial image
Fragment zoom 2.5 Fragment zoom 3
Fragment zoom 2
Figure 5. Examples of 2-, 5/2- and 3-fold expansion of an image region.
operations for the interpolation in x-direction plus
ONxLxNylogNy+Ny(Ly1)log Ny
=O(NxNyLxLylogNy)
operations for the interpolation in the y-direction. The total
number of operations is therefore
Qsep
op =O(NxNy{LxlogNx+LxLylog Ny}). (14)
Note that this formula is not symmetric with regard to
the interpolation directions. One can see that if
NLx(Ly1)
y<N
L
y
(Lx1)
x(15)
interpolation ﬁrst in xdirection and then in ydirection
requires fewer operations than interpolation in the reverse
order. In particular, when Nx=Ny, interpolation ‘ﬁrst
along x, then along y’ is less time consuming if Ly<L
x
.
2-D inseparable discrete interpolation is also possible,
and in different versions, depending on the way of
treating the modulating multipliers µNx/2,0,µ0,Ny/2,
and µNx/2,Ny/2. The computational complexity of the
inseparable interpolation:
Qinsep
op =ONxNy(LxLy+1)logNxNy(16)
is, however, higher than that of separable algorithms Qsep
op
which makes inseparable interpolation less attractive than
the separable case.
230
Signal sinc-interpolation: a fast computer algorithm
4. Conclusion
Computational aspects of discrete signal sinc interpolation
have been discussed. Two modiﬁcations of SDFT-based
interpolation algorithms have been described and shown
to be superior to commonly used spectrum zero padding
algorithms, both in terms of computational expense and
ﬂexibility. The same approach can be applied also
for signal correlation by FFT and spectrum analysis
with subpixel resolution. In signal correlation with
subpixel resolution, one needs to perform an inverse
DFT with appropriate shifts as described above for signal
interpolation. In signal spectral analysis with subpixel
resolution, repeated direct SDFTs with appropriate shift
parameters in the spectral domain have to be performed to
obtain interpolated spectral samples. In general, the above
algorithms are well suited to any type of signal processing
in the spectral domain.
References
 Unser M, Aldroubi A and Eden M 1992 Polynomial spline
signal approximations: ﬁlter design and asymptotic
equivalence with Shannon’s sampling theorem IEEE
Trans. Informat. Theor. 38 95–103
 Smith T, Smith M S and Nichols S T 1990 Efﬁcient sinc
function interpolation technique for center padded data
IEEE Trans. Acoust. Speech Signal Process. 38 1512–7
 Markel J D 1971 FFT pruning IEEE Trans. Audio Electron.
AU-19 305–11
 Yaroslavsky L P 1985 Digital Picture Processing. An
Introduction (Berlin: Springer)
 Yaroslavsky L P 1979 Shifted discrete Fourier transforms
Problems Informat. Transmission 15 324–6
 Yaroslavsky L P 1980 Shifted discrete Fourier transforms
Digital Signal Processing ed V Cappellini and
A G Constantinides (London: Academic) pp 69–74
 Kiesewetter H and Graf A 1985 Rotation of digital grids
and corresponding models Technical Report Zentral
Institut f¨
ur Kybernetik und Informations Prozesse,