Boundary effect free and adaptive discrete signal sinc ...

10
Boundary effect free and adaptive discrete signal sinc-interpolation algorithms for signal and image resampling L. Yaroslavsky The problem of digital signal and image resampling with discrete sinc interpolation is addressed. Discrete sinc interpolation is theoretically the best one among the digital convolution-based signal resampling methods because it does not distort the signal as defined by its samples and is completely reversible. However, sinc interpolation is frequently not considered in applications because it suffers from boundary effects, tends to produce signal oscillations at the image edges, and has relatively high computational complexity when irregular signal resampling is required. A solution that enables the elimination of these limitations of the discrete sinc interpolation is suggested. Two flexible and com- putationally efficient algorithms for boundary effects free and adaptive discrete sinc interpolation are presented: frame-wise global sinc interpolation in the discrete cosine transform DCT domain and local adaptive sinc interpolation in the DCT domain of a sliding window. The latter offers options not available with other interpolation methods: interpolation with simultaneous signal restorationen- hancement and adaptive interpolation with super resolution. © 2003 Optical Society of America OCIS codes: 100.0100, 100.200, 110.6980. 1. Introduction Signal and image resampling is required in many signal and image processing applications. It is a key issue in audio signal spectral analysis and fractional delay, signal and image differentiating and integrat- ing, image geometrical transformations and rescal- ing, target location and tracking with subpixel accuracy, Radon transform and tomographic recon- struction, and three-dimensional 3-D image volume rendering and volumetric imaging. Signalimage resampling procedes with the assumption that one or another method of interpolation between available signalimage samples is employed. By virtue of the sampling theorem, sinc interpolation is the best in- terpolation of continuous signals. Given samples a k of a continuous signal a x, the sinc-interpolated approximation a x to this signal is defined as a x a k sinc x k x x , (1) where sinc x sin xx and x is the signal discreti- zation interval. If an unlimited number of samples obtained as a k 1 x a x sinc x k x d x, (2) is available, sinc interpolation restores the continu- ous signal with the least mean squared error. For band-limited signals with a spectrum bandwidth 12x, sinc interpolation provides an exact restora- tion of signals from their samples. In other words, signal sampling in accordance with Eq. 2 is in this case completely reversible. However, exact sinc in- terpolation cannot be implemented in reality because it requires an unlimited number of signal samples and an interpolation function with infinite support. In digital signal processing with a finite number of available signal samples a discrete analog of the con- tinuous sinc interpolation is a discrete sinc interpo- lation a x k0 N1 a k sincd N; N; x x k , (3) where sincd N; N; x sinx N sinxN (4) The author is with the Faculty of Engineering, Interdisciplinary Studies Department, Tel Aviv University, Tel Aviv 69978, Israel. E-mail address for L. Yaroslavsky is [email protected]. Received 8 April 2003. 0003-693503204166-10$15.000 © 2003 Optical Society of America 4166 APPLIED OPTICS Vol. 42, No. 20 10 July 2003

Transcript of Boundary effect free and adaptive discrete signal sinc ...

Page 1: Boundary effect free and adaptive discrete signal sinc ...

Boundary effect free and adaptive discrete signalsinc-interpolation algorithms for signal andimage resampling

L. Yaroslavsky

The problem of digital signal and image resampling with discrete sinc interpolation is addressed.Discrete sinc interpolation is theoretically the best one among the digital convolution-based signalresampling methods because it does not distort the signal as defined by its samples and is completelyreversible. However, sinc interpolation is frequently not considered in applications because it suffersfrom boundary effects, tends to produce signal oscillations at the image edges, and has relatively highcomputational complexity when irregular signal resampling is required. A solution that enables theelimination of these limitations of the discrete sinc interpolation is suggested. Two flexible and com-putationally efficient algorithms for boundary effects free and adaptive discrete sinc interpolation arepresented: frame-wise �global� sinc interpolation in the discrete cosine transform �DCT� domain andlocal adaptive sinc interpolation in the DCT domain of a sliding window. The latter offers options notavailable with other interpolation methods: interpolation with simultaneous signal restoration�en-hancement and adaptive interpolation with super resolution. © 2003 Optical Society of America

OCIS codes: 100.0100, 100.200, 110.6980.

1. Introduction

