0% found this document useful (0 votes)
96 views69 pages

Fast Discrete Sinc-Interpolation: A Gold Standard For Image Resampling

L. Yaroslavsky: discrete sinc-interpolation is a gold standard for image resampling. He says it preserves signal content in its baseband defined by the sampling rate. Yaroslavsky says it can be used for fractional shifts, image rotation, resizing.

Uploaded by

Tri Nguyen
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views69 pages

Fast Discrete Sinc-Interpolation: A Gold Standard For Image Resampling

L. Yaroslavsky: discrete sinc-interpolation is a gold standard for image resampling. He says it preserves signal content in its baseband defined by the sampling rate. Yaroslavsky says it can be used for fractional shifts, image rotation, resizing.

Uploaded by

Tri Nguyen
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

8

Fast discrete sinc-interpolation:


a gold standard for image resampling
L. Yaroslavsky
Numerous image processing tasks and applications require digital image re-
sampling and geometrical transformations. These operations always assume build-
ing, from available image samples, a continuous image model, which is then re-
sampled into the required new sample positions. For generating the continuous
image model, available image samples are interpolated using, usually, convolution
interpolation kernels. In the design of this process, a compromise is sought be-
tween the interpolation accuracy and computational complexity. In this chapter,
we describe a family of discrete sinc-interpolation algorithms that can be regarded
as a gold standard for interpolation of sampled signals dened by a nal number
of their samples. We prove that discrete sinc-interpolation is the only convolution-
based interpolation method that preserves signal content in its baseband dened
by the sampling rate, provide experimental evidence of its prevalence, outline its
various algorithmic implementations based on fast transform, illustrate its ap-
plications for signal/image fractional shifts, image rotation, image resizing, sig-
nal integration and dierentiation, and show that the availability of fast Fourier
and fast DCT-based discrete sinc-interpolation algorithms makes discrete sinc-
interpolation a very competitive alternative to other interpolation techniques in
applications that are sensitive to interpolation accuracy and require image resam-
pling in a regular equidistant sampling grid. For image resampling in irregular
sampling grid, we suggest sliding window discrete sinc-interpolation methods that
provide the best, for the given window size, interpolation accuracy and are, in ad-
dition, capable of simultaneous image resampling and ltering for restoration or
enhancement and of local adaptation of the interpolation kernel.
8.1. Introduction
Accurate and fast signal and image resampling is a key operation in many digi-
tal image processing applications such as image reconstruction from projections,
multimodality data fusion, image superresolution from image sequences, stabi-
lization of video images distorted by atmosphere turbulence, target location and
tracking with subpixel accuracy, and so forth, to name a few.
338 Discrete sinc-interpolation
Resampling assumes interpolation of available signal/image samples to ob-
tain samples in between the given ones. In some applications, for instance, in
computer graphics and print art, simple interpolation methods, such as nearest
neighbor or linear (bilinear), can provide satisfactory results. In applications that
are more demanding in terms of the interpolation accuracy, higher-order spline
interpolation methods gained popularity. The interpolation accuracy of spline in-
terpolation methods is proportional to the spline order. In the same way, their
computational complexity grows.
Meanwhile, there exists a unique discrete signal interpolation method that
is capable, given nite set of signal samples, to secure virtually error-free sig-
nal interpolation. This method is the discrete sinc-interpolation. Discrete sinc-
interpolation has been known for quite a lot of time but still remains to be a sort
of an ugly duckling in the family of discrete signal interpolation methods. Vir-
tually in all text and reference books on digital signal and digital image processing,
one can nd only brief mentioning discrete sinc-interpolation solely in an associ-
ation with DFT spectrum zero-padding, which is rather inecient and inexible
if compared, computationwise, with other interpolation methods. It is also most
frequently confused with the continuous sinc-interpolation that, theoretically, se-
cures error-free reconstruction of band-limited signals and least mean square error
reconstruction of arbitrary continuous signals, provided innitely large number of
signal samples is available and that cannot be implemented in reality when only a
nite number of signal samples is available.
The chapter intends to advocate broad use of the discrete sinc-interpolation in
signal and especially in image processing. To this goal, we, in Section 8.2, provide a
theoretical proof that discrete sinc-interpolation is the only convolution-based in-
terpolation method that preserves signal content in its frequency baseband dened
by the signal sampling rate. In Section 8.3, we support this proof by experimen-
tal comparison of discrete sinc-interpolation with other interpolation methods in
terms of the interpolation accuracy. In Section 8.4, we describe various fast Fourier
and fast DCT transform-based algorithms for signal and image subsampling, ar-
bitrary fractional shift, zooming, rotation and scaling, and numerical integration
and dierentiation with discrete sinc-interpolation that uses all available signal
samples. As these algorithms are computationally ecient only if resampling in
a regular equidistant sampling grid is required, we, in Section 8.5, suggest sliding
window DCT domain discrete sinc-interpolation algorithms that are suitable for
signal resampling in arbitrary irregular sampling grid, provide the best, for the
given window size, interpolation accuracy, are capable, additionally to interpola-
tion, of simultaneous signal/image restoration and enhancement, and allow easy
local adaptation of the interpolation kernel. Necessary mathematical details and
auxiliary materials are entered in the appendices.
8.2. Optimality of the discrete sinc-interpolation:
a mathematical formulation
For the purposes of the resampling lter design, one can regard signal coordinate
shift as a general resampling operation. This is justied by the fact that samples of
L. Yaroslavsky 339
the resampled signal for any arbitrary signal resampling grid can be obtained one
by one through the corresponding signal shift to the given sample position. In this
section, we introduce, for signals dened by the nite number of their samples,
an optimal signal shifting resampling lter that preserves signal content in its fre-
quency baseband dened by the signal sampling rate and show that the lter point
spread function (impulse response) is the discrete sinc-function.
8.2.1. Preliminaries and denotations
Let {a
k
} be a set of samples of an analog signal a(x), N = 0, 1, . . . , N 1:
a
k
=
_

a(x)
(s)
_
x
`
k
(s)
x
_
dx, (8.1)
where {
(s)
()} is a set of sampling basis functions,
`
k
(s)
= k + u
(s)
, and u
(s)
is a
shift, in units of the sampling interval x of the signal sampling grid with respect
to signal coordinate system.
We assume that, for signal shifting resampling, resampled signal samples {` a
` x
k
}
are obtained by means of digital convolution
` a
` x
k
=
N1
_
n=0
h
(intp)
n
(` x)a
kn
(8.2)
of the initial signal samples {a
k
} with a certain interpolation kernel h
(intp)
n
(` x) (re-
sampling lter point spread function), where ` x is a required signal shift with re-
spect to the sampling grid of samples {a
k
}.
We assume also that samples {` a
` x
k
} correspond to a continuous ` x-shifted sig-
nal:
` a(x) =
N1
_
k=0
` a
` x
k

(r)
_
x
`
k
(r)
x
_
, (8.3)
where {
(r)
()} is a set of reconstruction basis functions, as, for instance, those
that describe image display devices,
`
k
(r)
= k + u
(r)
, and u
(r)
is a shift, in units of
the sampling interval x of the reconstructed signal sampling grid with respect to
reconstructed device coordinate system.
8.2.2. Continuous impulse and frequency responses of
digital resampling lters
Signal resampling is a linear signal transformation. As any linear transformation,
it is completely characterized by its impulse response, or point spread function
(PSF). In order to nd PSF of the resampling transformation, let us establish alink
340 Discrete sinc-interpolation
between reconstructed resampled ` x-shifted signal ` a(x) of (8.3) and initial signal
a(x). To this goal, combine (8.1)(8.3) and obtain
` a(x)=
N1
_
k=0
N1
_
n=0
h
(intp)
n
(` x)
(r)
_
x
_
k+u
(r)
_
x
_
_

a()
(s)
_

_
kn+u
(s)
_
x
_
d
=
_

a()
_
N1
_
k=0
N1
_
n=0
h
(intp)
n
(` x)
(r)
_
x
_
k+u
(r)
_
x
_

(s)
_

_
kn+u
(s)
_
x
_
_
d
=
_

a()
`
h
(intp)
` x
(x, )d.
(8.4)
Function
`
h
(intp)
` x
(x, ) =
N1
_
k=0
N1
_
n=0
h
(intp)
n
(` x)
(r)
_
x
_
k + u
(r)
_
x
_

(s)
_

_
k n + u
(s)
_
x
_
(8.5)
in (8.4) can be treated as the overall point spread function (OPSF) of the numerical
signal ` x-shifting resampling process described by (8.2).
Dene overall frequency response of the shifting resampling process as 2D
Fourier transform of its OPSF:
H
(intp)
` x
( f , p) =
__

h
(intp)
` x
(x, ) exp
_
i2( f x p)
_
dx d. (8.6)
Replace, in (8.6), h
(intp)
(x, ) with its expression given by (8.5), and obtain
H
(intp)
` x
( f , p)
=
__

N1
_
k=0
N1
_
n=0
h
(intp)
n
(` x)
(r)
_
x
_
k + u
(r)
_
x
_

(s)
_

_
k n + u
(s)
_
x
_
exp
_
i2( f x p)
_
dx d
=
N1
_
k=0
N1
_
n=0
h
(intp)
n
(` x)
_

(r)
_
x
_
k + u
(r)
_
x
_
exp(i2 f x)dx

(s)
_

_
k n + u
(s)
_
x
_
exp(i2p
_
d
L. Yaroslavsky 341
=
N1
_
k=0
N1
_
n=0
h
(intp)
n
(` x) exp
_
i2 f
_
k + u
(r)
_
x
_
exp
_
i2p
_
k + u
(r)
u
(r)
n + u
(s)
_
x
_

(r)
(x) exp(i2 f x)dx
_

(s)
() exp(i2p)d
=
N1
_
n=0
h
(intp)
n
(` x) exp
_
i2p
_
n + u
(r)
u
(s)
_
x d
_
N1
_
k=0
exp
_
i2( f p)
_
k + u
(r)
_
x
_

(r)
(x) exp(i2 f x)dx
_

(s)
() exp(i2p)d.
(8.7)
The rst term in this product
H
(intp)
` x
(p) =
N1
_
n=0
h
(intp)
n
(` x) exp
_
i2p
_
n + u
(r)
u
(s)
_
x
_
(8.8)
is determined solely by the resampling lter coecients {h
(intp)
n
(` x)} and signal
sampling interval x. We call this term continuous frequency response (CFrR) of
the resampling lter.
The second term can be represented as
SV
N
( f p) =
N1
_
k=0
exp
_
i2( f p)
_
k + u
(r)
_
x
_
=
exp
_
i2( f p
_
Nx
_
1
exp
_
i2( f p)x
_
1
exp
_
i2( f p)u
(r)
x
_
=
sin
_
( f p)Nx
_
sin
_
( f p)x
_
exp
_
i(N 1)( f p)
_
N 1 + 2u
(r)
_
x
_
=N sincd
_
N; ( f p)Nx
_
exp
_
i(N1)( f p)
_
N1+2u
(r)
_
x
_
,
(8.9)
where
sincd(N; x) =
sin(x)
sin(x/N)
(8.10)
is the discrete sinc-function.
342 Discrete sinc-interpolation
It is only natural to maintain the following relationship between the number
of signal samples N and sampling grid shift u
(r)
in the display coordinate system:
u
(r)
=
N 1
2
. (8.11)
In this case, the phase term in (8.9) becomes zero, and
SV
N
( f p) = N sincd
_
N; ( f p)Nx
_
. (8.12)
This term describes how the overall frequency response of the resampling process
is aected by the niteness of the number of signal samples. Specically, it shows
that, for any nite number of signal samples N, numerical signal resampling is not
shift invariant process and it is subjected to boundary eects. The contribution of
the boundary eects decays when the number of signal samples N grows. In the
limit, when N ,
lim
N
SV
N
( f p) = lim
N
N sincd
_
N; ( f p)Nx
_
=
_
( f p)Nx
_
,
(8.13)
and the numerical signal resampling process tends to become shift invariant.
Two last terms in (8.7),

(s)
(p) =
_

(s)
() exp(i2p)d,

(r)
( f ) =
_

(r)
(x) exp(i2 f x)dx,
(8.14)
are frequency responses of signal sampling and reconstruction devices.
Given the number of signal samples and signal sampling and reconstruction
devices, the quality of the numerical resampling process can be evaluated in terms
of the continuous frequency response (CFrR) H
(intp)
` x
(p) of the resampling lter
dened by (8.3).
In order to facilitate analysis of the CFrR, it is useful to link it with samples
{
(intp)
r
} of a shifted discrete Fourier transform (SDFT) of the resampling lter
coecients {h
(intp)
n
(x)}. For SDFT (u, 0), these sets of the coecients are related
through the equation
h
(intp)
n
(` x) =
1

N
N1
_
r=0

(intp)
r
(` x) exp
_
i2
(n + u)r
N
_
, (8.15)
where u is a signal domain transform shift parameter (see Chapter 3). We will refer
to the set of coecients
(intp)
r
(` x) as to discrete frequency response of the resampling
lter.
L. Yaroslavsky 343
Replacing {h
(intp)
n
(x)} in (8.3) with its expression in (8.15), obtain
H
(intp)
(p) =
N1
_
n=0
1

N
N1
_
r=0

(intp)
r
(` x) exp
_
i2
(n + u)r
N
_
exp
_
i2p
_
n + u
(r)
u
(s)
_
x
_
=
N1
_
r=0

(intp)
r
(` x)
_
1

N
N1
_
n=0
exp
_
i2
(n + u)r
N
_
exp
_
i2p
_
n + u
(r)
u
(s)
_
x
_
_
=
N1
_
r=0

(intp)
r
(` x)
_
1

N
N1
_
n=0
exp
_
i2
_
px
r
N
_
n
_
_
exp
_
i2
ur
N
_
exp
_
i2p
_
u
(r)
u
(s)
_
x
_
=
N1
_
r=0

(intp)
r
(` x)
1

N
exp
_
i2(px r/N)N
_
1
exp
_
i2(px r/N)N
_
1
exp
_
i2
ur
N
_
exp
_
i2p
_
u
(r)
u
(s)
_
x
_
=
N1
_
r=0

(intp)
r
(` x)

N
N
sin
_
(px r/N)N
_
sin
_
i2(px r/N
__
exp
_
i2
r
N
_
u +
(N 1)
2
__
exp
_
i2p
_
u
(r)
u
(s)
+
(N 1)
2
_
x
_
.
(8.16)
Provided reconstruction shift parameter is determined by (8.11), the natural se-
lections of signal sampling shift parameter u
(s)
and SDFT shift parameter u are
u
(s)
= 0, u =
N 1
2
. (8.17)
Then, obtain nally
H
(intp)
(p)
N1
_
r=0

(intp)
r
(` x) sinc
_
N;
_
px
r
N
_
N
_
. (8.18)
With this, we arrive to the following theorems.
344 Discrete sinc-interpolation
Theorem 8.1. SDFT((N 1)/2, 0) coecients of resampling lter point spread
function {h
(intp)
n
()}, or its discrete frequency response
(intp)
r
(), are samples of the
lter continuous frequency response H
(intp)
(p).
Theorem 8.2. Continuous frequency response H
(intp)
(p) of the resampling lter is a
function, discrete-sinc interpolated from its samples
(intp)
r
(), taken with sampling
interval 1/Nx, where N is the number of signal samples involved in the resampling
and x is signal sampling interval.
Note that, generally, these theorems are applicable to any digital lter and its
discrete and continuous frequency responses.
8.2.3. Optimal resampling lter
We dene the optimal shifting resampling lter as the lter that generates a shifted
copy of the input signal and preserves samples of the analog signal spectrum in its
baseband dened by its sampling rate and the number of available signal samples.
According to this denition, continuous frequency response of the optimal shifting
resampling lter for the coordinate shift ` x is, by virtue of the Fourier transform
shift theorem,
H
(intp)
(p) = exp(i2p` x). (8.19)
Then, according to Theorem 8.1, for odd number of signal samples N, samples
{
(intp)
r,opt
(` x)} of CFrR of the optimal resampling lter that dene its point spread
function {h
(intp)
n
(` x)} should be selected as

(intp)
r,opt
(` x) =
1

N
exp
_
i2
r` x
Nx
_
, r = 0, 1, . . . ,
N 1
2
,

(intp)
r,opt
(` x) =
(intp)
Nr,opt
(` x), r =
N + 1
2
, . . . , N 1.
(8.20)
For even number of signal samples N, coecient
(intp)
N/2,opt
(` x), which corre-
sponds to the signal higher frequency in its baseband, requires a special treatment.
As it is shown in Appendix A, this coecient must be an imaginary number in
order to keep lter point spread function {h
(intp)
n
(` x)} to be real valued. This lim-
itation inevitably prevents the N/2th signal spectral coecient from being exact
sample of the ideal frequency response and assumes its arbitrary choice. The most
L. Yaroslavsky 345
natural one is the assignment

(intp)
r,opt
(` x) =
_

_
exp
_
i2
r` x
Nx
_
, r = 0, 1, . . . ,
N
2
1,
Ai sin
_

` x
x
_
, r =
N
2
,

(intp)
r,opt
(` x) =
_

