Vous êtes sur la page 1sur 4

Efficient algorithm

for discrete sinc interpolation

L. P. Yaroslavsky

A new computing method for discrete-signal sinc interpolation suitable for use in image and signal
processing and the synthesis of holograms is described. It is shown to be superior to the commonly used
zero-padding interpolation method in terms of interpolation accuracy, flexibility, and computational
complexity. 1997 Optical Society of America
Key words: Signal interpolation, discrete Fourier transform, fast Fourier transform, sinc function,
image geometric transformations.

Discrete-signal interpolation is a very common oper- finite number of N samples:


ation in digital signal and image processing. It is N21
sin@pM~xyDx 2 n!yN#
always required when one needs resolution in the
signal domain that is higher than that corresponding
a~x! 5 ( a N sin@p~ xyDx 2 n!yN#
n50
n

to the sampling rate. Typical examples of this need N21


are in signal positioning and spectrum analysis with
subpixel accuracy, image geometric transformations,
5 (a
n50
n sincd@M; N; p~xyDx 2 n!#, (2)

and hologram encoding for the synthesis of binary with a function sincd~M; N; . . .! that is a discrete
holograms. analog of the sinc function and approximates it to the
The most accurate method for representing signals accuracy of boundary effects. M is a parameter
with monotonically decreased spectra from their equal to N 2 1, N, or N 1 1, depending on the algo-
samples is sinc interpolation. In sinc interpolation, rithmic implementation of interpolation formula ~2!.
a continuous signal a~x! is restored from its samples The commonly used method of discrete sinc-
$an% that are taken with a discretization interval Dx interpolation is zero padding. It is implemented by
by their interpolation with a sinc function: padding the signal discrete Fourier transform ~DFT!
spectrum with an appropriate number of zeros and
`
sin@p~xyDx 2 n!# performing the inverse transformation of the padded
a~x! 5 (
n52`
an
@p~xyDx 2 n!#
spectrum. Three methods of zero padding are pos-
sible. In the first method the signal spectral coeffi-
` cient aNy2 ~N is number of signal samples! is
5 ( an sinc@p~xyDx 2 n!#. (1) discarded from the padded spectrum, and this results
n52`
in interpolation by Eq. ~2! with M 5 N 2 1. In the
second method this coefficient is repeated twice,
In digital signal processing the exact sinc interpola- which results in interpolation by Eq. ~2! with M 5
tion is replaced by the signal interpolation from its N 1 1. In the third method the coefficient aNy2 is
halved and then repeated twice, as in the second
method. This method is evidently a combination of
the first two methods and results in a signal interpo-
When this work was performed, the author was with the Insti-
lation with a function
tute dOptique, Centre National de la Recherche Scientifique, Ba-
sincd~ 6 1; N; x! 5 @sincd~N 2 1; N; x!
timent 503, Centre Scientifique dOrsay, B.P. 147, 91403 Orsay
Cedex, France. 1 sincd~N 1 1; N; x!#y2. (3)
Received 20 March 1996; revised manuscript received 27 August
1996. Method 3 converges to zero much faster than the
0003-6935y97y020460-04$10.00y0 sincd functions with M 5 N 6 1 ~see Fig. 1! and
1997 Optical Society of America therefore produces fewer boundary effects.

460 APPLIED OPTICS y Vol. 36, No. 2 y 10 January 1997


Fig. 1. Interpolation functions for different versions of the dis-
Fig. 2. ~a! General principle and ~b! an implementation of an
crete sinc interpolation.
algorithm for the discrete sinc interpolation. ISDFT, inverse
SDFT.

The computational complexity of this method is


O~NL log NL!, where L ~an expansion factor! is the signal3 given by

H S DJ
number of interpolated signal samples per initial one.
M21
With the use of the so-called pruned fast Fourier 1 rp
N (
transform ~FFT! algorithms,13 the computational anuyp,nyq 5 aru,n exp 2i2p
r50 N

F G
complexity can be reduced to O~NL log N!. How-
ever, the zero-padding method has a number of draw- n~r 1 q!
backs: ~1! It requires a buffer memory for NL signal 3 exp 2i2p
N

F S D G
samples while actually working with the sequences of
N samples. ~2! The use of the radix 2 FFT requires N21
M21
L to be a power of 2, which restricts the flexibility of 5 (a
k50
k exp i2pk n 1
2
yN
the algorithm. ~3! Signal expansions by arbitrary
factors cannot be performed. ~4! Implementation of 3 sincd~M; N; k 2 n 1 u 2 p!
pruned FFT algorithms requires cumbersome pro-
gramming.
I describe an alternative method of sinc interpola-
F S
3 exp 2i2pn q 1
M21
2
DG
tion that eliminates these restrictions. The method
is based on the so-called shifted DFTs ~SDFTs!.3
SDFTs take into account the possibility of an arbi-
3 exp i2p F M21
N
~u 2 p! , G (5)

trary shift of the signal-discretization sample points which, with an appropriate choice of the parameters,
in relation to the signal coordinate system and are provides a sincd-interpolated signal @Eq. ~2!# for
defined as xyDx 5 k 2 p 1 u. For instance, let us set the values

H S DJ F G
u 5 0 and q 5 n 5 2~M 2 1!y2; we then have
~n 1 u!r

H( J
N21
1 nn
N (
aru,n 5 an exp 6 i2p exp i2p , N21
n50 N N an0yp,nyq 5 ak sincd~M; N; k 2 n 2 p!

S D
k50
(4)
M21
where the positive exponent is for the direct SDFT, 3 exp 2ip p . (6)
N
the negative exponent is for the inverse SDFT, and u
and n are arbitrary shift parameters that describe This expression suggests an algorithm for the dis-
shifts ~in fractions of the corresponding discretization crete sinc interpolation shown in Fig. 2~b!. When
intervals! of the signal and its spectrums sampling M 5 N 2 1, interpolation is equivalent to the first
points, respectively, in relation to the corresponding version of the zero-padding algorithm, and when M 5
coordinate systems. N 1 1, interpolation is equivalent to the second ver-
The possibility of signal interpolation by the SDFT sion of the zero-padding algorithm. When M 5 N,
follows from the fact that one can perform direct and the algorithm implements interpolation by a function
inverse SDFTs with different signal and spectral given by
shifts @Fig. 2~a!#. In general, one can show that, with
shifts ~u, n! and ~ p, q! for the direct and inverse sin~px!
sincd~N; N; x! 5 , (7)
operations, respectively, the SDFT will result in a N sin~pxyN!

10 January 1997 y Vol. 36, No. 2 y APPLIED OPTICS 461


Fig. 3. Modified algorithm for the discrete sinc interpolation.

which approximates the continuous sinc interpola-


tion most closely. In terms of the convergence speed
to zero and boundary effects in signal interpolation,
this function behaves as the sincd functions with the
values M 5 N 6 1, as shown in Fig. 1 ~two upper
curves!.
The algorithm of Fig. 2 involves modulating and
demodulating the input signal and output signals,
respectively, in addition to signal spectrum modu- Fig. 4. Examples of 5y3-, 5y2-, and 5-fold expansions of an image
lation, which introduces the required signal shift. fragment.
We can omit these additional modulations if the
signal spectrum modulation coefficients $mr% are
made pairwise complex conjugate: $mr 5 mN2r*%. for the zero-padding algorithms implemented by
The algorithm modified in this way is shown in Fig. pruned FFTs, although the SDFT-based algorithms
3 ~Ref. 4! for the case of interpolation of real-valued remain much simpler in programming, more storage
signals. The selections of the parameter values efficient, and more flexible in terms of the expansion
A 5 0 and A 5 2 in the multiplier mNy2 in this factor.
modified algorithm correspond to signal interpola- For two-dimensional and multidimensional
tion with the sincd function where M 5 N 2 1 and discrete-signal interpolation, there are two options.
M 5 N 1 1, respectively. The selection of A 5 1 The most simple is a separable sinc interpolation
corresponds to signal interpolation by the function when the above-described one-dimensional discrete
sincd~61; N; x! @Eq. ~3!#. sinc interpolations are consecutively applied to each
One can regard the selection of A 5 1 as a sort of coordinate. With Lx and Ly as the expansion coeffi-
spectral shaping with a window function of WNy2 5 cients in two dimensions of a ~Nx 3 Ny!-sample sig-
1y2, Wr 5 1 ~r Ny2!. Naturally, one can include in nal, separable interpolation requires that there are
this algorithm arbitrary spectrum-shaping windows.
With the described SDFT-based interpolation algo- op 5 O@NxNy$~Lx 1 1!log Nx 1 Lx~Ly 1 1!log Ny%#
Qsep
rithms, signal expansion is possible when the expan-
(8)
sion factor is an arbitrary integer or a rational
number. For instance, for the expansion factor myn, operations, where the superscript sep denotes sepa-
an m-fold signal expansion is performed first, and rable and the subscript op denotes operations. Note
then every nth sample has to be taken out of the that this formula is not symmetric with relation to
interpolated signal. Examples of such an expansion the interpolation directions. One can see that, if
of an image fragment are shown in Fig. 4. NyLy~Lx21! , NxLx~Ly21!, interpolation first in the x di-
The computational complexity of the above SDFT- rection and then in the y direction requires fewer
based interpolation algorithms is O~N log N! per set operations than interpolation in the reverse order.
of N interpolated-signal samples. When we need to Two-dimensional inseparable ~insep! discrete inter-
obtain interpolated-signal samples in the vicinity of a polation is also possible and in different versions,
certain initial-signal sample ~as in the case of locating depending on the way the modulating multipliers
a signal maximum with a subpixel resolution! the mNxy2,0, m0, Nyy2, and mNxy2,Nyy2 are treated. The com-
computational complexity is only O~N! operations per putational complexity,
interpolated sample required for the inverse DFT for
one output sample. In a signal L-fold expansion Qinsep
op 5 O@Nx Ny~Lx Ly 1 1!log Nx Ny#, (9)
~magnification!, we need to perform L consecutive
signal shifts by intervals of 1yL. The computational of the inseparable interpolation is, however, higher
complexity of this procedure is O~NL log N!, as it is than that of separable algorithms.

462 APPLIED OPTICS y Vol. 36, No. 2 y 10 January 1997


In conclusion, note that the same approach can be References
applied to obtaining signal spectrum analysis with a 1. T. Smith, M. S. Smith, and S. T. Nichols, Efficient sinc function
subpixel resolution. In this case, repeated, direct interpolation technique for center padded data, IEEE Trans.
SDFTs with appropriate shift parameters in the Acoust. Speech Signal Process. 38, 15121517 ~1990!.
spectral domain have to be performed to obtain in- 2. J. D. Markel, FFT prunning, IEEE Trans. Audio Electron.
terpolated spectral samples. AU-19, 305311 ~1971!.
3. L. P. Yaroslavsky, Digital Picture Processing. An Introduction
L. P. Yaroslavskys permanent affiliations are with ~Springer-Verlag, Berlin, 1985!.
the Interdisciplinary Department, Faculty of Engi- 4. V. Kober, M. Unser, and L. P. Yaroslavsky, Spline and sinc
neering, Tel-Aviv University, Tel-Aviv 69978, Israel, signal interpolations in image geometrical transforms, in Fifth
and the Institute of Information Transmission Prob- International Workshop on Digital Image Processing and Com-
lems, Russian Academy of Sciences, Moscow, Bolshoy puter Graphics, N. A. Kuznetsov and V. A. Soifer, eds., Proc.
Karetney 19, Russia. SPIE 2363, 152161 ~1994!.

10 January 1997 y Vol. 36, No. 2 y APPLIED OPTICS 463

Vous aimerez peut-être aussi