Signal and image resampling is required in manysignal and image processing applications. It is a keyissue in audio signal spectral analysis and fractionaldelay, signal and image differentiating and integrat-ing, image geometrical transformations and rescal-ing, target location and tracking with subpixelaccuracy, Radon transform and tomographic recon-struction, and three-dimensional �3-D� image volumerendering and volumetric imaging. Signal�imageresampling procedes with the assumption that one oranother method of interpolation between availablesignal�image samples is employed. By virtue of thesampling theorem, sinc interpolation is the best in-terpolation of continuous signals. Given samples�ak� of a continuous signal a�x�, the sinc-interpolatedapproximation a� �x� to this signal is defined as

a� � x� � ���

ak sinc� x � k�x���x�, (1)

The author is with the Faculty of Engineering, InterdisciplinaryStudies Department, Tel Aviv University, Tel Aviv 69978, Israel.E-mail address for L. Yaroslavsky is [email protected].

Received 8 April 2003.0003-6935�03�204166-10$15.00�0© 2003 Optical Society of America

4166 APPLIED OPTICS � Vol. 42, No. 20 � 10 July 2003

where sinc x �sin x��x and �x is the signal discreti-zation interval. If an unlimited number of samplesobtained as

ak �1

�x ���

a� x�sinc� x � k�x��dx, (2)

is available, sinc interpolation restores the continu-ous signal with the least mean squared error. Forband-limited signals with a spectrum bandwidth1�2�x, sinc interpolation provides an exact restora-tion of signals from their samples. In other words,signal sampling in accordance with Eq. �2� is in thiscase completely reversible. However, exact sinc in-terpolation cannot be implemented in reality becauseit requires an unlimited number of signal samplesand an interpolation function with infinite support.

In digital signal processing with a finite number ofavailable signal samples a discrete analog of the con-tinuous sinc interpolation is a discrete sinc interpo-lation

a� � x� � �k 0

N�1

ak sincd�N; N; x��x � k�, (3)

where

sincd�N; N; x� �sin�x�

N sin�x�N�(4)

Page 2: Boundary effect free and adaptive discrete signal sinc ...

is a discrete sinc function. It approximates the con-tinuous sinc function sinc�x� sin x�x for x��x �� N.As will be shown in Section 2, for a given finite num-ber of signal samples, a discrete sinc interpolation isthe only convolution-based fully reversible discretesignal resampling method. This feature defines theattractiveness of the discrete sinc interpolation forsignal�image resampling.

Conventionally, discrete sinc interpolation is im-plemented by means of a signal spectrum zero-padding algorithm.1–3 A more efficient and flexiblediscrete sinc-interpolation algorithm was describedin Ref. 4. However, despite the attractiveness of dis-crete sinc interpolation it is frequently not regardedappropriate in some applications. First, the discretesinc interpolation tends to produce heavy artifacts inthe form of oscillations �ripples� at the signal borders.This property may be especially restrictive in imageprocessing because image dimensions are usually rel-atively small numbers �256–1024�, and noticeableripples from the image left, right, upper, and bottomborders may occupy a substantial part of the image.Second, signal oscillations caused by sinc interpola-tion may also be observed in the vicinity of signal�image sharp edges. These oscillations areabsolutely normal as soon as reversible discrete sincinterpolation is required. However they are fre-quently considered undesirable artifacts that worsenvisual-image quality. In addition, the above avail-able discrete sinc-interpolation methods are not wellsuited to irregular �not equidistant� resampling.Owing to these reasons, discrete sinc interpolation isquite rarely practiced in digital signal and image pro-cessing.

In this paper, we introduce what are to our knowl-edge two new discrete sinc-interpolation algorithmsthat eliminate the above-mentioned drawbacks of thediscrete sinc interpolation and offer additional usefulcapabilities not available with other methods. InSection 3, a computationally efficient and flexible al-gorithm of the discrete sinc interpolation is describedthat is free of oscillation phenomena at signal bor-ders. In differentiation with the known discretesinc-interpolation algorithms, this algorithm com-putes and modifies a discrete cosine transform �DCT�rather than a discrete Fourier transform �DFT� sig-nal spectra. It is referred to as the global DCT do-main discrete sinc-interpolation algorithm. InSection 4 a sliding window signal resampling algo-rithm is introduced that also works in the domain ofthe DCT. The algorithm is a good approximation tothe ideal global discrete sinc interpolation and is ca-pable of simultaneous signal denoising and of a localadaptation of the convolution kernel. The latter fea-ture enables us, in particular, to eliminate, wheneverit is required by application, oscillations at signal�image sharp edges and at the same time to avoidsmoothing the edges. In this way, an increased sig-nal resolution with respect to that defined by thesignal’s initial sampling rate can be obtained.

2. Discrete Sinc Interpolation: Error-FreeInterpolation of Sampled Data