(intp)
Nr,opt
(` x)
_

, r =
N
2
+ 1, . . . , N 1,
(8.21)
where A is a weight coecient that denes signal spectrum shaping at its highest
frequency component. In what follows, we will consider, for even N, the following
three options for A:
Case 0 : A = 0,
Case 1 : A = 1,
Case 2 : A = 2.
(8.22)
It is shown in Appendix B that, for odd N, point spread function of the opti-
mal resampling lter dened by (8.15) is
h
(intp)
n
(` x) = sincd
_
N,
_
n
N 1
2

` x
x
__
. (8.23a)
For even N, Case 0 and Case 2, optimal resampling point spread functions are
h
(intp0)
n
(` x) = sincd
_
N; N 1;
_
n
N 1
2

` x
x
__
, (8.23b)
h
(intp2)
n
(` x) = sincd
_
N; N + 1;
_
n
N 1
2

` x
x
__
, (8.23c)
correspondingly, where a modied sincd-function sincd is dened as
sincd(N; M; x) =
sin(Mx/N)
N sin(x/N)
. (8.24)
One can easily see that Case 1 is just a combination of Case 0 and Case 2:
h
(intp2)
n
(` x) =
h
(intp0)
n
(` x) + h
(intp2)
n
(` x)
2
= sincd(1; N; x) =
sincd(N 1; N; x) + sincd(N + 1; N; x)
2
.
(8.23d)
These four functions h
(intp)
n
(` x) are illustrated in Figure 8.1 for N = 512. As one
can see, Case 1-discrete sinc-function decays to zero much faster than three other
346 Discrete sinc-interpolation
0.2
0
0.2
0.4
0.6
0.8
100 200 300 400 500
(a) sincd(N; x) = sincd(N; N; x)
0.2
0
0.2
0.4
0.6
0.8
100 200 300 400 500
(b) sincd(N 1; N; x)
0.2
0
0.2
0.4
0.6
0.8
100 200 300 400 500
(c) sincd(N + 1; N; x)
0.2
0
0.2
0.4
0.6
0.8
100 200 300 400 500
(d) sincd(1; N; x)
0
0.2
0.4
0.6
0.8
1
100 200 300 400
(e) Nearest neighbor
0
0.2
0.4
0.6
0.8
1
100 200 300 400
(f) Linear
0
0.2
0.4
0.6
0.8
1
100 200 300 400
(g) Cubic
0.2
0
0.2
0.4
0.6
0.8
100 200 300 400 500
(h) Mems(5, 3, 1)
Figure 8.1. Four versions of discrete sinc-function of (8.23a)(8.23d) ((a)(d)) and point spread
functions of four spline interpolation methods ((e)(h)).
L. Yaroslavsky 347
versions and therefore is less liable to boundary eects. We call signal resampling,
by means of lters dened by (8.23), discrete sinc-interpolation.
Such result can be formulated as the follows.
Theorem 8.3. For analog signals dened by their N samples, discrete sinc-interpola-
tion is, for odd N, the only discrete convolution-based signal resampling method that
does not distort signal spectrum samples in its baseband specied by the signal sam-
pling rate x. For even N, discrete sinc-interpolation distorts only the highest N/2th
frequency spectral component.
In conclusion of this section, note that the reasoning concerning the design of
the optimal resampling lter discussed in this section can also be used for the de-
sign of numerical implementation of any shift invariant signal linear transforma-
tions. In Section 8.4.5, we will use it for the design and comparison of algorithms
for signal numerical dierentiation and integration.
8.2.4. Optimal resampling lter: discussion and interpretation;
discrete sinc- and continuous sinc-functions
Discrete sinc functions sincd and sincd dened by (8.10) and (8.24) are discrete
point spread functions of the ideal digital lowpass lter, whose discrete frequency
response is a rectangular function. Depending on whether the number of signal
samples N is odd or even number, they are periodic or antiperiodic with period
N, as it is illustrated in Figures 8.2(a) and 8.2(b). According to Theorem 8.2, con-
tinuous frequency response of discrete sinc-interpolators is a function, discrete
sinc-interpolated from its discrete frequency response. Both continuous and dis-
crete frequency responses of discrete sinc-interpolators are illustrated in Figure
8.2(c).
As one can see from the gure, discrete sinc-inerpolation does preserve signal
spectrum in spectrum sampling points, while in between sampling points spec-
trum oscillations are possible due to the continuous frequency response interpo-
lation. However, these oscillations are caused solely by the nite number of signal
samples and depend solely on signal boundary conditions. Specically in image
processing, this means that they can be signicantly weakened by an appropri-
ate windowing of the interpolated discrete signal at its boundaries without any
change of the interpolation PSF. It is in this sense one can say that the preserva-
tion of signal spectral samples in the process of signal resampling is the necessary
and sucient condition of signal spectrum preservation as far as it concerns the
selection of the resampling interpolation function. In Section 8.3, we will provide
an experimental evidence in favor of this statement.
Discrete sinc-functions are plotted in Figure 8.2 along with the continuous
sinc-function sinc x = sinx/x. It is a Fourier transform of the rectangular func-
tion, which is the frequency response of the ideal lowpass lter for continuous sig-
nals. Discrete sinc-functions are discrete analogs of the continuous sinc-function,
however, these functions must not be confused.
348 Discrete sinc-interpolation
0.2
0
0.2
0.4
0.6
0.8
1
3 2 1 0 1 2 3
(a)
1
0.5
0
0.5
1
3 2 1 0 1 2 3
(b)
0.2
0
0.2
0.4
0.6
0.8
1
1.2
2 1.5 1 0.5 0 0.5 1 1.5 2
Normalized frequency
(c)
Figure 8.2. (a)-(b) Continuous (bold circles) versus discrete (thin line) sinc-functions for odd and
even N, respectively; (c) continuous frequency response of the sincd-interpolator (solid line) and sam-
ples of the ideal lowpass lter frequency response (bold circles).
Sinc-function is an aperiodic function with innite support. It is a convolu-
tion kernel that preserves spectra of continuous signals in their baseband dened
by the sampling rate. For band-limited signals, it provides signal perfect recon-
struction from their samples provided innite number of the samples is available.
For signals that are not band-limited, it provides least mean square error signal
reconstruction under the same condition.
L. Yaroslavsky 349
Discrete sinc-interpolation, in its turn, provides perfect, for the given num-
ber of signal samples, discrete signal resampling with preservation of correspond-
ing continuous signal spectra in their sampling points. Continuous frequency re-
sponse of discrete-sinc interpolators coincides with that of continuous sinc-
interpolator in spectral sampling points dened by the number of the discrete
signal samples, but deviates from it between sampling points, deviations being
dependent on discrete signal boundary conditions.
Continuous sinc-function is a mathematical model that cannot be imple-
mented in reality due to its innite support. As a practical substitute for sinc-
function, a windowed sinc-function is considered frequently for interpolation pur-
poses. As a convolutional interpolation kernel, it has no indisputable advantages
over other interpolation kernels for the same number of samples. Discrete sinc-
functions must not be confused with a windowed sinc-function either.
8.3. Discrete sinc-interpolation versus other interpolation methods:
performance comparison
In this section, we provide experimental evidence that the discrete sinc-interpola-
tion outperforms other known interpolation methods in terms of the interpola-
tion accuracy and signal preservation and is capable of virtually error-free sig-
nal interpolation. Compared with discrete sinc-interpolation are nearest neigh-
bor interpolation, linear (bilinear) interpolation, cubic (bicubic) spline interpola-
tion, and higher-order spline interpolation methods: Mems(5, 3, 1) (see [1]), and
Beta11 spline (see [2]). Point spread functions of the rst 4 interpolation methods
are shown in Figures 8.1(e)8.1(h), correspondingly, where they can be compared
with point spread functions of the above described modications of the discrete
sinc interpolation ((a)(d)).
Mentioned interpolation methods were compared in two applications: image
rotation and image zooming. In image rotation, several rotations of test images
were performed using mentioned interpolation methods so as the total rotation
angle be multiple of 360

. Then, the rotation error was evaluated as a dierence


between initial and rotated images, and its DFT power spectrum was evaluated
and displayed. For image zooming, test images were subjected to 4 times zooming
and then DFT spectra of zoomed images were computed and displayed in order to
evaluate spectra aliasing artifacts introduced by the methods.
For discrete sinc-interpolation, the version with point spread function shown
in Figure 8.1(d) was used. In experiments with nearest neighbor, bilinear, and
bicubic interpolation, Matlab programs imrotate.m and interp2.m from image
processing tool box were used. In experiments with Mems(5, 3, 1)-interpolation, a
software package kindly provided by Dr. Gotchev (see [3]) was used. Discrete sinc-
interpolation used in the experiments was implemented in Matlab using standard
Matlab tools.
As test images, two images were used: an image of a printed text (Text image,
Figure 8.3(a)) and a computer generated pseudorandom image with uniform DFT
spectrum (PRUS image, Figure 8.3(b)). The Text image was used to evaluate
350 Discrete sinc-interpolation
(a) (b)
Figure 8.3. Test images used in the experiments: (a) Text image; (b) PRUS image.
readability of the text for dierent rotation method. The PRUS image was used
for demonstrating distortions of signal spectra caused by the resampling.
Results of comparison, for rotation of test image Text, of three standard
methods of image resampling, nearest neighbor, bilinear and bicubic ones, and
that of discrete-sinc interpolation in application to image rotation, are shown in
Figures 8.4(a)8.4(d).
As it was mentioned, for the standard methods, Matlab program imrotate.m
from image processing tool box was used. For discrete sinc-interpolated rotation,
a Matlab code was written using standard Matlab tools that implements the 3-
step rotation algorithm (see [4]) through DFT-based fractional shift algorithm
described in the next section. Images shown in the gure clearly show that, after 60
rotations though 18

each, standard interpolation methods completely destroy the


readability of the text, while discrete sinc-interpolated rotated image is virtually
not distinguishable from the original one.
Nearest neighbor, bilinear, and bicubic interpolations are spline interpola-
tions of the rst, second, and third order. The higher the spline order, the higher
interpolation accuracy, and the higher their computational complexity. However,
higher-order spline interpolators still underperformthe discrete sinc-interpolation
as one can see from Figures 8.5(a) and 8.5(b) where results of 1000 rotations,
through 18

each rotation, of the Text image using Mems(5, 3, 1)-based rota-


tion program and the above mentioned Matlab code that implements 3-step ro-
tations with discrete sinc-interpolation. While rotated test image obtained with
Mems(5, 3, 1)-interplolation, is substantially blurred, image, rotated with discrete
sinc-interpolation remains unchanged. Figures 8.5(c) and 8.5(d) are reference im-
ages that represent the test image low pass ltered to 0.5 (image (c)) and to 0.4
(image (d)) of the baseband. Comparing them with Mems(5, 3, 1)-rotated image,
one can say that, after 1000 rotations, Mems(5, 3, 1)-rotated image is equivalent,
from the point of view of the text readability, to a lowpass ltered image with the
L. Yaroslavsky 351
(a) 1080 degrees rotated image in 60
steps (NearNeighb, T = 7.268)
(b) 1080 degrees rotated image in 60
steps (Bilinear, T = 11.1)
(c) 1080 degrees rotated image in 60
steps (Bicubic, T = 17.67)
(d) 1080 degrees rotated image in 60
steps (Discrete sinc, T = 14.158)
Figure 8.4. Discrete sinc-interpolation versus conventional interpolation methods: results of multiple
rotation of the test image Text. Numbers in brackets indicate processing time.
residual bandwidth of 0.4-0.5 of the initial one. Note that in these experiments,
both compared methods had comparable run time on the same computer.
In the analysis of the interpolation errors, it is very instructive to compare
their power spectra. Figures 8.6(a)8.6(d) present power spectra of rotation er-
rors obtained for the test image PRUS rotated 10 times through 36

each time,
using bicubic interpolation (Matlab program imrotate.m), Mems(5, 3, 1), Beta11,
and discrete sinc-interpolation, correspondingly. Rotation results obtained with
Beta11 spline interpolation were kindly provided by Dr. Th evenaz (see [2]). Ro-
tation error spectra for Mems(5, 3, 1) and discrete sinc-interpolation and larger
number (100) of rotations through multiple of 360

are shown for comparison


in Figures 8.7(a) and 8.7(b), correspondingly. All spectra in Figures 8.6 and 8.7
are centered around zero frequency (dc) component; left-right and top-bottom
352 Discrete sinc-interpolation
(a) (b)
(c) (d)
Figure 8.5. Discrete sinc-interpolation versus Mems(5, 3, 1) interpolation method: results of im-
age rotations through 18 000

in 1000 steps using Mems(5, 3, 1) interpolation (a) and discrete sinc-


interpolation (b) and reference test images lowpass ltered to 0.5 (c) and to 0.4 (d) of the baseband.
borders of the images correspond to the highest horizontal and, correspondingly,
vertical spectral components.
These spectra clearly show that, of those four methods, only discrete sinc-
interpolation preserves image content in its baseband. For discrete sinc-
interpolation, only spectral components outside the circle with radius equal to the
highest horizontal/vertical frequency (frequency index N/2) are distorted. These
distortions are, in accordance with Theorem 8.3, associated with the implementa-
tion of the discrete sinc-interpolation for even number of signal samples. Plots of
horizontal and vertical spectra sections (Figures 8.6(e), 8.6(f)) illustrate spectra of
rotation error in more quantitative terms.
In Figures 8.6 and 8.7, one can also see that all interpolation methods pro-
duce, in image rotation, errors outside a circle inscribed into square that corre-
sponds to the image baseband area. These errors are rotation aliasing errors. They
L. Yaroslavsky 353
(a) (b)
(c) (d)
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0 0.2 0.4 0.6 0.8 1
Normalized frequency
1D section of the rotation error
spectrum (horizontal)
Bicubic
Beta11
Spline531
DFT-sinc
(e)
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0 0.2 0.4 0.6 0.8 1
Normalized frequency
1D section of the rotation error
spectrum (diagonal)
Bicubic
Beta11
Spline531
DFT-sinc
(f)
Figure 8.6. (a)(c): rotation error spectra for bicubic (a), Mems(5, 3, 1) (b), Beta11 (c), and discrete
sinc-interpolation (d) interpolation methods; (e)(f): vertical and horizontal cross-sections of the 2D
spectra (dots: spectra samples; solid lines: continuous spectra). All spectra are shown centered at spec-
trum zero frequency (dc) component, image lightness being proportional to spectra intensity.
originate from image diagonal spectral components that should, due to the rota-
tion, go outside the baseband square and are put inside it because of the cyclicity
of the DFT. Figure 8.8 shows rotation error spectra for 10 36

rotations, using
354 Discrete sinc-interpolation
(a) (b)
Figure 8.7. Rotation error spectra for 100 36

rotations of PRUS-image using Mems(5, 3, 1)-


interpolation (a) and discrete sinc-interpolation (b). All spectra are shown centered at spectrum zero
frequency (dc) component image lightness being proportional to spectra intensity.
(a) (b)
(c)
Figure 8.8. Rotation error spectra for 10 36

rotations of PRUS image low pass ltered to 0.7 of


its baseband for bicubic (a), Mems(5, 3, 1) (b) and discrete sinc-interpolation (c) methods. All spectra
are shown centered at spectrum zero frequency (dc) component, image lightness being proportional
to spectra intensity.
bicubic, spline351, and sinc-interpolation, of PRUS image that was lowpass pre-
ltered to 0.7 of the baseband in horizontal and vertical dimensions. As a result
of such a lowpass ltering, aliasing error components are excluded, and one can
see from the gure that discrete sinc-interpolation, as opposite to other methods,
L. Yaroslavsky 355
does not produce, in this case, rotation errors at all (few components still visi-
ble in Figure 8.8(c) are intentionally left as reference points that keep, for display
purposes, dynamic range of the error for all compared methods).
Experimental results presented in Figures 8.48.8 illustrate interpolation er-
rors within the image baseband. Aliasing interpolation errors outside the image
baseband for dierent interpolation methods, in spectra of 4x-zooming PRUS
image are illustrated in Figure 8.9 for bilinear, bicubic, Mems(5, 3, 1)- and discrete
sinc-interpolation methods. One can clearly see that spectrum of discrete-sinc-
interpolated zoomed image (Figure 8.9(d)) does not contain any aliasing compo-
nents while spectra images zoomed with other methods do. Corresponding 1D
horizontal sections of these spectra shown in Figures 8.9(d)-8.9(e) illustrate this
quantitatively.
8.4. Global image resampling: fast discrete sinc-interpolation
algorithms and applications
8.4.1. Signal subsampling (zooming in) by DFT and
DCT spectrumzero-padding
Fast discrete sinc-interpolation algorithms are all based on fast transforms (fast
Fourier transform or fast DCT transform). The most well-known signal re-
sampling algorithm that implements discrete sinc-interpolation is the signal sub-
sampling algorithm by means of zero-padding of its DFT spectrum. Given sub-
sampling (zoom) factor M, the algorithm generates, from signal of N samples, a
signal of MN samples in which every Mth samples are corresponding samples of
the original signal and the rest (M 1)N samples are discrete sinc-interpolated
from original samples. The algorithm can be described by the equation
` a
`
k
= IFFT
MN
_
DFT ZP
M
_
FFT
N
_
a
k
___
, (8.25)
where {a
k
}, k = 0, 1, . . . , N1, are input signal samples, {` a
`
k
},
`
k = 0, 1, . . . , NM1,
are output signal samples, M is a signal zoom (subsampling) factor, FFT
N
() and
FFT
MN
() are direct and inverse fast Fourier transform operators of N- and, cor-
respondingly, MN-point. DFT ZP
M
[] in (8.25) is a zero-padding operator that
forms, from N-points sequence of samples, an MN-points sequence by padding
the former with (M1)N zeros. When N is an odd number, zeros are placed be-
tween (N 1)/2th and (N + 1)/2th samples of the N-points sequence. When N is
an even number, then, either
(i) (M1)N +1 zeros are placed between N/21th and N/2+1th samples
of the N-points sequence and N/2th sample is discarded, or
(ii) (M 1)N zeros are paced after N/2th sample and then the sequence
repeated beginning of its N/2th sample, or
(iii) (M1)N zeros are paced after N/2th sample of the sequence, this sample
is halved and then N/2th through (N 1)th samples are placed, N/2th
sample being halved.
356 Discrete sinc-interpolation
(a) (b)
(c) (d)
0
5
10
15
20
25
30
0 0.1 0.2 0.3 0.4 0.5
Normalized frequency
(e)
0
5
10
15
20
25
30
0 0.1 0.2 0.3 0.4 0.5
Normalized frequency
(f)
0
5
10
15
20
25
30
0 0.1 0.2 0.3 0.4 0.5
Normalized frequency
(g)
0
5
10
15
20
25
30
0 0.1 0.2 0.3 0.4 0.5
Normalized frequency
(h)
Figure 8.9. Spectra of 4x-zoomed PRUS image for bilinear (a) bicubic (b), Mems(5, 3, 1) (c), and
discrete sinc-interpolation (d) methods and corresponding central horizontal sections of the spectra
((e)(h)). All spectra are shown centered at spectrum zero frequency (dc) component, image lightness
being proportional to spectra intensity. Note speckle patterns in spectra (a)(c) caused by the interpo-
lation inaccuracy.
L. Yaroslavsky 357
Cases (i)(iii) implement above described Case 0, Case 2, and Case 1 discrete
sinc-interpolation, respectively.
Although discrete sinc-interpolation is optimal in preserving signal spectrum,
it has one major drawback. As interpolation kernel discrete sinc-function decays to
zero relatively slow, discrete sinc-interpolation heavily suers from boundary ef-
fects that may propagate rather far from signal boundaries. It is especially the case
in image processing when image size rarely exceeds, in each dimension, 1000 sam-
ples. With the use of FFT in the resampling algorithm, images are treated as being
virtually periodic. Therefore, samples at their left and right and, correspondingly,
upper and bottom borders are, virtually, immediate neighbors in the interpolation
process. Therefore, any discontinuity between opposite border samples will cause
heavy discrete sinc-function oscillations that propagate far away from the borders.
A simple and very ecient solution of this problem is working in the domain
of discrete cosine transform (DCT) instead of DFT:
` a
`
k
= IDCT
MN
_
DCT ZP
M
_
DCT
N
_
a
k
___
, (8.26)
where DCT
N
() and IDCT
MN
() are N-points fast direct and MN-points inverse
discrete cosine transforms and DCT ZP
M
[] is a DCT spectrum zero-padding
operator that places (M1)N zeros after the last (N1)th DCT spectrum sample.
For faster decay of the interpolation kernel, it is also advisable to halve the last two
samples that, for DCT, represent signal highest frequency component.
Figure 8.10 demonstrates virtual absence of boundary eect oscillations for
image zooming by DCTspectrumzero-padding algorithmcompared to DFTspec-
trum zero-padding.
As it is shown in Appendix C, point spread function of the DCT spectrum
zero-padding with halving its last two components is dened by equation
`
` a
k
=

DCT
0

2LN
+
1
N

L
N1
_
n=0
a
n
_
sin
_

_
(N + 1)/2NL)(` nL
`
k)
_
sin
_
(` nL
`
k)/2NL
_
cos
_
(` nL
`
k)
2L
_
+
sin
_

