# sinc_interp() vs resample()

True sinc() interpolation (in blue) is not the same as FFT resample() interpolation (in red), though they are close. Known samples are the dots, vertical lines are the boundaries of a single period.

The difference is because the FFT interpolation assumes that the signal is periodic; it repeats outside the known values. The sinc() interpolation assumes that the signal is zero outside the known values (ringing in this case). You can make them closer by padding the signal with zeros before resample(), but it will never be exact.

See Time-domain interpolation using the Fast Fourier Transform (Richard Lyons):

*Here’s the second issue regarding time-domain real signal interpolation, and it’s a big deal indeed. This exact interpolation algorithm provides correct results only if the original x(n) sequence is periodic within its full time interval.*

### Additional info

*Viewing this photo Public*

*Safety level of this photo Safe*

Ted Pavlic 4y

It is not correct to say that "FFT interpolation assumes that the signal is periodic" and that sinc interpolation does not. If the underlying signal, as you suggest here, had finite support (i.e., it was zero outside of the window of interest), then it would not be bandlimited. Consequently, it could not be recovered by sinc interpolation. You could use something like sinc interpolation to fill in the gaps between points, but your interpolation technique would be arbitrary at that point. That is, you would not be reconstructing the original continuous-time signal because too much information was lost in the sampling process. The data would be corrupted by aliasing.

In fact, that's the reason for the Gibbs phenomenon/ringing that you see here. The finite approximation of sinc interpolation effectively multiples the time-domain signal by a boxcar, which convolves its frequency-domain representation with a sinc thereby growing its frequency-domain support so it is not bandlimited. When you re-sample that signal, you see the aliasing from those copies of the non-bandlimited signal. That aliasing shows up as the ringing. The true continuous-time signal was flat everywhere outside of the window, but that sharp transition was lost in the sampling process.

A true sinc interpolation is impossible as it requires a true circular convolution, which is infinite. So we use the circular convolution theorem to implement true circular convolution with an FFT.

You might argue that this is just a difference is interpretation. However, you *cannot* reconstruct a signal using sinc interpolation if that signal was originally bandlimited. It's impossible. It's not a well-formed problem.

Sinc interpolation is just another way for to say you're filtering out the Nyquist window of interest and re-sampling. If your signal was not band-limited to begin with, that Nyquist window will be polluted with the tails of other Nyquist windows.

Ted Pavlic 4y

endolith 4y

Ted Pavlic 3y

What is called "True sinc interpolation" is itself an approximation of real sinc interpolation (done to help aid in the understanding of what sinc interpolation is ideally). Real sinc interpolation is impossible to implement in the time domain in general. You leverage the band-limitedness to implement in the frequency domain with FFT. It is the FFT that is "true" sinc interpolation. Consequently, it's no surprise that the FFT re-sampling generates a periodic signal when you extrapolate here. It would be a surprise if it generated a signal with finite support in the time domain.

Ted Pavlic 3y

Based on the answer to that, would you still hold that the FFT resampling is an approximation of something implemented "truly" in the time domain? Or is it really the other way around?

You can use sinc interpolation in the time domain to get an aperiodic signal, but count on some harmonic distortion. Is that really what you want?