Let a discrete signal of N samples �ak� Fig. 1�a�� beinterpolated to a signal with �L � 1� interpolatedintermediate samples per each initial one. Forconvolution-based interpolation, the interpolationprocess is a digital convolution,

a�k � �k1 0

N�1

�k2 0

L�1

ak1��k2�hint�k � k1 L � k2�,

k � 0, 1, . . . , LN � 1, (5)

with the interpolation kernel �hint�k��, of signal �ak ak1

��k2��, k k1L � k2; k1 0, . . . , N � 1; k2 0, . . . , L � 1; ��x� 0x, obtained from the initialsignal �ak� by placing �L � 1� zeros between its sam-ples as it is illustrated in Fig. 1�b�. Compute theDFT of signal �ak�:

�r �1

�LN �k 0

LN�1

ak exp�i2krLN�

�1

�LN �k1 0

N�1

�k2 0

L�1

ak1��k2�exp�i2

�k1 L � k2�

LNr�

�1

�LN �k1 0

N�1

ak1exp�i2

k1

Nr�

�1

�L��r�mod N, (6)

where ��r� is the DFT of signal �ak�. Equation �6�shows that sampling the discrete signal by placingzeros between its samples results in a periodical rep-lication of its DFT spectrum with the number of rep-licas equal to the number of zeros plus one asillustrated in Figs. 1�c� and 1�d�, respectively. If in-terpolation Eq. �5�� is computed as a cyclic �periodi-cal� convolution, it will correspond, in the DFTdomain, to multiplying the spectrum ��r� with theDFT of the interpolation kernel:

DFT�a� k � � a� r � � 1

�L��r�mod N�DFT�hint�k��. (7)

One can see from this equation that the only way tosecure reversibility of the interpolation and to avoid,in the interpolation, distorting the initial signal spec-trum and introducing into the interpolated signalaliasing spectral components is with signal ideal low-pass filtering, when DFT�hint�k�� is a rectangularfunction of N samples. Such a filtering is graphi-cally illustrated in Fig. 1�e�. Because the interpola-tion kernel should be a real-valued function, complexconjugacy symmetry property a� r a� LN�r* of its DFTspectrum should be observed in zeroing aliasing spec-tral components. One can meet this requirementonly for odd-numbered N, in which case DFT�hint�k��will be:

DFT�hint�k�� � 1 � rectr � �N � 1��2LN � N � 1

, (8)

10 July 2003 � Vol. 42, No. 20 � APPLIED OPTICS 4167

Page 3: Boundary effect free and adaptive discrete signal sinc ...

where

r � 0, 1, . . . , LN � 1; rect� x� � �1, 0 � x � 10, otherwise .

The interpolated signal is then

a�k � IDFT��1 � rectr � �N � 1��2LN � N � 1 � ��r�mod N

�L �

1

�L �n 0

N�1

an1sincdN; N; �k � n1 L��, (9)

where IDFT� is the inverse discrete Fourier trans-form and

sincd�K; N; x� �sin�Kx�N�

N sin�x�N�(10)

is the discrete sinc function. Because no signal spec-trum components are distorted in the convolution,discrete sinc interpolation of signals with an oddnumber of samples described by Eq. �9� is completelyreversible.

For even-numbered N, interpolation described byEq. �9� cannot be implemented since the term with

Fig. 1. Illustration of the discrete sampling theorem: �a� initial signal, �b� initial signal with zeros placed between its samples, �c�spectrum of signal �a�, �d� spectrum of signal �b�: periodical replication of the initial signal spectrum; �e� removing spectrum replicas thatmay cause aliasing by low pass filter; �f � sinc-interpolated signal between samples of signal �b�.

4168 APPLIED OPTICS � Vol. 42, No. 20 � 10 July 2003

Page 4: Boundary effect free and adaptive discrete signal sinc ...

index �N � 1��2 required by Eq. �9� does not exist.Two immediate options in this case are

a� k � IDFT��1 � rectr � N�2LN � N� ��r�mod N

�L �

1

�L �n1 0

N�1

an1sincdN � 1; N; �k � n1 L��; (11)

a� k � IDFT��1 � rectr � N�2 � 1LN � N � 2� ��r�mod N

�L �

1

�L �n1 0

N�1

an1sincd�N � 1; N; �k � n1 L��. (12)

Both interpolation functions sincd�N � 1; N; k� andsincd�N � 1; N; k� converge to zero relatively slowlyand therefore tend to produce severe boundary ef-fects. A practical compromise in the case of even-numbered N is to halve the �N�2�-th spectralcoefficient that corresponds to the following interpo-lation formula:

a� k �1

�L �n1 0

N�1

an1sincd�1; N; �k � n1 L��, (13)

where

sincd��1; N; k� � sincd�N � 1; N; k�

� sincd�N � 1; N; k���2. (14)

It follows from Eqs. �11�–�13� that, for even-numbered N, one cannot avoid distorting the signal.Its highest frequency coefficient with index N�2 iseither zeroed Eq. �11�� or repeated twice Eq. �12�� orhalved Eq. �13�� in the interpolation process.

Direct convolution of signal samples with the dis-crete sinc-interpolation function according to theright-hand sides of Eqs. �9�, �11�–�13� requires O�N�operations per output signal sample or O�N2L� oper-ations for the entire sinc-interpolated output signal ofNL samples. The computational complexity of thediscrete sinc interpolation can be substantially re-duced if the signal convolution is computed in thedomain of the DFT with the use of fast Fourier trans-form �FFT� algorithms. Two methods of such an im-plementation are available. The first method, onewith spectrum zero padding,1–3 literally reproducesmanipulations with the signal DFT spectrum de-scribed by the middle parts of Eqs. �9�, �11�, and �12�.The algorithm computes the signal’s DFT spectrum,pads it with N�L � 1� zeros, and then computes theinverse DFT of the obtained NL spectrum coeffi-cients. Thanks to the use of the FFT for computingthe DFT, the computational complexity of the algo-rithm is O�N log N � NL log NL� operations for theentire output signal of NL samples or O�1 � 1�L�logNL� operations per output signal sample. The sec-ond algorithm is described in Ref. 4. It enables asignal with N samples to generate its discrete sinc-interpolated copy of N samples shifted with respect to

the initial samples by an arbitrary interval. Such ashifted signal �ak

�p�� is obtained as

�akp� � IDFT��r�r� p��, (15)

where ��r�p�� is the DFT of the discrete sinc function:

�r� p� �1

�N �k 0

N�1

sincd�K; N; k � p�exp�i2krN �

(16)

and p is a shift parameter �measured in units of thesignal discretization interval�. One can show that

�r� p� �

1

�Nexp�i2pr�N�; r � 0, 1, . . . , �N � 1��2 � 1

�N�r*; r � �N � 1��2 � 1, . . . , N � 1(17)

for odd-numbered N�K N� and

�r� p� �

1

�Nexp�i2pr�N�; r � 0, 1, . . . , N�2 � 1

1

�Ncos�2pr�N�; r � N�2

�N�r*; r � N�2 � 1, . . . , N � 1(18)

for even-numbered N�K �1�.It follows from Eq. �15� that the algorithm has a

computational complexity of O�2 log N� operationsper output signal sample when one shifted signalcopy is required or O�1 � 1�L�log N� per sampleoperations for obtaining L differently shifted copies.The algorithm is well suited for arbitrary translationsignal that is required in many signal�image process-ing applications, such as, for instance, signal frac-tional delay and image rotation.5

3. Global Discrete Sinc Interpolation in DCT Domain

The discrete sinc interpolation described in Section 2suffers from boundary effects caused, in particular,by its implementation as a cyclic convolution. Thesimplest and one of the most efficient ways to mini-mize boundary effects in digital filtering is signalextension by its mirror reflection from its boundaries.Such an extension completely eliminates signal dis-continuities at the boundaries. For such signals,one still can retain the advantages of computing con-volution with the use of an FFT if shifted DFT �SD-FTu,v�6,7

�r�u,v� �

1

�N �k 0

N�1

ak exp�i2�k � u�

Nr�exp�i2

kvN �(19)

with shift parameters u 1�2 �half discretizationinterval in the signal domain� and v 0 �no shift in

10 July 2003 � Vol. 42, No. 20 � APPLIED OPTICS 4169

Page 5: Boundary effect free and adaptive discrete signal sinc ...

the Fourier domain� is used instead of the DFT. Fora signal extended to its double length by mirror re-flection, SDFT1�2,0 is reduced to the DCT.6,7 Filter-ing such signals in the SDFT domain is also of a cyclicconvolution with a period of 2N, where N is the num-ber of samples of the initial signal. Therefore theinterpolation function for the extended signal shouldbe obtained from that for the initial signal by paddingit with zeros to the double length of 2N samples asillustrated in Fig. 2. Zero padding prevents convo-lution results from the influence of boundary effectsof the cyclic convolution. Specifically, for generatinga discrete sinc-interpolated copy of the initial signalof N samples shifted by interval p, the interpolationfunction �hint