_
(N+1)/2NL
_
(` nL+
`
k)
_
sin
_
(` nL+
`
k)/2NL
_
cos
_
(` nL +
`
k)
2L
_
+
sin
_

_
(N1)/2NL
_
(` nL
`
k)
_
sin
_
(` nL
`
k)/2NL
_
cos
_

N2
2NL
(` nL
`
k)
_
+
sin
_

_
(N1)/2NL
_
(` nL+
`
k)
_
sin
_
(` nL+
`
k)/2NL
_
cos
_

N2
2NL
(` nL+
`
k)
_
_
.
(8.27)
One can see from (8.27) that DCT zero-padding interpolation is not a cyclic
shift invariant and is implemented by two pairs of sincd-function interpolation
kernels 1/2-shifted and mirror reected with respect to each other. Its behavior is
illustrated in Figure 8.11 for sampling positions at boundaries and at the middle
of the signal extent.
358 Discrete sinc-interpolation
(a) (b)
(c)
Figure 8.10. Zooming of an image fragment outlined by white box in (a): zero-padding its DFT spec-
trum (b) and zero-padding DCT spectrum (c). Note that heavy oscillations in the vicinity of image
borders in image (a) disappear in image (b).
As it is immediately seen from (8.27), point spread function of the DCT zero-
padding interpolation approximates the discrete sinc-function very closely. This
close similarity is illustrated in Figure 8.12 that shows PSFs (Figure 8.12(a)) and
discrete frequency responses (Figure 8.12(b)) of DFT and DCT zero-padding for
signal 4x-zooming.
Computationwise, signal L-times zooming by zero-padding its DFT or DCT
spectra requires O(log N) operations per each signal N samples for direct trans-
form and O(Llog NL) operation for inverse transform of zero pad spectra which
is quite inecient for large L. Moreover, when conventional radix 2 FFT and fast
DCT algorithms are used, zooming factor L should be selected to be an integer
power of 2. These two facts limit applicability of the spectra zero-padding algo-
rithms. However, in certain cases the use of above described algorithms is a good
practical solution. This might be, for instance, the case when one works in a certain
software environment, such as Matlab. Image zooming by means of DCT spectra
zero-padding can be naturally used when images are represented in a compressed
form such as in JPEG compression. In this case, zooming can be carried out with-
out the need to decompress images. In the next sections, much more computation-
ally ecient and exible discrete sinc-interpolation algorithms will be described
L. Yaroslavsky 359
0
0.5
1
(a)
0
0.5
1
(b)
0
0.5
1
(c)
Figure 8.11. Point spread function of DCT zero-padding for three dierent sampling positions.
that can compete, both in terms of the interpolation accuracy and computational
complexity, with other interpolation methods.
In conclusion, note that signal interpolation by DFT and DCT spectra zero-
padding can be naturally extended to interpolation by zero-padding of signal spec-
tra in other bases, such as Walsh or wavelet ones. This option is discussed in
Appendix D.
8.4.2. DFT- and DCT-based signal fractional shift algorithms
In this section, we describe signal fractional shift algorithms that provide a compu-
tationally ecient and competitive solution for virtually error-free signal resam-
pling. Consider rst the DFT-based algorithm that computes, for signal samples
{a
k
}, discrete sinc-interpolated samples {a
(u)
k
} of a signal shifted with respect to
the initial signal by an arbitrary distance u times signal sampling interval x. The
algorithm is described by the equation
` a
`
k
= IFFT
N
__

(intp)
(ux)
_

_
FFT
N
_
a
k
___
, (8.28)
where FFT
N
() and IFFT
N
() are direct and inverse N-point fast Fourier trans-
forms, symbolizes pointwise (Hadamard) matrix product and {
(intp)
r
(ux)} is
a set of coecients dened, for odd N by the above (8.20) in which ` x should be
replaced by ux. For even N, (8.21) is applicable with a slight modication that

(intp)
N/2
(ux) should be taken equal to Acos(2ru/N) because simple DFT is used in
the algorithmrather than SDFTassumed in the derivation of (8.21) and, therefore,
360 Discrete sinc-interpolation
0.2
0
0.2
0.4
0.6
0.8
1
10 20 30 40 50 60 70 80 90 100 110 120
DFT-sinc
DCT-sinc
(a)
0
0.5
1
1.5
0 0.5 1 1.5 2 2.5 3 3.5 4
Normalized frequency
DFT-sinc
DCT-sinc
(b)
Figure 8.12. Point spread functions (a) and frequency responses (b) of DCT spectrum zero-padding
(8.27) and DFT zero-padding (sincd-function sincd(1, N, x) of (8.23d)) for 4x-zooming.
set of coecients {
(intp)
r
(ux)} must obey complex conjugate symmetry property
of DFT spectra of real sequences.
We will call this algorithm DFT-based signal fractional shift algorithm. This
algorithm can be recommended for numerous applications. First of all, it allows
generating arbitrarily shifted discrete sinc-interpolated copies of signals. For in-
stance, it is especially useful for implementing image shearing in 3-step image ro-
tation algorithm (see [4]) in which, at each of the three stages, image shearing
(correspondingly, vertical, horizontal, and another vertical) is performed. Above
presented experimental results for image rotation with discrete sinc-interpolation
were obtained using DFT-based fractional shift algorithm.
Another option is signal/image zooming-in with an arbitrary integer zoom
factor. For zoom factor L, signal/image zooming can be implemented through
combination of L1 signal/image copies shifted by corresponding multiple of 1/L
L. Yaroslavsky 361
shifts. Above presented experimental results with discrete sinc-interpolated image
zooming were obtained using this algorithm.
One of the applications in which image rescaling with high interpolation ac-
curacy is required is real time location and tracking of moving targets in video
sequences. In this case, template images of the target with arbitrary orientation
and scale can be very rapidly computed using bilinear interpolation or similar fast
resampling techniques applied to a reference image of the target highly oversam-
pled using DFT/DCT-based zooming. Paper [5] reports such a hybrid resampling
for an implementation of the direct Fourier method of tomographic reconstruc-
tion (see also [6, Section 9.4.5]).
Yet another application option is signal/image subsampling in the vicinity of
a selected sample; this feature enables realization of continuous spectrum analysis
and computing signal correlation with subpixel accuracy for target location.
Being a cyclic convolution, the DFT-based signal fractional shift algorithm
suers from same boundary eects as the DFT zero-padding algorithm does. The
ecient practical solution of the problemis to implement convolution in DCT do-
main instead of DFT domain [7, 8]. Signal convolution in DCT domain is equiv-
alent to shifted DFT(1/2,0) convolution of an auxiliary signal obtained from the
initial signal by its extension to double length by means of its mirrored copy to
eliminate discontinuities at the signal boundaries. For signal ux-shift, the algo-
rithm is described by the equation
` a
`
k
= IDCT
N
__

(intp),re
r
(ux)
_

_
DCT
N
_
a
k
___
IDcST
N
__

(intp),im
r
(ux)
_

_
DCT
N
_
a
k
___
,
(8.29)
where DCT
N
() and IDCT
N
() are operators of direct and inverse DCT trans-
forms, IDcST
N
() is operator of the inverse discrete cosine-sine transform(for def-
initions of DCT and DcST, see Chapter 3), and {
(intp),re
r
(ux)}, {
(intp),im
r
(ux)} are
real and imaginary parts of coecients {
(intp)
r
(ux)} dened by (8.20) in which
N should be replaced by 2N:
_

(intp),re
r
(ux)
_
=
_
cos
_
ur
N
__
,
_

(intp),im
r
(ux)
_
=
_
sin
_
ur
N
__
, r = 0, 1, . . . , N 1,
(8.30)
and symbolizes elementwise (Hadamard) product of vectors.
With respect to the boundary eects, DCT-based fractional shift algorithm is
as ecient in eliminating boundary eects as the above-described DCT spectrum
zero-padding algorithm. In terms of the interpolation accuracy, it is equivalent to
the above DFT-based fractional shift algorithm as it implements convolution with
discrete sinc-function. Experimental evidence of the equivalency is illustrated in
Figures 8.13(a) and 8.13(b).
362 Discrete sinc-interpolation
(a) (b)
(c)
Figure 8.13. Error spectra for 606

rotations of PRUS-image test image. (a): DFT-sinc interpolation;


(b): DCT-sinc interpolation; (c): RotDFT-algorithm. All spectra are shown centered at spectrum zero
frequency (dc) component. Standard deviation of the rotation error is practically the same for all cases:
20.0, 19.4 and 21.1, respectively.
8.4.3. Signal zooming using scaled DFT
DFT- and DCT-based fractional shift algorithms originate from the concept of
shifted discrete fourier transforms (SDFT) that are obtained, for sampled signals,
from Fourier integral transform in the assumption of an arbitrary shift of the sig-
nal and its Fourier spectra sampling grid shifts with respect to continuous signal
and its spectrum coordinate systems (see [9] and also Chapter 3). Conventional
discrete Fourier transform can be regarded as a special case of SDFTs when no sig-
nal and its spectrum sampling grids are assumed. It is also assumed in the deriva-
tion of DFTs that signal and its Fourier spectrum sampling intervals, say x and
f , are linked with the number N of signal samples, according to the sampling
theorem, by the cardinal sampling condition
f =
1
Nx
. (8.31)
As it is shown in Chapter 3, if one assumes a certain -times oversampling
or undersampling, with respect to the cardinal sampling, with sampling inter-
val x = 1/Nf in -scaled coordinates and sampling grid shifts (u

, v

) in,
L. Yaroslavsky 363
respectively, signal and transform domains, scaled discrete Fourier transforms
(ScDFT(u

, v

; ))

u,v;
r
=
1

N
N1
_
k=0
a
k
exp
_
i2
_
k + u

__
r + v

_
N
_
(8.32)
can be obtained.
Similar to the case of shifted DFT, where the availability of arbitrary shift pa-
rameters enables, as it was described above, arbitrary fractional shift of sampled
signal with discrete sinc-interpolation, the availability of an arbitrary scale param-
eter in ScDFT enables discrete signal resampling into an arbitrary scale by means
of applying to the signal direct and inverse ScDFTs with dierent scale parameters.
The following equations prove that this resampling is carried out with discrete-
sinc interpolation. Let

r
=
1

N
N1
_
n=0
a
n
exp
_
i2
_
n + u
0
__
r + v
0
_
N
_
=
1

N
N1
_
n=0
a
n
exp
_
i2
` n
_
r + v
0
_
N
_
,
(8.33)
where ` n = n + u
0
, be SDFT(u
0
, v
0
) coecients of a signal specied by its samples
{a
n
}. Applying to these coecients ScDFT(u

, v

; ) of (8.32), obtain
` a
k
=
1

N
N1
_
r=0

r
exp
_
i2
_
k + u

__
r + v

_
N
_
=
1

N
N1
_
r=0

r
exp
_
i2
`
k` r
N
_
,
(8.34)
where
`
k = k + u

and ` r = r + v

. Then,
` a
k
=
1
N

N1
_
r=0
_
N1
_
n=0
a
n
exp
_
i2
r + v
0
N
` n
_
_
exp
_
i2
r + v

