# Sinc Interpolation based on FFT

**URL:** <https://discourse.julialang.org/t/sinc-interpolation-based-on-fft/52512>\
**Category:** Signal and Image Processing\
**Tags:** fftw, interpolations, dsp\
**Created:** [December 28, 2020, 1:56pm UTC](https://discourse.julialang.org/t/sinc-interpolation-based-on-fft/52512 "2020-12-28T13:56:28Z")\
**Posts on this page:** 1\
**Showing post:** 77

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [April 2, 2021, 5:46pm UTC](https://discourse.julialang.org/t/sinc-interpolation-based-on-fft/52512/77 "2021-04-02T17:46:57Z")

</div>

> [@RainerHeintzmann](#):
>
> @stevengj do you agree?

This is just an example of [aliasing](https://en.wikipedia.org/wiki/Aliasing). Yes, **looking only at the samples** n it is impossible to distinguish between 2a\cos(\pi n) = ae^{i\pi n} + ae^{-i\pi n} and 2a\cos(\pi n) + 2b\sin(\pi n) = (a-ib)e^{i\pi n} + (a+ib)e^{-i\pi n} for any b, because the sine term vanishes on all the samples (equivalently, e^{\pm i \pi n} are aliased). You _must_ assume something about what happens in between the samples to determine b. For example, if you want the interpolant that minimizes the mean-square slope you get b=0, since the mean-square slope is:

\frac{1}{2} \int\_{-1}^{+1} \left| -2\pi a\sin(\pi x) + 2\pi b\cos(\pi x) \right|^2 dx \\ = 2\pi^2 \int\_{-1}^{+1} \left( |a|^2 \sin^2(\pi x) + |b|^2 \cos^2(\pi x) - \Re[a^\* b] \sin(2\pi x) \right) dx \\ = \pi^2 \left( |a|^2 + |b|^2 \right)

which is obviously minimized for b=0, whereas a is fixed by the sample observations.

Interpolating inherently involves choices, because there are infinitely many functions that interpolate between a discrete set of samples. Trigonometric interpolation is no different. Fortunately, there are reasonable criteria (like bandlimited interpolants with minimal mean-square slope) that lead to a simple choice of interpolant.

> [@RainerHeintzmann](#):
>
> Of course this is NOT a problem of the FFT but a problem of just about incorrect sampling as we are AT the Nyquist limit rather than sampling above it.

In a sense, yes — if you sample a DFT exactly at the Nyquist limit then the bandlimited assumption is not sufficient to determine the interpolant. You need an additional criterion like the minimal-slope condition above. But I don’t see this as a big problem; after all, the band-limited assumption itself is usually just an approximation.

(For the classic form of the Nyquist–Shannon sampling theorem, you have infinitely many samples — a [DTFT](https://en.wikipedia.org/wiki/Discrete-time_Fourier_transform), not a DFT — giving a continuous set of frequencies in [-\pi,\pi] and corresponding amplitudes. In this case, the Nyquist frequency \pm \pi is a set of measure zero and doesn’t contribute anything to the interpolated signal as long as the Fourier transform is [regular](https://www.sciencedirect.com/topics/mathematics/regular-distribution) (no delta functions). Hence the bandlimited assumption is sufficient by itself to determine a unique interpolant/reconstruction.)

---

_[View the full topic](https://discourse.julialang.org/t/sinc-interpolation-based-on-fft/52512)._