�p��k�� should be

hint� p��k� �

�sincd�K; N; k � p�; k � 0, 1, . . . N � 10; k � N, N � 1, . . . 2N � 1 ,

(20)

where K N for odd-numbered N, and K �1 foreven-numbered N.

With the use of SDFT1�.2,0, the algorithm for gen-erating p-shifted signal �ak

�p�� described by Eq. �15� ismodified to

�akp� � ISDFT1�2,0��r

DCT � �r� p��, (21)

where ISDFT1�2,0 is inverse SDFT1�.2,0, ��rDCT� are

DCT transform coefficients of signal �ak�, and ��r�p��are DFT coefficients of the interpolation function�hint

�p��k��:

�r� p� � �rre� p� � i�r

im� p�

�1

�2N �k 0

2N�1

hint� p��k�exp�i2

kr2N� . (22)

As DCT spectral coefficients ��rDCT� exhibit odd sym-

metry:

�rDCT �

��rDCT � DCT�ak�, r � 0, 1, . . . , N � 1;

0, r � N��2N�1�r

DCT, r � N � 1, N � 2, . . . , 2N � 1,

(23)

inverse SDFT ISDFT1�2,0 for generating the interpo-lated signal according to Eq. �21� is reduced to inverseDCT and DST �discrete sine transform�:

ak� p� �

1

�2N �r 0

2N�1

�rDCT�r� p�exp��i2

�k � 1�2�r2N �

�1

�2N (�0DCT�0 � �

r 1

N�1

�rDCT

� ��r exp��i�k � 1�2�

Nr�

� �r* exp�i�k � 1�2�

Nr�)

�1

�2N ��0DCT�0

� 2 �r 1

N�1

�rDCT�r

re cos��k � 1�2�

Nr�

� 2 �r 1

N�1

�rDCT�r

im sin��k � 1�2�

Nr� , (24)

where �r* is a complex conjugate to �r. For each p,coefficients �2r�p� with even indices can be found di-rectly from the definition of ��r� �Eqs. 20, 22, and 17,18�:

�2r� p� �1

�Nexp�i2

prN � . (25)

Therefore one needs to compute additionally onlyterms ��2r�1�p�� with odd indices:

�2r�1� p� �1

�2N �k 0

N�1

sincd�K; N; k

� p�exp�i2k�2r � 1�

2N � , (26)

where, as in Eqs. �20�, K N for odd-numbered N,K �1 for even-numbered N.

A flow diagram of this algorithm for generating ap-shifted sinc-interpolated copy of the signal is shownin Fig. 3. Figure 4 illustrates the described discretesinc interpolation in the DCT domain applied for im-age zooming and compares it with that implementedin the DFT domain. One can see that the algorithmdoes solve the problem of boundary effects character-istic for discrete sinc interpolation in the DFT do-main. It is, however, computationally efficient onlyif a regular �equidistant� resampling signal is re-quired. In this case it enables the computation of ap-shifted sinc-interpolated copy of the signal of Nsamples with the complexity of O�N log N� operationsor O�log N� operations per signal sample. This com-plexity is, by the order of magnitude, the same asthat of the above DFT domain sinc-interpolation

Fig. 2. Principle of signal convolution in the DCT domain withsignal extension by its mirror reflection.

4170 APPLIED OPTICS � Vol. 42, No. 20 � 10 July 2003

Page 6: Boundary effect free and adaptive discrete signal sinc ...

algorithm. However, fast algorithms for DCT,IDCT, and IDST exist8–15 that require even less com-putations than FFT and IFFT involved in the DFTdomain algorithm.

4. Sinc Interpolation in DCT Domain in a SlidingWindow

When, as frequently happens in signal and imageresampling tasks, required signal sample shifts are

different for different samples, the above global dis-crete sinc-interpolation algorithm in the DCT domainhas no efficient computational implementation.However, in these cases it can be implemented in asliding window. In processing a signal in the slidingwindow, only those shifted and interpolated signalsamples that correspond to the window central sam-ple have to be computed in each window position fromsignal samples within the window. The interpola-tion function in this case is a windowed discrete sincfunction whose extent is equal to the window sizerather than to the signal size required for the perfectdiscrete sinc interpolation. Figure 5 illustrates fre-quency responses of the corresponding low-pass fil-ters for different window sizes. As one can see fromthe figure, they deviate from a rectangular functionas a frequency response of the ideal low-pass filterEq. �8��.