N
`
k
_
=
1
N

N1
_
n=0
a
n
exp
_
i2
_
` nv
0
+
`
kv

/
N
__
N1
_
r=0
exp
_
i2
` n +
`
k/
N
r
_
=
1
N

N1
_
n=0
a
n
sin
_
(` n +
`
k/)
_
sin
_
(` n +
`
k/)/N
_
exp
_
i2
_
` n
_
v
0
+ (N 1)/2
_
+ (
`
k/)
_
v

+ (N 1)/2
_
N
__
.
(8.35)
364 Discrete sinc-interpolation
With settings
v
0
= v

=
N 1
2
, (8.36)
we nally obtain
` a
k
=
1

N1
_
n=0
a
n
sin
_
(` n+
`
k/)
_
N sin
_
(` n+
`
k/)/N
_
=
N1
_
n=0
a
n
sincd
_
N,
_
_
n+u
0
_
+
k + u

__
,
(8.37)
which means discrete sinc-interpolated signal resampling and rescaling with re-
spect to points u
0
, u

, respectively.
As it is shown in Chapter 3, scaled DFT can be represented as a digital convo-
lution, and therefore, by the convolution theorem, can be computed using FFT. In
this way, we arrive at the ScDFT-based image rescaling algorithm:
` a
`
k
=

_
exp
_
i
`
k
2
N
__
IFFT
[N]
_

_
FFT
[N]
_
ZP
[N],N
_
SDFT
N,u
0
_
a
k
__


_
exp
_
i
` r
2
N
__
_
FFT
[N]
_

_
exp
_
i
` r
2
N
__
_
_

_
,
(8.38)
where [N] is the smallest integer larger than N, FFT
[N]
{} and IFFT
[N]
{} are
direct and inverse [N]-points FFT, SDFT
N,u
0
(a
k
) is shifted DFTdened by (8.33),
denotes elementwise (Hadamard) product of vectors, and ZP
[N],N
{} is a zero-
padding operator. If > 1, it places ([N] N) zeros in the middle of the input
sequence, as in the zero-padding algorithm, and if < 1 it nulls (N [N]) cor-
responding spectral coecients to implement lowpass ltering required for signal
undersampling. To the best of the authors knowledge, such an algorithm of im-
age rescaling was rst published in [10]. Figure 8.14 illustrates examples of image
resizing using ScDFT.
8.4.4. Image rotation and scaling using rotated 2DDFT
Second signal dimension adds additional degrees of freedom to signal transforma-
tions. For 2D signals, sampling of signals and their Fourier spectra can be carried
out in the coordinates that are shifted, scaled, and rotated with respect to the sig-
nal and/or their spectra coordinates system. Taking this into account, one can, as
L. Yaroslavsky 365
Figure 8.14. Examples of rescaling, using ScDFT algorithm of (8.38), of an image, shown in the left
top corner, with scale factors 1/, 2/, 3/, 4/ and 5/ (bottom images, left to right).
it is shown in Chapter 3, arrive at rotated and scaled discrete Fourier transform
(RotScDFT):

r,s
=
1
N
N1
_
k=0
N1
_
l=0
a
k,l
exp
_
i2
_
`
k cos +
`
l sin
N
` r
`
k sin
`
l cos
N
`s
__
,
(8.39)
where
`
k = k + u
(k)

,
`
l = l + u
(l)

, (8.40)
u
(k)

, u
(l)

, , and are signal sampling grid shifts, rotation angle, and scale factor
with respect to the signal coordinate system, and
` r = r + v
(r)

, `s = s + v
(s)

, (8.41)
v
(r)

and v
(s)

are Fourier spectrum sampling grid shifts.


Similar to the above-described signal shift or signal rescaling using shifted
DFT or scaled DFT, one can use rotated DFT for image rescaling and rotation by
applying RotDFT with appropriate scale and rotation angle parameters to signal
SDFT spectrum. The following equations prove that in this rotation and rescal-
ing separable discrete sinc-interpolation in rotated and scaled image coordinate is
implemented.
Let

r,s
=
1
N
N1
_
m=0
N1
_
n=0
a
m,n
exp
_
i2
_
`
` m
`
` r
N
+
`
` n
`
`s
N
__
, (8.42)
where
`
` m = m + u
(n)
0
,
`
` n = n + u
(n)
0
,
`
` r = r + v
(r)
0
,
`
`s = s + v
(s)
0
are SDFTs of an image
represented by its samples {a
m,n
}. Apply to this spectrum rotated DFT dened by
366 Discrete sinc-interpolation
(8.39), and obtain
` a
k,l
=
1
N
N1
_
r=0
N1
_
s=0
_
1
N
N1
_
m=0
N1
_
n=0
a
m,n
exp
_
i2
_
`
` m
`
` r
N
+
`
` n
`
`s
N
___
exp
_
i2
_
`
k cos +
`
l sin
N
` r
`
k sin
`
l cos
N
`s
__
=
1
N
2
N1
_
m=0
N1
_
n=0
a
m,n

_
N1
_
r=0
N1
_
s=0
exp
_
i2
_
`
` m+(
`
k cos +
`
l sin)/
N
r +
`
` n(
`
k sin
`
l cos )/
N
s
___
exp
_
i2
_
`
` mv
(r)
0
+(
`
k cos +
`
l sin)v
(r)

/
N
+
`
` nv
(s)
0
+(
`
k sin
`
l cos )v
(s)

/
N
__
=
1
N
2
N1
_
m=0
N1
_
n=0
a
m,n
sin
_

_
`
` m+ (
`
k cos +
`
l sin)/
__
sin
_

__
`
` m+ (
`
k cos +
`
l sin)/
_
/N
__

sin
_

_
`
` n + (
`
l cos
`
k sin)/
__
sin
_

__
`
` n + (
`
l cos
`
k sin)/
_
/N
__
exp
_
i2
`
` m
_
v
(r)
0
+ (N 1)/2
_
+ (
`
k cos +
`
l sin)
_
v
(r)

+ (N 1)/2
_
/
N
_
exp
_
i2
`
` n
_
v
(s)
0
+ (N 1)/2
_
+ (
`
k sin
`
l cos )
_
v
(s)

+ (N 1)/2
_
/
N
_
,
(8.43)
or, with natural settings
v
(r)
0
= v
(r)

= v
(s)
0
= v
(s)

=
N 1
2
,
` a
k,l
=
1

N1
_
m=0
N1
_
n=0
a
m,n
sincd
_
N;
_
`
` m+
`
k cos +
`
l sin

__
sincd
_
N;
_
`
` n +
`
l cos
`
k sin

__
,
(8.44)
which means signal resampling in rotated and scaled coordinates with separable
discrete sinc-interpolation. Figure 8.13(c) provides an experimental evidence of
virtual equivalency, in terms of the interpolation accuracy, of image rotation using
RotDFT and using DFT or DCT signal fractional shift-based three-pass rotation
algorithm.
It is shown in Chapter 3 that RotDFT can, similar to ScDFT, be represented
as a digital convolution and, therefore, can be eciently computed using FFT. In
L. Yaroslavsky 367
this way we arrive at the following image rescaling and rotation algorithm:
_
` a
k,l
_
=IFFT2
N
_
FFT2
N
_
ZP
[N],N
_
SDFT
N
_
a
k
__
A
r,s
_
FFT2
N
_
ChF(r, s)
__
,
(8.45)
where FFT2
[N]
[] and IFFT2
[N]
[] are operators of direct and inverse [N]-
point 2D FFT, [N] is the smallest integer larger than N, SDFT
N
(a
k
) is dened
by (8.33) and ZP
[N],N
{} is the same zero-padding operator which was involved
in above-presented image zooming algorithm and denotes, as everywhere above,
elementwise, or Hadamard product of vectors. A nonscale version of the described
image rotation algorithm was suggested in [11].
To conclude this section, mention that, as this image rotation and rescaling
algorithm is implemented through processing in DFT domain, one can combine
rotation and scaling with adaptive image restoration and enhancement through
nonlinear modication of its spectrum such as soft/hard thresholding, Pth low
dynamic range compression and alike as it is described in Chapter 5. Such a com-
bined algorithm is described by the equation
_
` a
k,l
_
= IFFT2
N
_
PWNLT
_
FFT2
N
_
ZP
[N],N
_
SDFT
N
_
a
k
__
A
r,s
_
FFT2
N
_
ChF(r, s)
___
,
(8.46)
where PWNLT{} is the above-mentioned pointwise nonlinear spectrum trans-
formation.
Figure 8.15 illustrates this option. It shows a result of a simultaneous image
rotation and scaling and a result of rotation, scaling, denoising by hard threshold-
ing in spectral domain combined with P-law transformation of absolute values of
image spectral coecients with P = 0.5 as it is described in Chapter 5.
8.4.5. Numerical differentiation and integration
Signal numerical dierentiation and integration are operations that require mea-
suring innitesimal increments of signals and their arguments. Therefore, numer-
ical computing signal derivatives and integrals assume one of another method of
building continuous models of signals specied by their samples through explicit
or implicit interpolation between available signal samples. Because dierentiation
and integrations are shift invariant linear operations, methods of computing sig-
nal derivatives and integrals from their samples can be conveniently designed and
compared in the Fourier transform domain.
Let Fourier transform spectrum of continuous signal a(x) is ( f ):
a(x) =
_

( f ) exp(i2 f x)df . (8.47)


Then, Fourier spectrum of its derivative
a(x) =
d
dx
a(x) =
_

_
(i2 f )( f )
_
exp(i2 f x)df (8.48)
368 Discrete sinc-interpolation
(a)
(b) (c)
Figure 8.15. Image re-scaling, rotation, denoising and enhancement using RotScDFT: (a) initial im-
age; (b) 10

-rotated, 1.7 times magnied image; (c) 10

-rotated, 1.7 times magnied, denoised, and


enhanced image.
will be (i2 f )( f ) and Fourier spectrum of its integral
a(x) =
_
a(x)dx =
_

__

1
i2 f
_
( f )
_
exp(i2 f x)df (8.49)
will be ( f )/(i2 f ). FromFourier transformconvolution theoremit follows that
signal dierentiation and integration can be regarded as signal linear ltering with
lter frequency responses, correspondingly
H
di
= i2 f , H
int
=
i
2 f
. (8.50)
Let now signal a(x) be represented by its samples {a
k
}, k = 0, 1, . . . , N 1,
and let {
r
} be a set of DFT coecients of discrete signal {a
k
}:
a
k
=
1

N
N1
_
r=0

r
exp
_
i2
kr
N
_
. (8.51)
Then, following the argumentation of Section 8.2 for the optimal resampling l-
ter, one can conclude that samples {
(di)
r,opt
} and {
(int)
r,opt
} of continuous frequency
L. Yaroslavsky 369
response of numerical dierentiation and integration representation are dened
as

(di)
r
=
_

i2r
N
, r = 0, 1, . . . ,
N
2
1,

2
, r =
N
2
,
i2(N r)
N
, r =
N
2
+ 1, . . . , N 1,
(8.52a)

(int)
r,opt
=
_

_
0, r = 0,
iN
2r
, r = 1, . . . ,
N
2
1,

2
, r =
N
2
,
iN
2(N r)
, r =
N
2
+ 1, . . . , N 1,
(8.52b)
for even Nand

di
r
=
_

i2r
N
, r = 0, 1, . . . ,
N 1
2
1,
i2(N r)
N
, r =
N + 1
2
, . . . , N 1,
(8.52c)

(int)
r
=
_

_
iN
2r
, r = 0, 1, . . . ,
N 1
2
1,
iN
2(N r)
, r =
N + 1
2
, . . . , N 1,
(8.52d)
for odd N.
One can show that numerical dierentiation and integration according to
(8.52) imply discrete sinc-interpolation of signals. Note that the coecients
(di)
N/2
and
(int)
N/2
in (8.52a), (8.52b) are halved that correspond to the above-described
Case 1 of discrete sinc-interpolation (8.23d).
Equations (8.52) imply the following algorithmic implementation for com-
puting derivatives and integrals of signals specied by their samples
_
a
k
_
= IFFT
N
__

(di)
r,opt
_
FFT
__
a
k
___
, (8.53a)
_
a
k
_
= IFFT
N
__

(int)
r,opt
_
FFT
__
a
k
___
. (8.53b)
Thanks to the use of fast Fourier transform, the computational complexity of the
algorithms is O(log N) operations per signal sample. Digital lter described by
(8.53a) is called discrete ramp-lter.
370 Discrete sinc-interpolation
Likewise all DFT-based discrete sinc-interpolation algorithms, DFT-based dif-
ferentiation and integration algorithms, being the most accurate in term of pre-
serving signal spectral components within the baseband, suer from boundary ef-
fects. Obviously, DFT-based dierentiation is especially vulnerable in this respect.
This drawback can be eciently overcome by means of even extension of the
signals to double length through mirror reection at their boundaries before ap-
plying above-described DFT-based algorithms. For such extended signals, DFT-
based dierentiation and integration are reduced to using fast DCT and IDcST
algorithms instead of FFT:
_
a
k
_
= IDcST
__

(di)
r,opt
_
DCT
__
a
k
___
=
2
N

2N
N1
_
r=1
r
(DCT)
r
sin
_

k + 1/2
N
r
_
;
(8.54a)
_
a
k
_
= IDcST
__

(di)
r,opt
_
DCT
__
a
k
___
=

N
2

2
N1
_
r=1

(DCT)
r
r
sin
_

k + 1/2
N
r
_
,
(8.54b)
with the same computational complexity of O(log N) operations per signal sam-
ple.
In numerical mathematics, alternative methods of numerical computing sig-
nal derivatives and integrals are common that are implemented through signal
discrete convolution in the signal domain
a
k
=
N
h
1
_
n=0
h
di
n
a
kn
, a
k
=
N
h
1
_
n=0
h
int
n
a
kn
. (8.55)
The following simplest dierentiating kernels of two and ve samples are rec-
ommended in manuals on numerical methods (see [12]):
h
di(1)
n
= [1, 1], (8.56a)
h
di(2)
n
=
_

1
12
,
8
12
, 0,
8
12
,
1
12
_
. (8.56b)
Both are based on an assumption that in the vicinity of signal samples signals can
be expanded into Taylor series.
Most known numerical integration methods are the Newton-Cotes quadra-
ture rules (see [13]). The three rst rules are the trapezoidal, the Simpson, and the
3/8-Simpson ones. In all the methods, the value of the integral in the rst point is
not dened because it aects to the result constant bias and should be arbitrarily
chosen. When it is chosen to be equal to zero, the trapezoidal, Simpson, and 3/8-
Simpson numerical integration methods are dened, for k as a running sample
L. Yaroslavsky 371
index, by equations
a
(T)
1
= 0, a
(T)
k
= a
(T)
k1
+
1
2
_
a
k1
+ a
k
_
, (8.57a)
a
(S)
1
= 0, a
(S)
k
= a
(S)
k2
+
1
3
_
a
k2
+ 4a
k1
+ a
k
_
, (8.57b)
a
(3/8S)
0
= 0, a
(3/8S)
k
= a
(3/8S)
k3
+
3
8
_
a
k3
+ 3a
k2
+ 3a
k1
+ a
k
_
. (8.57c)
Another frequently used alternative is cubic spline integration (see [14]), for which
a
(int,CS)
k+1
a
(int,CS)
k
=
1
2
_
a
k
+ a
k+1
_

1
24
_
m
k
+ m
k+1
_
, (8.57d)
where coecients {m
k
} are determined by the system of linear equations
__
m
k1
+ 4m
k
+ m
k+1
_
= 6
_
a
k+1
2a
k
+ a
k1
__
. (8.57e)
In these integration methods, a linear, a quadratic, a cubic and a cubic spline in-
terpolation, respectively, are assumed between the sampled slope data. In the cu-
bic spline interpolation, a cubic polynomial is evaluated between every couple of
points (see [14]), and then an analytical integration of these polynomials is per-
formed.
As it was shown in Section 8.2.2, discrete frequency responses of digital lters
completely determine their continuous and overall frequency responses. Compare
discrete frequency responses of above-described numerical dierentiation and in-
tegration methods. Applying N-point discrete Fourier transform to (8.57), obtain

di(1)
r
sin
_
r
N
_
,

di(2)
r

8 sin(2r/N) sin(4r/N)
12
,
(8.58)

(int,T)
r
=

(Tr)
r

r
=
_

_
0, r = 0,

cos(r/N)
2i sin(r/N)
, r = 1, . . . , N 1,

(int,S)
r
=

(S)
r

r
=
_

_
0, r = 0,

cos(2r/N) + 2
3i sin(2r/N)
, r = 1, . . . , N 1,

(int,3S)
r
=

(3S)
r

r
=
_

_
0, r = 0,

cos(3r/N) + 3 cos(r/N)
i sin(3r/N)
, r = 1, . . . , N 1,

(int,CS)
r
=
_

_
0, r = 0,

1
4i
cos(r/N)
sin(r/N)
_
1 +
3
cos
_
2(r/N)
_
+ 2
_
, r = 1, . . . , N 1.
(8.59)
372 Discrete sinc-interpolation
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
Normalized frequency
Ramp
D2
D1
Figure 8.16. Absolute values of frequency responses of dierentiation lters described by (8.56a)
(curve D1), (8.56b) (curve D2), and (8.52c) (Ramp-lter).
10
4
10
3
10
2
10
1
10
0
F
r
e
q
u
e
n
c
y
r
e
s
p
o
n
s
e
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized frequency
3/8-Simpson Simpson
DFT
CubSpline
Trapezoidal
Figure 8.17. Absolute values of frequency responses of numerical integration lters described by
(8.59) and of DFT-based method (8.52b) and (8.52d).
These frequency responses along with the frequency responses of DFT-based
dierentiation and integration lters (8.52a) and (8.52c) are shown, for compari-
son, in Figures 8.16 and 8.17.
One can see from the gure that common numerical dierentiation and inte-
gration methods entail certain and sometimes very substantial distortions of signal
spectral contents on high frequencies. All of themattenuate signal high frequencies
and Simpson and 3/8-Simpson integration methods, being slightly more accurate
than trapezoidal method in the middle of the signal baseband, tend even to gener-
ate substantial artifacts if signals contain higher frequencies. Frequency response
of the 3/8-Simpson rule tends to innity for the 2/3 of the maximum frequency,
and the frequency response of the Simpson rule has almost the same tendency for
the maximal frequency in the baseband. This means, in particular, that round-
o computation errors and noise that might be present in input data will be over
amplied by Simpson and 3/8-Simpson in these frequencies.
Quantitative evaluation of the superiority of DFT/DCT-based dierentiation
methods can be gained from experimental data illustrated in Figures 8.178.19,
L. Yaroslavsky 373
10
3
10
2
10
1
10
0
50 100 150 200 250 300 350 400 450 500
0.5
0.5
DFT D2
D1
1
1
1
0.75
0.75
0.25
0.25
0.25
Figure 8.18. Experimental data on samplewise normalized standard deviation of the dierentiation
error for D1, D2, and DFT methods. Numbers at curves indicate fraction (from quarter to one) of test
signal bandwidth with respect to the base bandwidth as dened by the sampling rate.
which present results obtained by computer statistical simulation of dierentia-
tion of realizations of pseudorandom signals with uniform spectrum in the range
1/16 of the baseband the entire baseband. In the simulation, 16 series of statisti-
cal experiments with 100 experiments in each run were carried out. In the runs,
pseudorandom signals of 32 704 samples with uniform spectrum were generated
in order to imitate continuous signals. In each Kth run, generated pseudorandom
signal was lowpass ltered to 1/32K of its baseband using ideal lowpass lter im-
plemented in DFT domain, and its derivative was computed using DFT domain
ramp-lter. The ltered signal was used as a model of a continuous signal and its
derivative was used as an estimate of its ideal derivative. Then, a central half of this
signal that encompasses 16 352 samples taken 8196 samples apart from the signal
borders was subsampled to generate 511 samples of a test discrete signal used in
the dierentiation by the three methods dened by (8.56a) (D1 method), (8.56b)
(D2 method), (8.52c) (DFT method), and (8.54a) (DCT method). Correspond-
ing central part of the ideal derivative signal was also correspondingly subsampled
and was used as a reference to evaluate dierentiation error for tested methods.
Dierential error was computed as a dierence between the ideal derivative and
results of applying tested dierentiation methods divided by standard deviation
of the ideal derivative over 511 samples. Finally, standard deviation of the nor-
malized error over 100 realizations was found for each signal sample. Obtained
results are plotted samplewise in Figure 8.18 for methods D1, D2, and DFT and in
Figure 8.19 for methods D2, DFT, and DCT.
In Figure 8.18, one can see that, indeed, the simplest method D1 performs
very poorly, while method D2 outperforms DFT method for signals with band-
width less than 0.5 of the baseband. Also can be seen that accuracy of the DFT
dierentiation method improves with the distance from signal boundaries. How-
ever, even for samples that are far away from signal boundaries, boundary eects
badly deteriorate the dierentiation accuracy. Data presented in Figure 8.19 evi-
dence that DCT method does successfully overcome the boundary eect problem
374 Discrete sinc-interpolation
10
4
10
2
10
0
50 100 150 200 250 300 350 400 450 500
0.5
DCT
DFT
D2
1
0.75
0.25
Figure 8.19. Experimental data on samplewise normalized standard deviation of the dierentiation
error for D2, DFT, and DCT methods. Numbers at curves indicate fraction (from quarter to one) of
test signal bandwidth with respect to the base bandwidth as dened by the sampling rate.
10
5
10
4
10
3
10
2
10
1
E
r
r
o
r
S
D
/
d
e
r
i
v
a
t
i
v
e
S
D
0.2 0.4 0.6 0.8 1
Signal bandwidth
DFT
DCT
D2
D1
Figure 8.20. Normalized standard deviation of the dierentiation error averaged over 100 samples in
the middle of the signal (samples 200300) for D1, D2, DFT, and DCT dierentiation methods as a
function of test signal bandwidth (in fractions of the baseband dened by the signal sampling rate).
and substantially outperforms both D1 and D2 methods even for narrowband sig-
nals.
In the described experiment, average mean square dierentiation error com-
puted over the central half of the test signals with dierent bandwidth was also
measured for dierent methods. The results presented in Figure 8.20 convincingly
evidence that method D2 provides better accuracy only for signals with bandwidth
less than 0.05 of the baseband, and even for such signals normalized error stan-
dard deviation for DCT method is anyway less than 10
5
. For signals with broader
bandwidth, the accuracy of the DCT dierentiation method outperforms other
methods at least by 2 order of magnitude. It was also found in this experiment
that masking signal with a window function that gradually nulls signal samples
L. Yaroslavsky 375
0
0.01
0.02
0.03
0.04
0.05
0.06
0 2 4 6 8 10
Pixel
DFT
Cubic spline
DCT
(a)
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0 2 4 6 8 10
Pixel
DFT
Cubic spline
DCT
(b)
0
0.1
0.2
0.3
0.4
0.5
0.6
0 2 4 6 8 10
Pixel
DFT
Cubic spline
DCT
(c)
Figure 8.21. Integration error versus sample index for DFT-based, cubic spline, and DCT-based nu-
merical integration methods for sinusoidal signals with normalized initial frequencies 0.27 (a), 0.54
(b), and 0.81 (c).
in the vicinity of its border substantially improves the dierentiation accuracy of
both DFT and DCT methods even further. To complete this comparison of dif-
ferentiation methods, note also that, as it follows from above results, conventional
numerical methods maintain good dierentiation accuracy if signals are highly
oversampled, which actually undermines their only advantage, that of low com-
putational complexity.
In order to illustrate and compare, in quantitative terms, performance of dif-
ferent numerical integration methods, we present in Figures 8.21 and 8.22 exper-
imental results reported in [15] on integration accuracy for test sinusoidal sig-
nals of dierent frequencies for cubic spline, DFT-based and DCT-based inte-
gration methods which are the most accurate among above-described methods.
The number of signal samples N was 256, 512, and 1024 and, for each integer
frequency index r, results for 20 sinusoidal signals with frequencies in the range
[r 1/2 : r + 1/2] taken with step 1/20 were averaged to obtain root mean square
integration error for each signal sample. The error was evaluated with respect to
the analytical integral value for the correspondent signal.
Figure 8.21(a) shows mean square integration error for rst 10 samples of
sinusoidal signals with N = 256 and frequency indices 35, 70, and 105 (0.27, 0.54,
and 0.81 of the highest frequency in the baseband, correspondingly). As one can
see, for low-signal frequency, DFT method underperforms cubic spline one due to
boundary eects while, for higher frequencies, it provides higher accuracy and its
advantage grows with signal frequency. One can also see that DCT-based method
suers from boundary eects not more than cubic spline one and substantially
outperforms the latter for all signal samples beginning 4-5th ones.
Figure 8.22 shows similar data obtained for sinusoidal signals with number of
samples N = 256, 512, and 1024 and normalized frequencies in the range [0.54
1/N]. They show that boundary eects do not practically depend on the number
N of samples and that they aect only rst 10 or so signal samples.
376 Discrete sinc-interpolation
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0 2 4 6 8 10
Pixel
Fourier
Cubic spline
DCT
(a)
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0 2 4 6 8 10
Pixel
Fourier
Cubic spline
DCT
(b)
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0 2 4 6 8 10
Pixel
Fourier
Cubic spline
DCT
(c)
Figure 8.22. Integration error versus sample index for DFT-based, cubic spline, and DCT-based nu-
merical integration methods for sinusoidal signal with normalized initial frequency 0.54 for sinusoidal
signals with dierent number of samples N: (a) N = 256, (b) N = 512, (c) N = 1024.
(a) (b) (c) (d) (e)
Figure 8.23. Comparison of the integrator resolving power: (a) integrator input; (b) output of the
ideal integrator with unlimited bandwidth; (c) output of the DFT-based integrator; (d) output of the
cubic spline integrator; (e) output of the trapezoidal integrator.
Further insight into metrological advantages of DFT/DCT-based numerical
integration methods over other methods may be gained from comparison of the
integration resolving power. Resolving power of integrators characterizes their ca-
pability to resolve between close sharp impulses in the input data. Though it is fully
dened by the integrator frequency responses, it is much more straightforward to
compare the resolving power for dierent integrators directly in signal domain.
Figure 8.23 illustrates results of a numerical evaluation of the capabilities of
three types of integrators, trapezoidal, cubic spline, and DFT-based ones, to resolve
two sharp impulses placed on the distance of one sampling interval one from an-
other for the case when the second impulse is of half height of the rst impulse
(see [15]). The signals shown in the gure are 8 times subsampled and sincd-
interpolated to imitate the corresponding continuous signals at the integrator out-
put. The gure clearly shows how much the tested integrators dier in their re-
solving power. DFT-based integrator (Figure 8.23(c)) produces the sharpest peaks
with the lowest valley between signal peaks compared to that for cubic spline inte-
grator (Figure 8.23(d)) and trapezoidal integrator (Figure 8.23(e)). In particular,
the latter seems to be virtually incapable of reliable resolving the half-height im-
pulse.
L. Yaroslavsky 377
DFT and especially DCT-based dierentiation and integration methods being
the most accurate numerical dierentiation and integration methods can nd nu-
merous applications in optical metrology and experimental data processing. Signal
dierentiating by ramp-ltering has found its application in digital image recon-
struction from its projections by the ltered back projection method. The DCT-
based discrete ltered back projection image reconstruction algorithm of image re-
construction that uses the DCT-based ramp-lter and image rotation algorithm
described in Section 8.4.2 is as follows:
_
a
k,l
_
=
N

1
_
s=0
ROT

__

p
(
s
)
k
_

1
l
__
; k, l = 0, 1, . . . , N 1, (8.60)
where
_

p
(
s
)
k
_
= IDcST
__

di
r
_
DCT
__
p
(
s
)
k
___
(8.61)
is a vector-row of samples of ramp-ltered image projection {p
(
s
)
k
} obtained for
angle
s
, s = 0, 1, . . . , N

1, {

1
l
} is a vector-column of N ones and symbolizes
matrix Kronecker product.
In addition to higher accuracy, DFT/DCT-based dierentiation and integra-
tion methods have one more property that makes them ideally suited for dier-
entiation/integration of noisy data. According to the theory of optimal Wiener l-
tering, when input data contain noise, frequency responses H
di
and H
int
of ideal
dierentiation and integration devices dened by (8.50) should be modied with
an account to signal-to-noise ratio in the data to become
H
(noise)
di
= H
di
SNR( f )
1 + SNR( f )
,
H
(noise)
int
= H
int
SNR( f )
1 + SNR( f )
,
(8.62)
where SNR( f ) is input data signal-to-noise ratio on frequency f . As DFT/DCT-
based dierentiation and integration methods are designed and implemented in
signal spectral domain, corresponding modication of their discrete frequency re-
sponses (8.52) is straightforward and their implementation does not require any
additional data processing.
8.4.6. Computational complexity and other practical issues
One of the fallacies regarding discrete sinc-interpolation is a widely shared opin-
ion of its high computational complexity. Indeed, the most known DFT spectrum
zero-padding algorithms have a relatively high computational complexity and are
very inexible. Being implemented using traditional FFT algorithms, they require,
for L-fold equidistant subsampling (zooming) of signals of N samples, O(log LN)
378 Discrete sinc-interpolation
of operations (additions and multiplications of complex numbers) per output sig-
nal sample and require subsampling factor L to be power of 2. Such an imple-
mentation involves a vast amount of operations with zero data. However, these
operations can be removed using, for inverse FFT of zero padded data, pruned
FFT algorithms (see [6]). Similar pruned algorithms for fast DCT are also avail-
able (see [16]). For large L, this can substantially reduce the computational com-
plexity of the DFT/DCT spectra zero-padding algorithms. However, it does not
improve the algorithm exibility. Above described DFT- and DCT-based signal
fractional shift algorithms completely eliminate those drawbacks of zero-padding
algorithms.
Computational complexity of subsampling (zooming), with arbitrary sub-
sampling factor, of 1D signals of N samples using DFT- and DCT-based signal
fractional shift algorithms is O(log N) per output sample. One can compare them
with the computational complexity of spline-based resampling algorithms whose
computational complexity is, by the order of magnitude, O(n), where n is a value
proportional to the spline order. For instance, for mentioned Mems(5, 3, 1), n = 9,
which means that, by the order of magnitude, its complexity is comparable with
that of DFT(DCT)-based fractional shift algorithm for N = 512.
Computational complexity of image zooming depends on whether zoom-
ing is carried out in a separable (rows-column) or in an inseparable way. In the
separable implementation, L
x
L
y
-zooming images of N
x
N
y
pixels, requires
O(L
x
N
x
N
y
log N
x
) operations (L
x
times N
x
-point FFTs for each of N
y
image rows)
for zooming along coordinate x plus O(L
y
L
x
N
x
N
y
log N
y
) operations (L
y
times
N
y
-point FFTs for each of L
x
N
x
1D zoomed image rows) for zooming along co-
ordinate y. Therefore, the per-output sample computational complexity of sepa-
rable image L
x
L
y
-zooming can be estimated as being O(log N
y
+ log N
x
/L
y
N
x
),
which means that the computational complexity of the separable image zoom-
ing using DFT/DCT-based signal fractional shift algorithms is determined mainly
by the lowest dimensionality of the image. Inseparable implementation requires
performing L
x
L
y
times N
x
N
y
-point FFTs. Therefore, the per-output pixel compu-
tational complexity will be higher: O(log N
x
N
y
) operations. Note, however, that
inseparable zooming allows zooming with simultaneous arbitrary inseparable 2D
spectrum shaping and ltering.
Three-step image rotation implemented through the use of DFT/DCT-based
signal fractional shift algorithm requires, for the image of N
x
N
y
pixels,
O(2N
x
N
y
log N
x
) operations for each of two-image shearing in x direction plus
O(2N
x
N
y
log N
y
) operations for image shearing in y direction which amounts
O(2 log N
x
+ log N
y
) operations. The same, by the order of magnitude, is estima-
tion of computational complexity of fast Radon transform and fast ltered back
projection inverse Radon transform as well as of DFT/DCT-based dierentiation
and integration methods.
Scaled DFT-based image zooming algorithm is computationally more expen-
sive than image zooming by means of DFT/DCT-based signal fractional shift al-
gorithm, especially for large zoom factors as it involves two [N]-point FFTs in-
stead of one N-point FFT. Yet its capability to implement zooming with arbitrary
L. Yaroslavsky 379
noninteger factors makes it an attractive option when accurate image zooming
with zoom-factor in the range 0.52 is required.
Using, for image rotation, of RotScDFT-based rotation algorithm has no ad-
vantage with respect to the three-step rotation algorithm that uses DFT/DCT-
based signal fractional shift. It might be useful only when both image rotation
and rescaling are needed or when image data are already given in Fourier spectral
domain, such as in NMR imaging.
Above-presented estimations of computational complexity of DFT/DCT-
based discrete sinc-interpolation resampling methods are estimations by the order
of magnitude. Exact gures of the computational complexity depend on particu-
lar software implementation, compiler eciency and of the type of the computer
CPU. Certain insight into comparison of real processing speed for dierent in-
terpolation methods can be gained from the following data obtained in course
of above-described experiments with image rotation using dierent resampling
methods. Matlab m-le that implements the three-step rotation algorithm using a
DCT-based signal fractional shift Matlab dll-le subroutine, and a Windows exe-
le that implements Mems(5, 3, 1)-based rotation algorithmboth run, on the same
computer, about 7 seconds for 100 rotations of 256256 pixel images. The proper
Matlab programimrotate.mof Matlab image processing tool box runs, for bicubic
interpolation, slower (17.67 seconds for 60 rotations) than a Matlab m-le that im-
plements, using only standard Matlab means, three-step rotation algorithm with
DFT-based signal fractional shift (14.16 seconds for 60 rotations).
All described sinc-interpolation algorithms implement processing in DFT/
DCT domain. This provides to all of them an additional capability, not avail-
able in other convolution-based interpolation methods, the capability of simul-
taneous signal/image ltering (denoising, deblurring, enhancement, etc.) as it was
demonstrated in Figure 8.15 on the example of image rotation and rescaling us-
ing RotScDFT. There are also some specic application areas, such as magnetic
resonance imaging and digital holography where data are already given in Fourier
domain and where using above described algorithms is only natural and straight-
forward. A good example is numerical reconstruction of digitally recorded holo-
grams in which practically all reconstruction algorithms are using FFT and it is
very frequently necessary to maintain special image scaling conditions (see Chap-
ter 3).
8.5. Local (elastic) image resampling: sliding window
discrete sinc-interpolation algorithms
It frequently happens in signal and image resampling tasks that require arbitrary
dierent signal sample shifts for dierent samples. A typical example is image
resampling for stabilization of images observed through turbulent atmosphere,
which causes chaotic positioning of image samples with respect to their regular
equidistant positions [17]. In such cases, above-described discrete sinc-interpo-
lation algorithms have no ecient computational implementation. However, in
these applications they can be implemented in sliding window (see [68]).
380 Discrete sinc-interpolation
Window 11 Window 15
Window 15
Window 11
Ideal LP-lter
1
0 0.2 0.4 0.6 0.8 1
Normalized frequency
Figure 8.24. Windowed discrete sinc-functions for windows of 11 and 15 samples (top) and the cor-
responding interpolator frequency responses along with that of the ideal lowpass lter (bottom) for
signal 3x-zooming.
In signal interpolation in sliding window, only those shifted and interpolated
signal samples that correspond to the window central sample have to be com-
puted in each window position from signal samples within the window. Inter-
polation function in this case is a discrete sinc-function whose extent is equal
to the window size rather that to the whole signal size required for the perfect
discrete sinc-interpolation. Therefore, sliding window discrete sinc-interpolation
cannot provide the perfect interpolation, which above-described global discrete
sinc-interpolation does. Figure 8.24 illustrates frequency responses and PSF of the
corresponding interpolating lowpass lters of two dierent window sizes for sig-
nal 3x-zooming. As one can see from the gure, interpolation lter frequency
responses deviate from a rectangular function, a frequency response of the ideal
lowpass lter.
Such an implementation of the discrete sinc-interpolation can be regarded
as a special case of direct signal domain convolution interpolation methods. As it
follows from the above theory, it, in principle, has the highest interpolation ac-
curacy among all convolution interpolation methods with the same window size.
Additionally, it oers valuable options that are not available with other methods,
specically:
(i) signal resampling with arbitrary shifts and simultaneous signal restora-
tion and enhancement and
(ii) local adaptive interpolation with superresolution.
For signal resampling with simultaneous restoration/enhancement, the slid-
ing window discrete sinc-interpolation should be combined with local adaptive
ltering. Local adaptive lters, in each position k of the window of W samples
(usually an odd number), compute transform coecients {
r
= T{a
n
}}of the sig-
nal {a
n
} in the window(n, r = 1, 2, . . . , W) and nonlinearly modify themto obtain
L. Yaroslavsky 381
DCT in
sliding
window
Spectrum
modication
for p-shift
Spectrum
modication
for
restoration/
enhancement
Inverse
DCT for
the
window
central pixel
Input signal
Output signal
Figure 8.25. Flow diagram of signal resampling combined with denoising/enhancement.
(a) (b)
Figure 8.26. An example of image denoising and resampling from irregular to regular sampling grid:
(a) noisy image sampled in an irregular sampling grid; (b) denoised and resampled (rectied) image.
coecients {
r
(
r
)}. These coecients are then used to generate an estimate a
k
of
the window central pixel by inverse transform T
1
k
{} computed for the window
central pixel as
a
k
= T
1
k
_

r
_

r
__
, (8.63)
such a ltering can be implemented in the domain of any transform though the
DCT has proved to be one of the most ecient (see Chapter 5). Therefore, one
can, in a straightforward way, combine the sliding window DCT domain discrete
sinc-interpolation signal resampling (8.20) and ltering for signal restoration and
enhancement:
_
a
p
k
_
= ISDFT
1/2,0
_

DCT
r
_

DCT
r
_

r
(p)
_
. (8.64)
Figure 8.25 shows ow diagram of such a combined algorithm for signal restora-
tion/enhancement and fractional p-shift.
Figure 8.26 illustrates application of the combined ltering/interpolation for
image irregular to regular resampling combined with denoising. In this example,
left image is distorted by known displacements of pixels with respect to regu-
lar equidistant positions and by an additive noise. In the right image, these dis-
placements are compensated and noise is substantially reduced with the above-
described sliding window resampling/denoising algorithm.
382 Discrete sinc-interpolation
Sliding
window
DCT
Discrete DCT-based
sinc-interpolator
Local spectrum
analyzer
Mixer
Input signal
Output
signal
Nearest neighbor
interpolator
Figure 8.27. Flow diagram of local adaptive resampling.
One can further extend the applicability of this method to make interpola-
tion kernel transform coecients {
r
(p)} in (8.64) to be adaptive to signal local
features that exhibit themselves in signal local DCT spectra:
_
a
p
k
_
= ISDFT
1/2,0
_

DCT
r
_

DCT
r
_

r
_
p,
_

DCT
r
___
. (8.65)
The adaptivity may be desired in such applications as, for instance, resampling
images that contain gray tone images in a mixture with graphical data. While the
discrete sinc-interpolation is completely perfect for gray tone images, it may pro-
duce undesirable oscillating artifacts in graphics.
The principle of local adaptive interpolation is schematically presented on
Figure 8.27. It assumes that modication of signal local DCT spectra for signal re-
sampling and restoration in the above-described algorithm is supplemented with
the spectrum analysis for generating a control signal. This signal is used to se-
lect, in each sliding window position and depending on the window content, the
discrete sinc-interpolation or another interpolation method such as, for instance,
nearest neighbor one.
Figure 8.28 illustrates nonadaptive and adaptive sliding window sinc-inter-
polation on an example of a shift, by an interval equal 17.54 of discretization in-
tervals, of a test signal composed of a sinusoidal wave and rectangular impulses.
As one can see from the gure, nonadaptive sinc-interpolated resampling of such
a signal results in oscillations at the edges of rectangular impulses. Adaptive re-
sampling implemented in this example switches between the sinc-interpolation
and the nearest neighbor interpolation whenever energy of high-frequency com-
ponents of signal local spectrum exceeds a certain threshold level. As a result, rect-
angular impulses are resampled with superresolution. Figure 8.29 illustrates, for
comparison, zooming a test signal by means of the nearest neighbor, linear, and
bicubic spline interpolations and the above-described adaptive sliding window
DCT sinc-interpolation. One can see from these gures that interpolation artifacts
seen in other interpolation methods are absent when the adaptive sliding widow
interpolation is used.
Nonadaptive and adaptive sliding window sinc-interpolation are also illus-
trated and compared in Figure 8.30 for rotation of an image that contains gray
tone and graphic components. One can clearly see oscillations at sharp boundaries
L. Yaroslavsky 383
1
0
1
50 100 150 200 250
Initial signal
1
0
1
50 100 150 200 250
Signal shifted 16.54 pixels: nonadaptive
1
0
1
50 100 150 200 250
Signal shifted 16.54 pixels: adaptive; threshold= 0.03
Figure 8.28. Fractional shift of a signal (upper plot) by nonadaptive (middle plot) and adaptive (bot-
tom plot) sliding window DCT sinc-interpolations. One can notice disappearance of oscillations at the
edges of rectangular impulses when interpolation is adaptive.
of black and white squares in the result of rotation without adaptation. Adaptive
sinc-interpolation does not show these artifacts because of switching between the
sinc-interpolation and the nearest neighbor interpolation at the sharp boundaries.
Algorithmic implementation of sliding window DFT and DCT discrete sinc-
interpolation methods is based on recursive algorithms for computing the DFT
and DCT in sliding window described in Appendix E. Consider rst computa-
tional complexity of sliding window DFT 1D discrete sinc-interpolation. Let N
w
be the size of the sliding window. From the symmetry consideration, N
w
should
be an odd number. As it is shown in Appendix E, (E.3), signal spectrum
{k}
r
,
r = 0, 1, . . . , N
w
1, in kth position of the sliding window is computed from spec-
trum
{k1}
r
in the previous window position as

(k)
0
=
(k1)
0
+ a
k1+(N
w
+1)/2
a
k1(N
w
1)/2
,

(k)
r
=
_

(k1)
r
+ a
k1+(N
w
+1)/2
a
k1(N
w
1)/2
_
exp
_
i2
r
N
w
_
.
(8.66)
384 Discrete sinc-interpolation
(a) (b)
(c) (d)
(e) (f)
Figure 8.29. Signal zooming with nonadaptive and adaptive discrete sinc-interpolation. First row: a
model of a continuous signal (a) and its sampled version (b). Second row: initial signal reconstructed
by nearest neighbor (c) and linear (d) interpolation. Third row: signal reconstruction using nonadap-
tive (e) and adaptive (f) discrete sinc-interpolation. One can see that smooth sinusoidal signal and
rectangular impulses are reconstructed with much less artifacts when adaptive interpolation is used.
It is convenient to compute signal local DC component
{k}
0
separately from
other spectral coecients as it is shown in (8.66). As for the other coecients, only
rst (N
w
1)/2 have to be computed, as, for real valued signals, the rest (N
w
1)/2
of the coecients are complex conjugate to them. These computations require
(N
w
1)/2 multiplications of complex numbers and (N
w
1)/2 additions plus 2
additions for computing
{k}
0
which amounts to total 2(N
w
1) of real number
multiplications and 3(N
w
+ 1)/2 additions.
L. Yaroslavsky 385
(a) (b)
(c)
Figure 8.30. Rotation of an image (a) with sliding window nonadaptive (b) and adaptive DCT sinc-
interpolations (c).
For signal p-shift, these coecients have to be, according to (8.20), multiplied
by exp(i2pr/N) which yields modied coecients `
(k)
r
,
`
(k)
r
=
_

(k1)
r
+ a
k1+(N
w
+1)/2
a
k1(N
w
1)/2
_
exp
_
i2
1 p
N
w
r
_
, (8.67)
that are to be used for reconstruction of the window central sample with index
(N
w
+ 1)/2 by the inverse DFT as
` a
k
=
1
N
N
w
1
_
r1
`
(k)
r
exp
_
i2
N
w
+ 1
2N
w
r
_
=
1
N
_
(N
w
1)/2
_
r1
`
(k)
r
exp
_
i
N
w
+ 1
N
w
r
_
+
N
w
1
_
r(N
w
+1)/2
`
(k)
r
exp
_
i
N
w
+ 1
N
w
r
_
_
386 Discrete sinc-interpolation
=
1
N
_
(N
w
1)/2
_
r1
`
(k)
r
(1)
r
exp
_
i
r
N
w
_
+
(N
w
1)/2
_
r1
`
(k)
N
w
1
(1)
Nr
exp
_
i
N
w
r
N
w
_
_
=
1
N
_
(N
w
1)/2
_
r1
`
(k)
r
(1)
r
exp
_
i
r
N
w
_
+
(N
w
1)/2
_
r1
_
`
(k)
r
_

(1)
r
exp
_
i
r
N
w
_
_
=
2
N
(N
w
1)/2
_
r1
(1)
r
Re
_
`
(k)
r
exp
_
i
r
N
w
_
_
.
(8.68)
The reconstruction, therefore, requires additional 2 (N
w
1)/2 = (N
w
1) real
multiplications and (N
w
1)/2 additions plus one addition for adding local dc
component plus one multiplication by 1/N. Table 8.1 provides summary of com-
putational complexity of sliding window DFT signal resampling.
Computational complexity of the sliding window DCT sinc-interpolation can
be evaluated using data provided in Appendix E and taking into account that, for
sliding window processing, only window central sample is evaluated and signal dc
component is not modied. Therefore, reconstruction formula given by (8.29) is
transformed into
a
(p)
(N
w
1)/2
=
N
w
1
_
n=0
a
n
sincd
_
K; N;
N
w
1
2
n p
_
= ISDFT
1/2,0
_
DCT
_
a
k
_

r
(p)
__
=
1

2N
_

DCT
0
+ 2
N
w
1
_
r=1

DCT
r

re
r
cos
_

2
r
_
2
N
w
1
_
r=1

DCT
r

im
r
sin
_

2
r
_
_
=
1

2N
_

DCT
0
+ 2
(N
w
1)/2
_
r=1
(1)
r

DCT
2r

re
2r
2
(N
w
1)/2
_
r=1
(1)
r1

DCT
2r1

im
2r1
_
.
(8.69)
According to this formula, only terms {
re
2r
} and {
im
2r1
} of spectrum modication
coecients have to be computed, and the reconstruction process requires 2(N
w

1)/2 = N
w
1 multiplications and 2[(N
w
1)/2 1] + 1 = N
w
1 additions.
Total computational complexity of DCT sliding window signal resampling can be
evaluated from data presented in Table 8.2.
L. Yaroslavsky 387
Table 8.1. Number of operations per output sample for sliding window DFT signal discrete sinc in-
terpolation resampling in the window of N
w
samples.
Additions Multiplications
Additional operations
when look-up-table is
not available
Computation of local spectra 3(N
w
+ 1)/2 2(N
w
1) (N
w
1)
Spectrum modication (N
w
1)/2 (N
w
1) (N
w
1)
Reconstruction (N
w
+ 1)/2 (N
w
1) (N
w
1)
Total 5(N
w
+ 1)/2 2(N
w
1) 3(N
w
1)
Table 8.2. Computational complexity per output sample for sliding window DCT signal resampling.
Multiplications Additions
Additional operations
when look-up-table is
not available
Computation of local spectra 2(N
w
1) 5N
w
3 2(N
w
1)
Spectrum modication N
w
1
Reconstruction N
w
1
Total 3(N
w
1) 6N
w
4 2(N
w
1)
8.6. Conclusion
In this chapter, we described a family of fast transform-based methods and corre-
sponding ecient computational algorithms for discrete sinc-interpolation in dig-
ital signal and image processing and showed that they provide, for a nite number
of signal samples, virtually error-free interpolation and, therefore, they outper-
form, in this respect, other known convolutional interpolation methods such as
spline ones and alike that implement digital convolution in signal domain rather
than in Fourier/DCT transform domain. We demonstrated how methods of dis-
crete sinc-interpolation can be used in dierent applications and provided nu-
merical estimations and experimental data that evidence that described discrete
sinc-inerpolation methods are quite competitive, in terms of their computational
complexity, with other methods. In addition, we described sliding windowdiscrete
sinc-interpolation methods for signal and image resampling in arbitrary nonuni-
form sampling grid. Being comparable, in their interpolation accuracy and com-
putational complexity, with other convolutional methods for the same window
size, they oer options of adaptive interpolation and simultaneous signal/image
space-variant restoration not available with other methods.
Computational eciency of the interpolation error-free discrete sinc-inter-
polation algorithms is rooted in the use of fast Fourier and fast DCT transforms.
Perhaps, the best concluding remark of this discussion of the discrete sinc-inter-
polation methods and their applications would be mentioning that fast Fourier
388 Discrete sinc-interpolation
transform algorithm was invented two hundred years ago by Carl Friedrich Gauss
exactly for the purpose of facilitating numerical interpolation of sampled data of
astronomical observation (see [19, 20]).
Appendices
A. Complex conjugate symmetry for SDFT of real sequences
Let {
r
} be SDFT(u, 0) of a real sequence {h
n
= h

n
}:
h
n
=
1

N
N1
_
r=0

r
exp
_
i2
(n + u)r
N
_
. (A.1)
Then,
h

n
=
1

N
N1
_
r=0

r
exp
_
i2
(n + u)r
N
_
=
1

N
N1
_
r=0

Nr
exp
_
i2
(n + u)(N r)
N
_
=
1

N
N1
_
r=0

Nr
exp(i2u) exp
_
i2
(n + u)r
N
_
.
(A.2)
Therefore, for real sequences {h
n
= h

n
}, the following SDFT(u, 0) complex con-
jugate symmetry rule holds:

r
=

Nr
exp(i2u). (A.3)
In particular, when u = (N 1)/2,

r
=

Nr
exp
_
i(N 1)
_
=
_

Nr
, N-odd number,

Nr
, N-even number.
(A.4)
B. Point spread functions of optimal resampling lters
By denition (8.15) and with an account for (8.17), point spread function of the
optimal resampling lter h
(intp)
n
(` x) is SDFT((N1)/2, 0) of samples {
(intp)
r,opt
(` x)}
L. Yaroslavsky 389
of its continuous frequency response. From (8.20), for odd number of signal sam-
ples N, we have
h
(intp)
n
(` x) =
1

N
N1
_
r=0

(intp)
r,opt
(` x) exp
_
i2
n (N 1)/2
N
r
_
=
1

