Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL I, NO 3 , SEPTEMBER 1988 213

On the Comparison of Interpolation Methods


EINAR MAELAND, MEMBER, IEEE

Abstract-A study of different cubic interpolation kernels in the fre- A comparison of different interpolation methods was
quency domain reveals some new aspects of both cubic spline and cubic given in [6], but it was constantly declared that the kernel
convolution interpolation. The kernel used in cubic convolution is of used in cubic spline interpolation is of finite support and
finite support, and depends upon a parameter to he chosen at will. At
the Nyquist frequency, the spectrum attains a value which is indepen-
strictly positive. This is only a qualified truth, since it can
dent of this parameter. Exactly the same value is found at the Nyquist easily be demonstrated that the cubic spline kernel oscil-
frequency in the cubic spline interpolation. If a strictly positive inter- lates in the same way as the Cardinal spline kernel. If we
polation kernel is of importance in applications, the cubic convolution are looking for a cubic spline of finite support, we end up
with the parameter value zero is recommended. with the cubic B-spline. The true fact of the case is that
the cubic spline interpolation does not utilize the sampled
I. INTRODUCTION data explicitly together with the cubic B-spline, but only
along with a certain (periodic) filter. The spectrum of this
S AMPLING and interpolation (reconstruction) of sig-
nals are important processes in signal theory, and
comes up time and again in many applications. The inter-
filter multiplied with the spectrum of the cubic B-spline
produces the interpolation kernel. The value of the spec-
polated data are most often taken to be a linear combi- trum at the Nyquist frequency happens to be exactly the
nation of the input data and a certain interpolation kernel. same as in the cubic convolution. By a direct comparison
Looking at the spectrum of the input data, the spectrum of the spectra of cubic spline and cubic convolution in-
is periodic as a consequence of the finite and constant terpolation, we find that cubic spline is superior to cubic
sampling rate, but only spectral values on the Nyquist in- convolution. The contrary conclusion was presented in
terval should be used in the interpolation. Interpolation is [6], but this was based upon a comparison of the cubic B-
then in reality a question of how to construct a low-pass spline with the cubic convolution, which is not appropri-
filter so as to eliminate or reduce the high-frequency com- ate. Moreover, since the kernel in cubic convolution is of
ponents of the periodic and, in general, aliased spectrum finite support, it will be more efficient than cubic spline
of the input data. Ideally, the low-pass filter should have interpolation.
a cutoff at the Nyquist frequency, but this can only be There are many practical situations where a strictly pos-
achieved by using the Cardinal spline interpolation. In or- itive (cubic) interpolation kernel is of importance, for ex-
der to make a comparison of the quality of different low- ample, image processing where the image or intensity
pass filters, it should be quite natural to do this compari- necessarily must be positive, or acoustical tomography
son in the frequency domain. where the velocity of sound must be strictly positive. As
The cubic spline interpolation has been described in [ 11- a byproduct of the present analysis, if a strictly positive
[3], while the cubic convolution interpolation has been kernel is of importance in applications, we recommend
described in [4] and [5]. In the latter case, the interpola- that one should take advantage of the particular simple
tion kernel is (by definition) of finite support, and the ker- form of cubic convolution interpolation when making the
nel depends upon a parameter to be placed at our disposal. parameter equal to zero. An improvement over the well-
It was shown in [4] that if the value of the free parameter known linear interpolation can then be obtained with some
is set equal to - 1/ 2 , this value causes the cubic convo- extra computational efforts.
lution interpolation to fit a second-order polynomial ex- 11. CUBICCONVOLUTION
actly. On the other hand, if we agree that interpolation is
L e t f ( k A t ) , k = 0, f l , k2, * . , be samples of the
a low-pass filtering, then our final goal should be a filter
function f ( t ) , where At is the constant sampling rate.
which is as flat as possible in the pass-band. If we comply
The cubic convolution interpolation is then given by the
with this demand, the free parameter in the cubic convo-
(finite) convolution sum
lution interpolation should also take the value -1/2.
Moreover, a closer analysis of the spectrum reveals that g ( t ) = C f ( k A t ) u ( t - kAt) (1)
its value at the Nyquist frequency attains a value which is
where the interpolation kernel u ( t ) is given by [4]
independent of this parameter. Thus, analyzing the spec-
trum of the interpolation kernel reveals a new quality of = (A + 2 ) l s 1 3 - ( A + 3)ls12 + 1,
cubic convolution interpolation.
0 I I s ( I 1,

Manuscript received January 28, 1988; revised May 17, 1988.


= ~ ( 1 -451sI2
~ + 814 - 4),
The author is with the Seismological Observatory, University of Ber- 1 I Is1 I2 ,
gen, Bergen, Norway.
IEEE Log Number 8822552. u ( t ) = 0, 2 I I s 1 I 03. (2)
0278-0062/88/0900-0213$01.OO 0 1988 IEEE
214 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. I , NO. 3, SEPTEMBER 1988

The free parameter is denoted by A , while s = t / A t is a 4 -0


normalized coordinate. The kernel is (by definition) of fi-
nite support, and also symmetric about t = 0. It is easy
to show that U ( t ) is continuous and has a continuous first -6
derivative for all t . The second derivative is in general not
continuous at the point s = 1, but can be made continuous 0.4
by choosing A = - 3 / 4 . There remains, however, the
point s = 2 , where the second derivative is not continuous Om'
(unless A = 0 ) . From the definition of U ( t ) we have that .o
~ ( 0 =) 1 , while U ( + k A t ) = 0 f o r k > 0, hence, we
obtain g ( k A t ) = f ( k A t ) . -0.2
In order to compare the quality of the cubic interpola-
I I
tion for different values of the parameter A , the best way -0.4
-2. -1 0 i 2
to do this is to compute the spectrum' and then Fig. 1. Cubic convolutions kernel for two different values of the parame-
make the comparison. If we denote the spectra by capital ter, A = - 1 / 2 and A = -3/4, respectively.
letters, we obtain from (1)
G ( w ) = U ( w ) F ( w ) = U ( w ) C f ( k A t ) exp ( - & A t )
'
(3) 4.0- A = - i/2
where w is the angular frequency. The sum in ( 3 ) is the _A_ _=_ _-_ _ _3_/_4-
discrete Fourier transform of the sequencef ( k A t ) , which 0.8 - Q)
J
inevitably becomes periodic (and, in general, aliased), due 0

to the finite sampling rate A t . The period is equal to 0.6 -


L
2 a / A t . In order to remove the periodic nature of the
spectrum F ( U ) , the spectrum U ( U ) should be a low-pass 0.4 - f
filter with a cutoff at the Nyquist frequency ( , / A t ) . The _J

calculation of the spectrum U ( w ) is straightforward, and 0.2 -


Frequency [ Hz 1
the result is given here by
0 . 0 -r
U(o)= (4At) * { 6 ( 1 - C , ) + 3A(1 - C2) 0 .o 0.2 0.4 0.6 0.8 i 3
Fig. 2. Comparison of the spectra of the cubic convolution for two differ-
- w A t [ ( 4 A + 3)SI + AS2]) * (wAt)-' (4) ent values of the parameter A .

where we use the notation C1 = cos ( w A t ) , S1 = sin


( o a t ) ,C2 = cos ( 2 w A t ) , and S2 = sin ( 2 w A t ) . One of in the frequency range 0-1, that is, in units of l / A t .
the most striking (and new) results is that the value of When A = - 3 / 4 , the kernel has a continuous first deriv-
U ( w ) at the Nyquist frequency attains the constant value ative at + A t , but by a comparison of the spectra, the
U ( n / A t ) = ( 4 8 / a 4 )A t (0.492 7 6 7 ) * At (5) penalty for this is an overshoot in the pass-band as well
as in the stop-band.
which is independent of the parameter A . The value of the
spectrum at w = 0 is equal to U ( 0 ) = A t , so that the 111. CUBICSPLINE
ratio is approximately equal to - 6 dB. Another important The cubic spline interpolation is given by a convolution
result can be obtained if we examine the behavior of the sum according to [ l ]
spectrum U ( U ) close to the zero frequency ( w = 0). The
first three terms of the Taylor series expansion of U(w) h ( t ) = C ckb(t - k A t ) (7)
are given by where ck are coefficients to be determined. The function
b ( t )is the cubic B-spline or Parzen window, given by
+
U(w) = A t . [ l - ( 1 2 A ) ( w A t T / 1 5
(1 + +
16A)(wAtf/560]. (6)
b ( t ) = [31sI3 - 61sI2 4 ] / 4 , +
0 5 I s 1 I 1,
b ( t ) = [ 2 - 1s1I3/4, 1 I Is1 5 2 ,
Then, looking for a low-pass filter which is as flat as pos-
sible in the pass-band, we should choose A = - 1 / 2 . b ( t ) = 0, 2 I Is1 I00
Before closing this section, let us display some of our
results. It is natural to compare the kernels when A = (8)
- 3 / 4 and A = - 1 / 2 , respectively. In Fig. 1 the two where s = t / A t is the normalized coordinate. The cubic
interpolation kernels, or impulse responses, are shown as B-spline is symmetric about t = 0, is continuous, and has
a function of t (time), where we now deliberately have continuous first- and second-order derivatives. Moreover,
set the constant sampling rate equal to A t = 1. In Fig. 2 the cubic B-spline is of finite support (by definition). In
the spectra are shown as a function of the linear frequency order to determine the coefficients ck, we claim that
MAELAND: COMPARISON OF INTERPOLATION METHODS 215

h ( k A r ) = f ( k A f ) . From the definition of b ( t ) we have


that b ( t ) is strictly nonnegative with b ( 0 ) = 1, b ( + A t )
= 1 /4, while b ( + k a t ) = 0 for k > 1. The coefficients
ck must then satisfy the equations
0.6

k = 0, +1, + 2 , * - * . (9)
0.4 /
0.2
Since the coefficients ck # f ( k A t ) , it will lead to er-
roneous conclusions if we now make a direct comparison 0 .0
of the spectrum B ( U), the cubic B-spline, with the spec-
trum U ( w ) given in the last section. The simplest way to
solve the (infinite) system of equations (9), is by means
of the Z-transform. In doing so, we deliberately neglect -2 . -4 0 4 2
any end effects or boundary conditions. The result is Fig. 3. Comparison of the kernels of cubic spline and cubic convolution
with parameter value A = - 1 /2.
(Z + 4 + z-')c(z) = 4F(Z). (10)
The coefficients ck can be found by a Laurent series ex- as given by ( 5 ) , viz. ( 4 8 / r 4 ) A t . Although this is a very
pansion of the complex function C ( Z ). If we denote the nice and interesting result, we emphasize that we have not
zeros of the second-order polynomial Z 2 4 2 1 by a + + taken account of any boundary conditions. The actual
and 6 , respectively, we obtain a = -2 h and p = + choice of boundary conditions will of course modify this
1 / a . It is appropriate to emphasize that a < 0 and I a I result, but the very details will not be examined in the
< 1. Looking for the impulse response, we simply put present paper.
F ( Z ) = 1, and obtain the function Let us now make a comparison of the two interpolation
methods, viz. cubic spline and cubic convolution, the lat-
C ( Z ) = 4CYZ/(Z - a ) ( a Z - 1). (11) ter with the parameter value A = - 1/2. In Fig. 3 we
This function is regular in the annulus I a I < I Z I < display the two interpolation kernels, but only on the part
I a I-', hence, it can be represented by a Laurent series of the t-axis where U ( t ) is not identically equal to zero.
expansion. The very last step is to identify the coefficients Of more interest is the spectrum, and this is shown in Fig.
of the Laurent series with the coefficients ck. The algebra 4(a) (linear scale), and in Fig. 4(b) (decibel scale). Dif-
is straightforward, and the result is given here by ferent parts of the frequency axis have been displayed,
since if we are interested in the details on the pass-band,
c-k = C+k = ( Y k C g , CO = 2 / h , k = 1, 2, . . . . we prefer a display on a linear scale, but if we are inter-
(12) ested in the details on the stop-band, we prefer a decibel
scale. Although the values at the Nyquist frequency are
This result is important, since it shows that the cubic
equal, the steepness in the transition zone are not the
spline kernel is not of finite support. Because of a < 0
same. In the cubic convolution interpolation, the steep-
we have ck = ( - 1 ) 1 a I kc". The sequence ck thus oscil-
ness is controlled by the free parameter A , but since there
lates, in spite of any other assertion. If this sequence is
are no free parameters in the cubic spline interpolation,
convolved with the cubic B-spline, according to (7), we
the steepness is fixed. By inspection of the spectra, we
obtain the cubic interpolation kernel. This kernel oscil-
conclude that the cubic spline interpolation is superior to
lates much in the same way as the Cardinal spline kernel.
the cubic convolution.
Any assertion that the cubic spline is strictly positive and
of finite support is thus only but a qualified truth, cf. [6]. IV. LINEARINTERPOLATION
The spectrum of the cubic B-spline or the Parzen win-
As a byproduct of our analysis, it should be easy and
dow is given by ( 3 A t / 2 ) * sinc4 ( w A t / 2 ) . The spectrum
also of great interest to compare linear interpolation to
of the (infinite) sequence ck is given by (10) if we simply
cubic convolution interpolation. The linear interpolation
substitute Z = exp ( - iwA t ). If we once more put F ( Z )
has a finite support equal to 2 A t , and is given by
= 1, the result is
0 I I S 1 I 1,
C ( w ) = 4/[4 + 2 cos ( w A t ) ] .
(13)
q(t) = 1 - (SI,
The spectrum C ( w ) is of course periodic with period q ( t ) = 0, 1 I Is1 5 03 (14)
27r/At. Now, we come to the conclusion: the spectrum while the spectrum is given by Q ( w ) = A t sinc2
of the cubic spline interpolation kernel is not the spectrum ( w A t / 2 ) . It follows from (2) that the support of u ( t )
of the cubic B-spline or the Parzen window, but the prod- when A = 0 also is equal to 2 A t . A direct comparison to
uct of B ( w ) and C ( w ). Hence, it makes no sense to per- the linear interpolation is now very appropriate, since the
form a direct comparison between B ( w ) and U ( w ) . Fi- two interpolation kernels have the same finite support. In
nally, let us compute the value of the product of B ( w ) Fig. 5 we compare the two interpolation kernels or im-
and C ( w ) at the Nyquist frequency. The result is the same pulse response. The spectra are given in Fig. 6(a) (linear
216 IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. 7 , NO. 3. SEPTEMBER 1988

---_ - 1 .0

0.8
-L-i-n_e_a_r _ i_n_t_e _r _ _ _ _
C u b i c convoC

0.6

0.4

Frequency Hz I t 0.2
Frequency ( Hz I
0 .0 0 .0
0 .0 0.2 0.4 0.6 0.8 1 .0 0 ..o 0.2 0.4 0.6 0.8 1 .o
(a)

01 -\ I

-20 1 \I\,

0 1 2 3 4 5
(b) (b)
Fig. 4. (a) Comparison of the spectra of cubic spline and cubic convolu- Fig. 6. (a) Comparison of the spectra of linear interpolation and cubic con-
tion in the frequency range 0-1 Hz. (b) Same as (a) but on a decibel volution in the frequency range 0-1 Hz. (b) Same as (a) but on a decibel
scale and in the frequency range 0-5 Hz. scale and in the frequency range 0-5 Hz.

t .0 V. CONCLUSION
0.8 Often the interpolation is taken to be a linear combi-
nation of the input data and a given interpolation kernel.
0.6 In order to analyze the quality of the interpolation method,
we study the very details of the (Fourier) spectrum, and
0.4
the quality can then easily be attained. Since interpolation
0.2 in reality is a problem of how to construct a low-pass fil-
ter, we study the details on the pass-band as well as the
0 .0 stop-band. A comparison of the spectra of cubic interpo-
lation kernels reveals that cubic spline is superior to cubic

-0.4 4
Lcnear--enter-
I
C u b i c convoC
I
t convolution interpolation. The spectra attains, however,
exactly the same values at the Nyquist frequency. The
-2 -1 0 1 2 value is equal to (48/7r4) A t , while the value at zero fre-
Fig. 5. Comparison of linear interpolation and cubic convolution with the quency is A t . Hence, the ratio is approximately equal to
parameter value A = 0. -6 dB. The cubic convolution is, by definition, of finite
support, and this very fact implies that this method is more
scale) and in Fig. 6(b) (decibel scale). By a direct inspec- efficient than the method of cubic spline interpolation. The
tion of the two spectra, especially in the stop-band, we cubic convolution requires only a straightforward (finite)
conclude that we can attain a much better quality of in- convolution sum; no solutions of linear systems of equa-
terpolation (over the simple linear interpolation) by tions are required.
choosing the cubic convolution kernel with the parameter The main conclusion is, however, that the cubic B-
value A = 0. Thus, if a strictly positive kernel is of im- spline should not be termed impulse response, and no (di-
portance in applications, the cubic convolution with A = rect) comparison of the cubic B-spline with other inter-
0 is recommended. polation kernels should be done.
MAELAND: COMPARISON OF INTERPOLATION METHODS 217

REFERENCES [4] R. G . Keys, “Cubic convolution interpolation for digital image pro-
cessing,” IEEE Trans. Acousr., Speech, Signal Processing, vol. ASSP-
[ I ] H. S . Hou and H. C . Andrews, “Cubic splines for image interpolation 29, pp. 1153-1160, 1981.
and digital filtering,” IEEE Trans. Acoust., Speech, Signal Process- [SI S. K. Park and R. A. Schowengerdt, “Image reconstruction by para-
ing, vol. ASSP-26, pp. SOS-517, 1978. metric cubic convolution,” Comp. Vision, Graphics and Image Pro-
121 R. Hummel, “Sampling for spline reconstruction,” SIAM J . Appl. cessing, vol. 23, pp. 258-272, 1983.
Math., vol. 43, pp. 278-288, 1983. 161 J . A. Parker, R. V . Kenyon, and D. E. Troxel, “Comparison of in-
[3] Chin-Hwa Lee, “Restoring spline interpolation of CT images,” IEEE terpolating methods for image resampling,” IEEE Trans. Med. Imag-
Trans. Med. Imaging, vol. MI-2, pp. 142-149, 1983. ing, vol. MI-2, pp. 31-39, 1983.

You might also like