Such an implementation of the discrete sinc inter-polation can be regarded as a variety of direct convo-lution interpolation methods. In terms of theinterpolation accuracy it has no special advantagesover other direct convolution interpolation methodssuch as spline-oriented ones.16,17 However, it offersfeatures that are not available with other methods.These are: �i� signal resampling with arbitraryshifts and simultaneous signal restoration and en-hancement, and �ii� local adaptive interpolation withsuper resolution.

For signal resampling with simultaneous restora-tion�enhancement, sliding window discrete sinc in-terpolation should be combined with local adaptivefiltering. Local adaptive filters that work in a slid-ing window in the transform domain, such as that ofDFT or DCT, have shown their high potentials insignal and image restoration and enhancement.18,19

The filters, in each position k of the window of Wsamples �usually an odd number�, compute transformcoefficients ��r T�bn�� of the signal �bn� in the win-dow �n, r 1, 2, . . . , W� and nonlinearly modify themto obtain the coefficients ��r��r��. These coefficientsare used to generate an estimate ak of the window

Fig. 3. Flow diagram of the discrete sinc interpolation in the DCTdomain for generating a p-shifted copy of a signal.

Fig. 4. Enlarging a fragment of an image �left� by sinc interpolation in the DFT domain �upper-right image� and in the DCT domain�bottom-right image�. Oscillations due to boundary effects that are clearly seen in a DFT-interpolated image completely disappear in theDCT-interpolated image.

10 July 2003 � Vol. 42, No. 20 � APPLIED OPTICS 4171

Page 7: Boundary effect free and adaptive discrete signal sinc ...

central pixel by inverse transform Tk�1� � computed

for the window central pixel as

ak � Tk�1��r��r��. (27)

For instance, for filtering additive noise, soft thresh-olding �empirical Wiener filter�

�r��r� � max�0,��r�2 � Thr

��r�2��r (28)

or hard thresholding

�r � ��r, ��r�2 � Thr0, otherwise (29)

are used where Thr is a certain threshold levelassociated with the noise variance. Such a filter-ing can be implemented in the domain of any trans-form, though DCT has proved to be one of the mostefficient. Therefore one can, in a straightforward

Fig. 6. Flow diagram of a simultaneous signal sliding-window sinc interpolation and restoration�enhancement in the DCT domain.

Fig. 7. Image rectification and denoising by resampling with sinc interpolation in the sliding window in the DCT domain.

Fig. 5. Windowed discrete sinc functions with a window size of 11 and 15 samples �left� and their DFT spectra for 3� signal enlarging�right�.

4172 APPLIED OPTICS � Vol. 42, No. 20 � 10 July 2003

Page 8: Boundary effect free and adaptive discrete signal sinc ...

way, combine sliding-window DCT domain discretesinc-interpolation signal resampling �Eq. 21� andfiltering for signal restoration and enhancement�Eq. 27�:

�akp� � ISDFT1�2,0��r

DCT��rDCT��r� p��. (30)

Figure 6 shows a flow diagram of such a combinedalgorithm for signal restoration�enhancement andfractional p-shift. It is assumed in the diagram thatsignal p-shift is implemented according to the flowdiagram of Fig. 3. Figure 7 illustrates the applica-tion of the combined filtering�interpolation for imageirregular-to-regular resampling combined with de-noising. In this example, the left image is distortedby known displacements of pixels with respect to reg-ular equidistant positions and by additive noise. Inthe right image, these displacements were compen-sated and noise was substantially reduced with theabove-described sliding-window algorithm.

One can further extend the applicability of thismethod to make interpolation kernel transform coef-ficients ��r�p�� in Eq. �30� to be adaptive to local sig-nal features that exhibit themselves in local signalDCT spectra:

�akp� � ISDFT1�2,0��r

DCT��rDCT��r� p, ��r

DCT���. (31)

The adaptivity may be desired in such applicationsas, for instance, resampling images that containgray-scale images in a mixture with graphical data.While discrete sinc interpolation is completely perfectfor gray-scale images, it may produce undesirableoscillating artifacts in graphics.

The principle of local adaptive interpolation isschematically presented on Fig. 8. It assumes thatmodification of local signal DCT spectra for signalresampling and restoration in the above-describedalgorithm is supplemented with the spectrum anal-ysis for generating a control signal. This signal isused to select, in each sliding-window position, dis-crete sinc interpolation or another interpolationmethod such as, for instance, the nearest neighbormethod. Figure 9 compares nonadaptive andadaptive sliding-window sinc interpolation on anexample of a shift, by an interval equal to 16.54 ofthe discretization intervals, of a test signal com-posed of a sinusoidal wave and rectangular im-