N
_
(N1)/2
_
r=0

(intp)
r,opt
exp
_
i2
n (N 1)/2
N
r
_
+
N1
_
r=(N+1)/2

(intp)
r,opt
exp
_
i2
n (N 1)/2
N
r
_
_
=
1

N
_
(N1)/2
_
r=0

(intp)
r,opt
exp
_
i2
n (N 1)/2
N
r
_
+
(N1)/2
_
r=1

(intp)
Nr,opt
exp
_
i2
n (N 1)/2
N
(N r)
_
_
=
1

N
_
(N1)/2
_
r=0

(intp)
r,opt
exp
_
i2
n (N 1)/2
N
r
_
+
(N1)/2
_
r=1

(intp)
Nr,opt
exp
_
i(N 1)
_
exp
_
i2
n (N 1)/2
N
r
_
_
=
1

N
_
(N1)/2
_
r=0

(intp)
r,opt
exp
_
i2
n (N 1)/2
N
r
_
+
(N1)/2
_
r=1

(intp)
r,opt
exp
_
i(N 1)
_
exp
_
i2
n (N 1)/2
N
r
_
_
=
1
N
_
(N1)/2
_
r=0
exp
_
i2
` x
Nx
_
exp
_
i2
n (N 1)/2
N
r
_
+
(N1)/2
_
r=1
exp
_
i2
` x
Nx
_
exp
_
i2
n (N 1)/2
N
r
_
_
=
1
N
_
(N1)/2
_
r=0
exp
_
i2
n (N 1)/2 ` xx
N
r
_
+
(N1)/2
_
r=1
exp
_
i2
n (N 1)/2 ` x/x
N
r
_
_
. (A.1)
390 Discrete sinc-interpolation
Denote temporarily
` n = n
N 1
2

` x
x
. (A.2)
Then,
h
(intp)
n
(` x) =
1
N
_
exp
_
i(` n/N)(N + 1)
_
1
exp
_
i2(` n/N)
_
1
+
exp
_
i(` n/N)(N + 1)
_
exp
_
i2(` n/N)
_
exp
_
i2(` n/N)
_
1
_
=
1
N
_
exp(i` n) exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
+
exp(i` n) exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
_
=
1
N
exp(i` n) + exp
_
i(` n/N)
_
+ exp(i` n) exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
=
1
N
sin(` n)
sin
_
(` n/N)
_
= sincd
_
N,
_
n
N 1
2

` x
x
__
. (A.3)
From (8.21), for even number of signal samples N, we have
h
(intp)
n
(` x) =
1

N
N1
_
r=0

(intp)
r,opt
(` x) exp
_
i2
n (N 1)/2
N
r
_
=
1

N
_
N/21
_
r=0

(intp)
r,opt
exp
_
i2
n (N 1)/2
N
r
_
+
N1
_
r=N/2

(intp)
r,opt
exp
_
i2
n (N 1)/2
N
r
_
_
=
N1
_
r=N/2

(intp)
r,opt
exp
_
i2
n (N 1)/2
N
r
_
=
1

N
_
N/21
_
r=0

(intp)
r,opt
exp
_
i2
n (N 1)/2
N
r
_
+
N/2
_
r=1

(intp)
Nr,opt
exp
_
i2
n (N 1)/2
N
(N r)
_
_
L. Yaroslavsky 391
=
1

N
_
N/21
_
r=0

(intp)
r,opt
exp
_
i2
n (N 1)/2
N
r
_
+
N/2
_
r=1

(intp)
Nr,opt
exp
_
i(N 1)
_
exp
_
i2
n (N 1)/2
N
r
_
_
=
1

N
_
(N1)/2
_
r=0

(intp)
r,opt
exp
_
i2
n (N 1)/2
N
r
_
+
N/2
_
r=1
_

(intp)
r,opt
_
exp
_
i(N 1)
_
exp
_
i2
n (N 1)/2
N
r
_
_
=
1
N
_
N/21
_
r=0
exp
_
i2
` x
Nx
_
exp
_
i2
n (N 1)/2
N
r
_
+
N/21
_
r=1
exp
_
i2
` x
Nx
_
exp
_
i2
n (N 1)/2
N
r
_
+
(intp)
N/2,opt
exp
_
iN
n (N 1)/2
N
_
_
=
1
N
_
N/21
_
r=0
exp
_
i2
n (N 1)/2 ` x/x
N
r
_
+
N/21
_
r=1
exp
_
i2
n (N 1)/2 ` x/x
N
r
_
+
(intp)
N/2,opt
exp
_
iN
n (N 1)/2
N
_
_
=
1
N
_
N/21
_
r=0
exp
_
i2
` n
N
r
_
+
(N1)/2
_
r=1
exp
_
i2
` n
N
r
_
+
(intp)
N/2,opt
exp
_
i
` x
x
_
exp
_
iN
n (N 1)/2 ` x/x
N
_
_
=
1
N
_
exp(i` n) 1
exp
_
i2(` n/N)
_
1
+
exp(i` n) exp
_
i2(` n/N)r
_
exp
_
i2(` n/N)
_
1
+
(intp)
N/2,opt
exp
_
i
` x
x
_
exp(i` n)
_
392 Discrete sinc-interpolation
=
1
N
_
exp
_
i
_
(N 1)/N
_
` n
_
exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
+
exp
_
i
_
(N 1)/N
_
` n
_
exp
_
i(` n/N)r
_
exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
+
(intp)
N/2,opt
exp
_
i
` x
x
_
exp(i` n
_
_
=
1
N
_
exp
_
i
_
(N 1)/N
_
` n
_
exp
_
i(` n/N)r
_
exp
_
i(` n/N)
_
exp
_
i(` n/N)
_

exp
_
i
_
(N 1)/N
_
` n
_
+ exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
+
(intp)
N/2,opt
exp
_
i
` x
x
_
exp(i` n)
_
=
1
N
_
exp
_
i
_
(N 1)/N
_
` n
_
exp
_
i
_
(N 1)/N
_
` n
_
exp
_
i(` n/N)
_
exp
_
i(` n/N)
_
+
N/2
exp
_
i
` x
x
_
exp(i` n)
_
=
1
N
_
sin
_

_
(N 1)/N
_
` n
_
sin
_
(` n/N)
_
+
(intp)
N/2,opt
exp
_
i
` x
x
_
exp(i` n
_
_
.
(A.4)
Case 0:

(intp)
N/2,opt
= 0, h
(intp0)
n
(` x) = sincd
_
N; N 1;
_
n
N 1
2

` x
x
__
. (A.5)
Case 2:

(intp)
N/2,opt
= i2 sin
_

` x
x
_
,
h
(intp0)
n
(` x) = sincd
_
N; N + 1;
_
n
N + 1
2

` x
x
__
,
(A.6)
where
sincd{N; M; x} =
1
N
sin(Mx/N)
sin(x/N)
. (A.7)
L. Yaroslavsky 393
Proof of Case 2. Find
(intp2)
N/2,opt
that satisfy the condition
sin
_

_
(N 1)N
_
` n
_
sin
_
(` n/N)
_
+
(intp2)
N/2,opt
exp
_
i
` x
x
_
exp(i` n) =
sin
_

_
(N + 1)/N
_
` n
_
sin
_
(` n/N)
_
.
(A.8)
From (A.8),

(intp)
N/2,opt
=
sin
_

_
(N+1)/N
_
` n
_
sin
_

_
(N1)/N
_
` n
_
sin
_
(` n/N)
_
exp(i` n) exp
_
i
` x
x
_
= 2 cos(` n) exp(i` n) exp
_
i
` x
x
_
= 2 cos(` n) exp
_
i
_
n
N 1
2
__
= 2 cos
_

_
n
N 1
2

` x
x
__
exp
_
i
_
n
N 1
2
__
= 2 cos
_

_
n
N
2
+
1
2

` x
x
__
exp
_
i
_
n
N
2
+
1
2
__
= i2 cos
_

_
n
N
2
_
+
_
1
2

` x
x
__
cos
_

_
n
N
2
__
= i2 cos
_
n +
_
1
2

` x
x
__
cos(n),
(A.9)
where n = n N/2 is an integer number. Therefore,

(intp2)
N/2,opt
= i2 cos
_
n +
_
1
2

` x
x
__
(1)
n
= i2 cos(n) cos
_

_
1
2

` x
x
__
(1)
n
= i2 cos
_

_
1
2

` x
x
__
(1)
2n
= i2 sin
_

` x
x
_
.
(A.10)
C. PSF of signal zooming by means of zero-padding of its DCT spectrum
Consider analytical expressions that describe signal zooming by means of zero-
padding its DCT spectrum. Let
DCT
r
be DCT spectrum of signal {a
k
},

DCT
r
=
2

N
N1
_
k=0
a
k
cos
_

(k + 1/2)r
N
_
=
1

2N
2N1
_
k=0
` a
k
exp
_
i2
(k + 1/2)r
2N
_
,
(C.1)
394 Discrete sinc-interpolation
where k = 0, . . . , N 1 and
` a
k
=
_
_
_
a
k
, k = 0, . . . , N 1,
a
2N1k
, k = N, . . . , LN 1.
(C.2)
Form a zero pad spectrum,
`
DCT,L
r
=
_
_
_

DCT
r
, r = 0, . . . , N 1,
0, r = N, . . . , LN 1.
(C.3)
Being a spectrum of DCT, this spectrum has an odd-symmetry property
`
DCT,L
r
= `
DCT,L
2LNr
; `
DCT,L
LN
= 0. (C.4)
Compute inverse DCT of the zero pad spectrum, using representation of DCT
through SDFT(1/2, 0) and its symmetry property (C.4):
`
`
k
=
1

2LN
2LN1
_
r=0
`
DCT,L
r
exp
_
i2
(k + 1/2)
2LN
r
_
=
1

2LN
_
N1
_
r=0

DCT
r
exp
_
i2
(k + 1/2)
2LN
r
_
+
2LN1
_
r=2LNN+1
`
DCT
r
exp
_
i2
(k + 1/2)
2LN
r
_
_
=
1

2LN
_
N1
_
r=0

DCT
r
exp
_
i2
(k + 1/2)
2LN
r
_
+
N1
_
r=1
`
DCT
2LNr
exp
_
i2
(k + 1/2)
2LN
(2LN r)
_
_
=
1

2LN
_

DCT
0
+
N1
_
r=1

DCT
r
exp
_
i2
(k + 1/2)
2LN
r
_

N1
_
r=1

DCT
r
exp
_
i2
(k + 1/2)
2LN
(2LN r)
_
_
=
1

2LN
_

DCT
0
+
N1
_
r=0

DCT
r
exp
_
i2
(k + 1/2)
2LN
r
_
+
N1
_
r=0

DCT
r
exp
_
i2
(k + 1/2)
2LN
r
_
_
. (C.5)
L. Yaroslavsky 395
Replace in this formula
DCT
r
with its expressions through SDFT(1/2, 0) in the
right part of (C.1) and obtain
`
` a
k
=
1

2LN
_

DCT
0
+
N1
_
r=1
1

2N
2N1
_
n=0
` a
n
exp
_
i2
(n + 1/2)r
2N
_
exp
_
i2
(k + 1/2)
2LN
r
_
+
N1
_
r=1
1

2N
2N1
_
n=0
` a
n
exp
_
i2
(n + 1/2)r
2N
_
exp
_
i2
(k + 1/2)
2LN
r
_
_
=

DCT
r

2LN
+
1

2LN
N1
_
r=1
1

2N
2N1
_
n=0
` a
n
_
exp
_
i
_
n + 1/2 (k + 1/2)/L
_
r
N
_
+ exp
_
i
_
n + 1/2 + (k + 1/2)/L
_
r
N
_
_
.
(C.6)
Denote, for brevity, ` n = n + 1/2 and
`
k = k + 1/2. Then, obtain
`
` a
k
=

DCT
r

2LN
+
1

2LN
N1
_
r=1
1

2N

2N1
_
n=0
` a
n
_
exp
_
i
_
` n
`
k/L
_
r
N
_
+ exp
_
i
_
` n +
`
k/L
_
r
N
__
=

DCT
r

2LN
+
1

2LN

N1
_
r=1
1

2N
_
N1
_
n=0
` a
n
_
exp
_
i
_
` n
`
k/L
_
r
N
_
+ exp
_
i
_
` n +
`
k/L
_
r
N
__
+
2N1
_
n=N
` a
n
_
exp
_
i
_
` n
`
k/L
_
r
N
_
+ exp
_
i
_
` n +
`
k/L
_
r
N
___
=

DCT
r

2LN
+
1

2LN

N1
_
r=1
1

2N
_
N1
_
n=0
` a
n
_
exp
_
i
_
` n
`
k/L
_
r
N
_
+ exp
_
i
_
` n +
`
k/L
_
r
N
__
+
N1
_
n=0
` a
2N1n
_
exp
_
i
_
2N ` n
`
k/L
_
r
N
_
+ exp
_
i
_
2N ` n +
`
k/L
_
r
N
__
_
396 Discrete sinc-interpolation
=

DCT
r

2LN
+
1

2LN

N1
_
r=1
1

2N
_
N1
_
n=0
a
n
_
exp
_
i
_
` n
`
k/L
_
r
N
_
+ exp
_
i
_
` n +
`
k/L
_
r
N
__
+
N1
_
n=0
` a
2N1n
_
exp
_

i
_
` n +
`
k/L
_
r
N
_
+ exp
_

i
_
` n
`
k/L
_
r
N
__
_
=

DCT
r

2LN
+
1
2N

L
N1
_
n=0
a
n
_
N1
_
r=1
exp
_
i
_
` n
`
k/L
_
r
N
_
+
N1
_
r=1
exp
_
i
_
` n +
`
k/L
_
r
N
_

N1
_
r=1
exp
_

i
_
` n +
`
k/L
_
r
N
_
+
N1
_
r=1
exp
_

i
_
` n
`
k/L
_
r
N
_
_
=
N1
_
r=1
exp
_

i
_
` n +
`
k/L
_
r
N
_
+
N1
_
r=1
exp
_

i
_
` n
`
k/L
_
r
N
_
=

DCT
r

2LN
+
1
2N

N1
_
n=0
a
n
_
exp
_
i(` nL
`
k)/L
_
exp
_
i(` nL
`
k)/LN
_
exp
_
i(` nL
`
k)/LN
_
1
+
exp
_
(` nL +
`
k)/L
_
exp
_
i(` nL +
`
k)/LN
_
exp
_
(` nL +
`
k)/LN
_
1
+
exp
_
(` nL +
`
k)/L
_
exp
_
(` nL +
`
k)/LN
_
exp
_
(` nL +
`
k)/LN
_
1
+
exp
_
i(` nL
`
k)/L
_
exp
_
i(` nL
`
k)/LN
_
exp
_
i(` nL
`
k)/LN
_
1
_
L. Yaroslavsky 397
=

DCT
0

2LN
+
1
2N

L
N1
_
n=0
a
n
_
sin
_

_
(N + 1)/2NL
_
(` nL
`
k)
_
sin
_
(` nL
`
k)/2NL
_
exp
_
i(` nL
`
k)
2L
_
+
sin
_

_
(N+1)/2NL
_
(` nL+
`
k)
_
sin
_
(` nL+
`
k)/2NL
_
exp
_
i(` nL+
`
k)
2L
_
+
sin
_

_
(N+1)/2NL
_
(` nL+
`
k)
_
sin
_
(` nL+
`
k)/2NL
_
exp
_

i(` nL+
`
k)
2L
_
+
sin
_

_
(N+1)/2NL
_
(` nL
`
k)
_
sin
_
(` nL
`
k)/2NL
_
exp
_

i(` nL
`
k)
2L
_
_
.
(C.7)
From this, we nally obtain
`
` a
k
=

DCT
0

2LN
+
1
N

L
N1
_
n=0
a
n
_
sin
_

_
(N+1)/2NL
_
(` nL
`
k)
_
sin
_
(` nL
`
k)/2NL
_
cos
_
(` nL
`
k)
2L
_
+
sin
_

_
(N+1)/2NL
_
(` nL +
`
k)
_
sin
_
(` nL+
`
k)/2NL
_
cos
_
(` nL +
`
k)
2L
_
_
.
(C.8)
By analogy with DFT zero-padding, one can improve convergence of DCT
zero-padding PSF by halving DCT spectral coecients that correspond to the
highest frequency. For signals of N samples, these are coecients with indices N2
and N 1. To nd an analytical expression for this case, we rst compute, using
(C.7) and (C.8), L-zoomed signal for the case when those coecients are zeroed:
`
` a
k
=

DCT
r

2LN
+
1
2N

N1
_
n=0
a
n
_
N3
_
r=1
exp
_
i
_
` n
`
k/L
_
r
N
_
+
N3
_
r=1
exp
_
i
_
` n +
`
k/L
_
r
N
_
+
N3
_
r=1
exp
_

i
_
` n +
`
k/L
_
r
N
_
+
N3
_
r=1
exp
_

i
_
` n
`
k/L
_
r
N
_
_
=

DCT
0

2LN
+
1
N

N1
_
n=0
a
n
_
sin
_

_
(N 1)/2N
_
(` n
`
k/L)
_
sin
_
(` n
`
k/L)/2N
_
cos
_
(N 2)/N
_
` n
`
k/L
_
2
_
+
sin
_

_
(N 1)/2N
_
(` n +
`
k/L)
_
sin
_
(` n +
`
k/L)/2N
_
cos
_
(N 2)/N
_
` n +
`
k/L
_
2
_
_
.
(C.9)
398 Discrete sinc-interpolation
PSF Walsh; L = 8
(a)
PSF Haar; L = 8
(b)
Figure D.1. Point spread functions of signal 8x-zooming by means of zero-padding its Walsh spec-
trum (a) and Haar spectrum (b) for ve dierent positions of the signal impulse.
Then L-zoomed signal obtained by zero-padding signal DCT spectrum and halv-
ing its highest frequency components is dened by the equation
`
` a
k
=

DCT
0

2LN
+
1
N

L
N1
_
n=0
a
n
_
sin
_

_
(N+1)/2NL
_
(` nL
`
k)
_
sin
_
(` nL
`
k)/2NL
_
cos
_
(` nL
`
k)
2L
_
+
sin
_

_
(N+1)/2NL
_
(` nL+
`
k)
_
sin
_
(` nL+
`
k)/2NL
_
cos
_
(` nL +
`
k)
2L
_
+
sin
_

_
(N1)/2NL
_
(` nL
`
k)
_
sin
_
(` nL
`
k)/2NL
_
cos
_

N2
2NL
(` nL
`
k)
_
+
sin
_

_
(N1)/2NL
_
(` nL+
`
k)
_
sin
_
(` nL+
`
k)/2NL
_
cos
_

N2
2NL
(` nL+
`
k)
_
_
.
(C.10)
D. Signal zooming by means of zero-padding their Walsh
and wavelet transforms
In this appendix, we consider point spread functions of signal zooming by means
of zero-padding of their spectra in Walsh, Haar, and wavelet transform domain.
Obviously, point spread functions of zero-padding in transform domain depend
L. Yaroslavsky 399
(a) Binom-9 (b) Qmf-9
(c) Binom-13 (d) Qmf-13
Figure D.2. Point spread functions of signal zooming by means of zero-padding its wavelet spectra
(bold circles) compared with those for DFT zero-padding (dots).
on transform basis functions. For transforms with binary or ternary basis func-
tions, such as Walsh transform and Haar transform, one cannot expect anything
but a rectangular point spread function which describes the nearest neighbor in-
terpolation. Experiments conrm this guess (see Figure D.1). Curiously enough,
zero-padding Walsh and Haar spectra turn out to be quasi-shift invariant inter-
polation processes, which is of course not the case for general signal ltering by
modication of their Walsh and Haar spectra.
Wavelet transforms are good practical candidates for image zooming by zero-
padding its transform when zooming is required for images presented in a com-
pressed formsuch as in JPEG2000 image compression standard. Point spread func-
tions of such a zooming are determined by the type of wavelets used. Figure D.2 il-
lustrates point spread functions for 4 types of wavelets: Binom-9, Binom-13, Qmf-
9, and Qmf-13, and compares them with discrete sinc-function sincd(1, N, x).
E. Sliding windowDFT and DCT/DcST recursive algorithms
Let us consider DFT of two adjacent (k1)th and kth fragments {a
k1x((N
w
1)/2)
,
. . . , a
k1+x(N
w
/2)
} and {a
kx((N
w
1)/2)
, . . . , a
k+x(N
w
/2)
} of a signal {a
k
} in sliding
400 Discrete sinc-interpolation
window of N
w
samples

(k1)
r
=
N
w
1
_
n=0
a
k1x((N
w
1)/2)+n
exp
_
i2
nr
N
w
_
,

(k)
r
=
N
w
1
_
n=0
a
kx((N
w
1)/2)+n
exp
_
i2
nr
N
w
_
,
(E.1)
where x(x) is integer part of x and normalization factor 1/

N is neglected. Spec-
trum{
(k)
r
} in kth position of the sliding window can be computed from spectrum
{
(k1)
r
} in (k 1)th window position in the following way:

(k)
r
=
N
w
1
_
n=0
a
kx((N
w
1)/2)+n
exp
_
i2
nr
N
w
_
=
N
w
_
n=1
a
k1x((N
w
1)/2)+n
exp
_
i2
(n 1)r
N
w
_
=
_
N
w
1
_
n=0
a
k1x((N
w
1)/2)+n
exp
_
i2
nr
N
w
_
+
_
a
k1x((N
w
1)/2)+N
w
a
k1x((N
w
1)/2)
_
_
exp
_
i2
r
N
w
_
=
_

(k1)
r
+ a
k1x((N
w
1)/2)+N
w
a
k1x((N
w
1)/2)
_
exp
_
i2
r
N
w
_
.
(E.2)
Equation (E.2) describes the recursive algorithm for computing DFT signal spec-
trum in sliding window of N
w
samples. For signals whose samples are real num-
bers, only rst (N
w
+ 1)/2 coecients have to be computed. The rest (N
w
1)/2
can be found from the symmetry property
r
=

Nr
of DFT of real numbers.
Therefore, (N
w
1)/2 multiplications of complex numbers and (N
w
+ 1)/2 addi-
tions plus 2 additions are required for computing {
{k}
r
} which amounts to total
3(N
w
+ 1)/2 additions and 2(N
w
1) of real number multiplications provided
{sin(2(r/N
w
))} and {cos(2(r/N
w
))} coecients are taken from a look-up table,
which practically always can be done. Otherwise, additional (N
w
1) operations
for computing sine-cosine coecients are required.
When sliding window DFT algorithms are used for local adaptive ltering
and resampling as described in Chapter 5, inverse DFT is required for computing
window central pixel. Using the above-mentioned symmetry property of DFT of
L. Yaroslavsky 401
real numbers, one can show that required inverse can be computed as
` a
k
=
N
w
1
_
r1
`
(k)
r
exp
_
i2
N
w
+1
2N
w
r
_
=
_
(N
w
1)/2
_
r1
`
(k)
r
exp
_
i
N
w
+1
N
w
r
_
+
N
w
1
_
r(N
w
+1)/2
`
(k)
r
exp
_
i
N
w
+1
N
w
r
_
_
=
_
(N
w
1)/2
_
r1
`
(k)
r
(1)
r
exp
_
i
r
N
w
_
+
(N
w
1)/2
_
r1
`
(k)
N
w
1
(1)
Nr
exp
_
i
N
w
r
N
w
_
_
=
_
(N
w
1)/2
_
r1
`
(k)
r
(1)
r
exp
_
i
r
N
w
_
+
(N
w
1)/2
_
r1
_
`
(k)
r
_

(1)
r
exp
_
i
r
N
w
_
_
= 2
(N
w
1)/2
_
r1
(1)
r
Re
_
`
(k)
r
exp
_
i
r
N
w
__
.
(E.3a)
The reconstruction, therefore, requires additional (N
w
+ 1)/2 additions and
2 (N
w
1)/2 = (N
w
1) real multiplications provided {sin((r/N
w
))} and
{cos((r/N
w
))} coecients are taken from a look-up table.
In order to evaluate total computational complexity of the ltering in DFTdo-
main in sliding window such as described in Chapter 5, additional (N
w
1)/2 op-
erations on complex numbers are required for modication of the window spec-
tral coecients according to the ltering. For signal p-shift resampling, discussed
in Section 8.2.3, the spectrum modication is multiplying spectral coecients by
exp(i2pr/N
w
) that can be included in the inverse transform
2
N
(N
w
1)/2
_
r1
(1)
r
Re
_
`
(k)
r
exp
_
i
1 + 2p
N
w
r
__
. (E.3b)
However, in this case, keeping coecients {sin(((1+2p)/N
w
)r)} and {cos(((1+
2p)/N
w
)r)} is not always possible if the required shift is dierent for dierent win-
dow position. The results of evaluation of the computational complexity are sum-
marized in Table E.1 separately for general local adaptive ltering and or signal
p-shift.
The DCT and DcST in a running window can be computed in a similar way.
For adjacent (k 1)th and kth signal fragments, their DCT and DcST spectra
{
(k1)
r
} and {
(k)
r
} are, correspondingly, real and imaginary parts of auxiliary
spectra
`
(k1)
r
=
1
_
N
w
N1
_
n=0
a
k1x((N
w
1)/2)+n
exp
_
i
(n + 1/2)r
N
w
_
,
`
(k)
r
=
1
_
N
w
N1
_
n=0
a
kx((N
w
1)/2)+n
exp
_
i
(n + 1/2)r
N
w
_
.
(E.4)
402 Discrete sinc-interpolation
Table E.1. Number of operations per output sample for sliding window DFT ltering in the window
of N
w
samples.
Additions Multiplications
Additional operations
when look-up-table is
not available
Computation of local spectra 3(N
w
+ 1)/2 2(N
w
1) (N
w
1)
Reconstruction (N
w
+ 1)/2 (N
w
1) (N
w
1)
Spectrum
modication
Filtering (N
w
1)/2 complex number operations
p-shift (N
w
1)/2 (N
w
1) (N
w
1)
Total
Filtering Additional (N
w
1)/2 complex number operations
p-shift 5(N
w
+ 1)/2 2(N
w
1) (N
w
1)
Spectrum{`
(k)
r
} can be represented through spectrum{`
(k1)
r
} as follows:
`
(k)
r
= `
(k1)
r
exp
_
i
r
N
w
_
+
_
(1)
r
a
k1x((N
w
1)/2)+N
w
a
k1x((N
w
1)/2)
_
exp
_
i
r
2N
w
_
.
(E.5)
Recursive computations according to (E.5) require 4(N
w
1) multiplication
and 6N
w
3 addition operations for both DCT and DcST transform in sliding
window of Nsamples.
Extension of these algorithms to the recursive computation of 2D DFT, DCT,
and DcST is straightforward owing to the separability of the transforms.
As one can see, in the recursive algorithm for computing DCT and DcST in
sliding window described by (E.5), DCT and DcST are inseparable:

(k) DCT
r
= Real
_
`
(k)
r
_
=
(k1) DCT
r
C
1
+
(k1) DST
r
S
1
+ a
k
C
2
, (E.6)

(k) DcST
r
= Imag
_
`
(k)
r
_
=
(k1) DcST
r
C
1

(k1) DCT
r
S
1
a
k
S
2
, (E.7)
where
C
1
= cos
_

r
N
w
_
, C
2
= cos
_

r
2N
w
_
,
S
1
= sin
_

r
N
w
_
, S
2
= sin
_

r
2N
w
_
,
a
(k)
r
= (1)
r
a
k1x((N
w
1)/2)+N
w
a
k1x((N
w
1)/2)
.
(E.8)
Many applications require computing only the DCT in sliding window. In
these cases, computations of both DCT and DcST according to (E.5) are redun-
dant. This redundancy associated with the need to compute the DcST for recursive
L. Yaroslavsky 403
computing the DCT can be eliminated in an algorithm that uses DCT spectrum
found on two previous windowpositions (see [18]). To derive this algorithm, com-
pute DFTs A
DCT
s
and A
DcST
s
of {
(k) DCT
r
} and {
(k) DcST
r
}, respectively, over index k
assuming that the number of signal samples is N
k
. According to the shift theorem
of the DFT, obtain, for A
DCT
s
and A
DcST
s
from (E.6) and (E.7),
A
DCT
s
= A
DCT
s
C
1
Z + A
DcST
s
S
1
Z + A
s
C
2
, (E.9)
A
DcST
s
= A
DcST
s
C
1
Z A
DCT
s
S
1
Z A
s
S
2
, (E.10)
where s is index in the DFT domain, A
s
is DFT of a
(k)
r
, and Z = exp(i2(s/
N
k
))the spectral shift factor that corresponds to signal shift one sample back.
Express, using (E.7), A
DcST
s
through A
DCT
s
and substitute it into (E.9) and (E.10).
Then, obtain
A
DCT
s
_
1 C
1
Z
_
2
= A
DCT
s
S
2
1
Z
2
+ A
s
S
2
S
1
Z + A
s
C
2
_
1 C
1
Z
_
, (E.11)
from which it follows that
A
DCT
s
= 2C
1
A
DCT
s
Z
_
C
2
1
+ S
2
1
_
A
DCT
s
Z
2

_
C
2
C
1
S
2
S
1
_
A
s
Z + C
2
A
s
,
(E.12)
or, as C
2
1
+ S
2
1
= 1 and C
2
C
1
S
2
S
1
= C
2
,
A
DCT
s
= 2C
1
A
DCT
s
Z A
DCT
s
Z
2
+ C
2
_
A
s
A
s
Z
_
. (E.13)
Finally, taking inverse DFT of both parts of (E.13) and using the fact that spectral
multiplicands Z and Z
2
correspond to signal shifts one and two samples back,
respectively, obtain for the sliding window DCT that

(k) DCT
r
= 2
(k1) DCT
r
cos
_

r
N
w
_

(k2) DCT
r
+
_
a
(k)
r
a
(k1)
r
_
cos
_

r
2N
w
_
.
(E.14)
Similar recursive relationship can be derived for the sliding window DcST:

(k) DcST
r
= 2
(k1) DcST
r
cos
_

r
N
w
_

(k2) DcST
r

_
a
(k)
r
+ a
(k1)
r
_
sin
_

r
2N
w
_
.
(E.15)
Computations according to (E.14) and (E.15) require only 2(N
w
1) multiplica-
tion and 5(N
w
1) + 2 addition operations per output signal sample provided
local dc (
(k) DCT
0
,
(k) DcST
0
) coecients are computed separately with recursive al-
gorithm that requires 2 additions per sample and sine and cosine coecients are
404 Discrete sinc-interpolation
Table E.2. Computational complexity per output sample for sliding window DCT/DcST processing.
Multiplications Additions
Additional operations
when look-up-table is
not available
Computation
of local spectra
DCT&DcST 4(N
w
1) 6N
w
3 2(N
w
1)
DCT
Filtering N
w
1 5(N
w
1)/2 + 2 N
w
1
p-shift 2(N
w
1) 5N
w
3 2(N
w
1)
Spectrum
modication
Filtering N
w
1
p-shift N
w
1
Reconstruction
Filtering (N
w
1)/2 + 1
p-shift N
w
1
Total
Filtering
p-shift 3(N
w
1) 6N
w
4
taken from a look-up-table. Note that, when local DCT coecients are used for
local adaptive ltering, only coecients with even indices are used. Therefore,
in this case only (N
w
1) multiplications and 5(N
w
1)/2 + 2 additions are re-
quired. Table E.2 summarizes above estimates of the computational complexity of
DCT/DcST domain processing in sliding window.
Bibliography
[1] A. Gotchev, Spline and Wavelet Based Techniques for Signal and Image Processing, this volume,
Chapter 8.
[2] Ph. Th evenaz, EPFL/STI/IOA/LIB, Bldg. BM-Ecublens 4.137, Station 17 , CH-1015 Lausanne VD,
Switzerland, (private communication), http://bigwww.ep.ch/thevenaz/.
[3] A. Gotchev, Spline and wavelet based techniques for signal and image processing, Doctoral
thesis, Tampere University of Technology, Tampere, Finland, 2003, publication 429.
[4] M. Unser, Ph. Th evenaz, and L. Yaroslavsky, Convolution-based interpolation for fast, high-
quality rotation of images, IEEE Transactions on Image Processing, vol. 4, no. 10, pp. 13711381,
1995.
[5] L. Yaroslavsky and Y. Chernobrodov, DFT and DCT based discrete sinc-interpolation methods
for direct Fourier tomographic reconstruction, in Proceedings of the 3rd International Symposium
on Image and Signal Processing and Analysis (ISPA03), vol. 1, pp. 405410, Rome, Italy, September
2003.
[6] L. Yaroslavsky, Digital Holography and Digital Image Processing, Kluwer Academic, Boston, Mass,
USA, 2004.
[7] L. Yaroslavsky, Fast signal sinc-interpolation methods for signal and image resampling, in Image
Processing: Algorithms and Systems, vol. 4667 of Proceedings of SPIE, pp. 120129, San Jose, Calif,
USA, January 2002.
[8] L. Yaroslavsky, Boundary eect free and adaptive discrete signal sinc-interpolation algorithms
for signal and image resampling, Applied Optics, vol. 42, no. 20, pp. 41664175, 2003.
[9] L. Yaroslavsky, Shifted discrete Fourier transforms, in Digital Signal Processing, V. Cappellini
and A. G. Constantinides, Eds., pp. 6974, Academic Press, London, UK, 1980.
[10] X. Deng, B. Bihari, J. Gan, F. Zhao, and R. T. Chen, Fast algorithm for chirp transforms with
zooming-in ability and its applications, Journal of the Optical Society of America A, vol. 17, no. 4,
pp. 762771, 2000.
L. Yaroslavsky 405
[11] R. Tong and R. W. Cox, Rotation of NMR images using the 2D chirp-z transform, Magnetic
Resonance in Medicine, vol. 41, no. 2, pp. 253256, 1999.
[12] W. H. Press, B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling, Numerical Recipes. The Art of
Scientic Computing, Cambridge University Press, Cambridge, Mass, USA, 1987.
[13] J. H. Mathew and K. D. Fink, Numerical Methods Using MATLAB, Prentice-Hall, Englewood
Clis, NJ, USA, 1999.
[14] C. Elster and I. Weing artner, High-accuracy reconstruction of a function f(x) when only
df (x)/dx or d
2
f (x)/dx
2
is known at discrete measurement points, in X-Ray Mirrors, Crystals,
and Multilayers II, vol. 4782 of Proceedings of SPIE, pp. 1220, Seattle, Wash, USA, July 2002.
[15] L. Yaroslavsky, A. Moreno, and J. Campos, Frequency responses and resolving power of numer-
ical integration of sampled data, Optics Express, vol. 13, no. 8, pp. 28922905, 2005.
[16] Y. Katiyi and L. Yaroslavsky, Regular matrix methods for synthesis of fast transforms: general
pruned and integer-to-integer transforms, in Proceedings of International Workshop on Spectral
Methods and Multirate Signal Processing (SMMSP 01), T. Saram aki, K. Egiazarian, and J. Astola,
Eds., Pula, Croatia, June 2001, TICSP Series#13, ISSN 1456-2774, ISBN 952-15-0633-4L.
[17] S. Gepstein, A. Shtainman, B. Fishbain, and L. Yaroslavsky, Restoration of atmospheric turbulent
video containing real motion using rank ltering and elastic image registration, in Proceedings of
the 12th European Signal Processing Conference (EUSIPCO 04), Vienna, Austria, September 2004.
[18] J. Xi and J. F. Chicharo, Computing running DCTs and DSTs based on their second-order shift
properties, IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications,
vol. 47, no. 5, pp. 779783, 2000.
[19] C. F. Gauss, Nachlass: theoria interpolationis methodo nova tractata, in Werke, vol. 3, pp. 265
330, K onigliche Gesellschaft der Wissenschaften, G ottingen, Germany, 1866.
[20] M. T. Heideman, D. H. Johnson, and C. S. Burrus, Gauss and the history of the fast Fourier
transform, IEEE ASSP Magazine, vol. 1, no. 4, pp. 1421, 1984.
L. Yaroslavsky: Department of Interdisciplinary Studies, Faculty of Engineering,
Tel Aviv University, Tel Aviv 69978, Israel
Email: [email protected]

You might also like