pulses. As one can see from Fig. 9, nonadaptivesinc-interpolated resampling of such a signal re-sults in oscillations at the edges of rectangular im-pulses. Adaptive resampling implemented in thisexample switches between sinc interpolation andnearest-neighbor interpolation whenever energy ofhigh-frequency components of local signal spectrumis higher than a certain threshold level. As a re-sult, rectangular impulses are resampled with su-perresolution. Figure 10 illustrates, for comparison,enlarging a test signal by means of nearest neighbor,linear, and bicubic spline interpolations, and theabove-described adaptive sliding-window DCT sincinterpolation. One can see from this figure that in-terpolation artifacts seen in other interpolationmethods are absent when the adaptive sliding-window interpolation was used. Nonadaptive andadaptive sliding-window sinc interpolation are alsoillustrated and compared in Fig. 11 for rotation of an

Fig. 8. Principle of local adaptive interpolation.

Fig. 9. Signal �upper plot� shift by nonadaptive �middle plot� andadaptive �bottom plot� sliding-window DCT sinc interpolation.One can notice the disappearance of oscillations at the edges of therectangular impulses when interpolation is adaptive.

10 July 2003 � Vol. 42, No. 20 � APPLIED OPTICS 4173

Page 9: Boundary effect free and adaptive discrete signal sinc ...

image that contains gray-scale and graphic compo-nents.

Computational complexity of sliding-window DCTsinc interpolation evaluated in terms of the numberof multiplication and summation operations per sig-nal sample is proportional to the window size becauseof the availability of recursive algorithms for comput-ing DCT in sliding windows.20–25 It is comparablewith that of other convolution-based interpolationmethods. Note that for reconstruction of only thewindow central sample, the inverse DCT and DST ofthe modified window spectrum required by the inter-

polation algorithm is reduced to simple summationsof the modified spectral coefficients:

bk �1

�2N ��0DCT � �

r 1

�N�1��2

��1�r�2rDCT�2r

re� p�

� �2r�1DCT�2r�1

re� p�� . (32)

5. Conclusion

Two new methods of discrete signal sinc interpolationare described. The first method implements, bymeans of signal processing in the domain of the dis-crete cosine transform, a discrete sinc interpolationthat is practically free of boundary effects. The sec-ond method implements discrete sinc interpolation ina sliding window and enables arbitrary irregular sig-nal resampling with simultaneous signal and imagerestoration and local adaptive interpolation with su-per resolution.

The author thanks J. Astola, K. Eguiazaryan, A.Gotchev, and A. Happonen from Tampere Interna-tional Center for Signal Processing, Tampere Insti-tute of Technology, Tampere, Finland, for theirassistance and fruitful discussions.

References1. L. R. Rabiner and B. Gold, Theory and Application of Digital

Signal Processing �Prentice-Hall, Englewood Cliffs, N.J., 1975�.2. D. Fraser, “Interpolation by the FFT Revisited—An Experi-

mental Investigation,” IEEE Trans. Acoust. Speech SignalProcess. ASSP-37, 665–675 �1989�.

3. T. Smith, M. S. Smith, and S. T. Nichols, “Efficient sinc functioninterpolation technique for center padded data,” IEEE Trans.Acoust. Speech Signal Process. ASSP-38, 1512–1517 �1990�.

4. L. Yaroslavsky, “Efficient algorithm for discrete sinc interpo-lation,” Appl. Opt. 36, 460–463 �1997�.

5. M. Unser, P. Thevenaz, and L. Yaroslavsky, “Convolution-based interpolation for fast, high-quality rotation of images,”IEEE Trans. Image Process. 4, 1371–1382 �1995�.

6. L. Yaroslavsky, Digital Picture Processing: An Introduction�Springer-Verlag, Berlin, 1985�.

7. L. Yaroslavsky and M. Eden, Fundamentals of Digital Optics�Birkhauser, Boston, 1996�.

8. Z. Wang, “Fast algorithms for the discrete W transform and forthe discrete Fourier transform,” IEEE Trans. Acoust. SpeechSignal Process. ASSP-32, 803–816 �1984�.

9. H. S. Hou, “A fast recursive algorithm for computing the dis-crete cosine transform,” IEEE Trans. Acoust. Speech SignalProcess. ASSP-35, 1455–1461 �1987�.

Fig. 10. Comparison of nearest neighbor, linear, bicubic spline,and adaptive sliding-window sinc-interpolation methods for en-larging a digital signal. �From left to right, from top to bottom:Continuous signal, initial sampled signal, nearest-neighbor 8�-interpolated signal; linearly 8�-interpolated signal, cubic spline8�-interpolated signal, sliding-window 8� sinc-interpolated sig-nal�.

Fig. 11. Image �upper� rotation with sliding window nonadaptive �left� and adaptive DCT sinc interpolation �right�. Note disappearanceof oscillations at sharp edges thanks to switching between sinc interpolation and nearest-neighbor interpolation at the boundaries of blackand white squares.

4174 APPLIED OPTICS � Vol. 42, No. 20 � 10 July 2003

Page 10: Boundary effect free and adaptive discrete signal sinc ...

10. Z. Wang, “A simple structured algorithm for the DCT,” in Proc.3rd Ann. Conf. Signal Process. Xi’an, China, Nov 1988, pp.28–31 �in Chinese�.

11. A. Gupta and K. R. Rao, “A fast recursive algorithm for thediscrete sine transform,” IEEE Trans. Acoust. Speech SignalProcess. ASSP-38, 553–557 �1990�.

12. Z. Wang, “Pruning the Fast Discrete Cosine Transform,” IEEETrans. Commun. 39, 640–643 �1991�.

13. Z. Cvetkovic and M. V. Popovic, “New fast recursive algorithmsfor the computation of discrete cosine and sine transforms,”IEEE Trans. Signal Process. 40, 2083–2086 �1992�.

14. J. Ch. Yao and Ch-Y. Hsu, “Further results on “New fastrecursive algorithms for the discrete cosine and sine trans-forms,” IEEE Trans. Signal Process. 42, 3254–3255 �1994�.

15. L. Yaroslavsky, A. Happonen, and Y. Katyi, “Signal discretesinc-interpolation in DCT domain: fast algorithms,” SMMSP2002, Second International Workshop on Spectral Methodsand Multirate Signal Processing, Toulouse �France�,07.09.2002–08.09.2002.

16. M. Unser, “Splines: A perfect fit for signal and image pro-cessing,” IEEE Trans. Signal Process. 16, 22–38 �1999�.

17. Ph. Thevenaz, Th. Blu, and M. Unser, “Interpolation Revisit-ed,” IEEE Trans. Med. Imaging MI-19, 739–758 �2000�.

18. L. Yaroslavsky, “Image restoration, enhancement, and targetlocation with local adaptive filters,” in International Trends inOptics and Photonics, ICOIV, T. Asakura, ed., �Springer-Verlag, Berlin, 1999�, pp. 111–127.

19. L. P. Yaroslavsky, K. O. Egiazarian, and J. T. Astola, “Trans-

form domain image restoration methods: review, compari-son, and interpretation,” in Photonics West 2001: ElectronicImaging Nonlinear Processing and Pattern Analysis, Proc.SPIE 4304, 155–170 �2001�.

20. R. Yu. Vitkus and L. P. Yaroslavsky, “Recursive Algorithms forLocal Adaptive Linear Filtration,” in Mathematical Research,Computer Analysis of Images and Patterns, L. P. Yaroslavsky,A. Rosenfeld, and W. Wilhelmi, eds. Band 40, �Academie Ver-lag, Berlin, 1987�, pp. 34–39.

21. N. Rama Murthy, N. S. Swamy, “On computation of runningdiscrete cosine and sine transform,” IEEE Trans. Signal Pro-cess. 40, 1430–1437 �1992�.

22. K. J. R. Liu, C. T. Chiu, R. K. Kolagotla, and J. F. Jaja,“Optimal unified architectures for the real-time computationof time-recursive discrete sinusoidal transforms,” IEEE Trans.Circuits and Systems for Video Technology, Vol. 4, No. 2, April1994.

23. J. A. R. Macias and A. Exposito, “Recursive Formulation ofShort-Time Discrete Trigonometric Transforms,” IEEE Trans-actions Circuits Syst. II Analog and Digital Signal Processing,45, 525–527 �1998�.

24. V. Kober and G. Cristobal, “Fast recursive algorithms forshort-time discrete cosine transform,” Electron. Lett. 35,1236–1238 �1999�.

25. J. Xi and J. F. Chicharo, “Computing running DCT’s and DST’sbased on their second order shift properties,” IEEE Trans.Circuits Syst. - I, Fundamental Theory and Applications, 47,779–783 �2000�.

10 July 2003 � Vol. 42, No. 20 � APPLIED OPTICS 4175