How does sinc interpolation work? Every now and then I come across mention of sinc interpolation.  Trying to read up on it, I have yet to get what it's about.  I have done basic DSP work, have programmed stuff using FFT (using just a rectangular window on the data which i know is not so great), and have also done a lot of work with Bezier (and related) curves and polynomial interpolation.
Can anyone explain plainly how to do sinc interpolation, and why it's useful?
Thank you!!
 A: The Sinc function is a way to represent the waveform that each discrete sample is responsible for.  In particular, it represents the waveform by adding no higher frequency content.  Using the Sinc function to interpolate ensures no higher harmonics are added.  The FFT of the interpolated waveform will have a sharp drop to zero frequency content above the original Nyquist frequency.
I repeat, each discrete sample is responsible for a sinc waveform.  If your signal has $10$ samples, you need to sum all $10$ waveforms together.
A waveform with $N$ samples $x_i$, an interpolation evaluated at $j=0.5$.
$$\sum_{i=0}^{N-1} x_i \operatorname {sinc}(j-i)$$
where
$$\operatorname {sinc}(i) = \begin{cases}
    \dfrac{\sin(\pi i)}{\pi i},  & \text{if $i \ne 0$} \\
    1,                         & \text{if $i = 0$}
\end{cases}$$
That's right, a whole summation expression for each interpolation point. $N$ point waveform interpolated to $M$ new points takes $N \times M$ operations
A: Interpolation = discrete-to-continuous conversion
Interpolation is used to reconstruct a continuous signal from a few discrete samples, a technique known as digital to analog conversion. While a discrete signal is undefined except at a few points in time (samples), the reconstructed signal is known at any time point. Thus some form of interpolation is required to fill the undefined values between samples.
Sinc function = spectrum of a rectangular function
Interpolation can be done in many ways. The particularity of the sinc interpolation is it's the only one mathematically perfect.
A function can be reformulated as a spectrum using a Fourier transform. For the rectangular function (boxcar function) the spectrum is a sinc pulse. This sinc spectrum contains an infinity of harmonics, though their amplitude rapidly decays.
Convolution with sinc pulses
What we want to do to reconstruct the signal is a convolution between the samples and scaled and shifted versions of sinc.
This technique is known as Whittaker–Shannon interpolation: "This is equivalent to filtering the impulse train with an ideal (brick-wall) low-pass filter with gain of 1 (or 0 dB) in the passband. If the sample rate is sufficiently high, this means that the baseband image (the original signal before sampling) is passed unchanged and the other images are removed by the brick-wall filter."

Method

Can anyone explain plainly how to do sinc interpolation?

Three steps are required to perform a sinc interpolation on discrete samples:

*

*Create sinc pulses, one per sample, centered on the sample. As said sinc pulses have an infinite width, but the practical width will be limited to the signal duration. A sinc pulse is a continuous function, defined at any time, with a maximum amplitude of 1.


*Multiply each pulse by the value of the sample. While the value of an isolated sinc pulse is accurate at only one instant, it contributes to the values at other instants.


*Add all delayed and scaled sinc pulses.
*Example

Top-left: The continuous-time (unknown) signal and the known discrete samples.
Top-right: The sinc pulse created for sample 7 (8th sample). The pulse has its peak amplitude equal to the sample value (7.5). Other values are not correct but contribute to the final sum.
Bottom-left: 18 sinc pulses, each one delayed to match a given sample time, and scaled to match the sample value.
Bottom-right: All sinc pulses summed. Since pulses are continuous, the sum is defined at any time, not only at sampling times. The dotted curve is the original continuous-time signal, the dots are the samples, and the plain curve is the interpolation.
The sample signal shown above is a sum of two sinusoids: f(t) = 5 cos(2π f t + 3π/7) + sin(2π f/2 t + 9π/7) with f=2Hz. It would work the same for any number of sinusoids in the signal, as long as the greatest frequency doesn't exceed half the sampling rate (7.6Hz/2)
Actual use of sinc interpolation

Why it's useful?

It is useful when you are provided these samples:

and asked to reconstructed the original continuous signal between samples.
Any periodic signal, even very complex, can be broken down into sinusoids (using the Fourier transform or any other equivalent transform). According to Shannon sampling theorem, it's possible to perfectly reconstruct the details of any waveform if there are at least two samples per period for the sinusoid with the greatest frequency in the signal. This perfect reconstruction requires sinc pulse interpolation.
The tiny difference in the picture above is because the number of samples used is finite. Pulses before the first sample, and after the last sample are not created, thus are ignored in the sum.
Reconstruction is needed to convert a digital signal to an analog version. For example this is required to play a CD track which is only a collection of discrete amplitudes at given times, while the loudspeakers need to be driven by a continuous waveform.
While this perfect reconstruction is nice, still most conversions, including for a CD player, is done with other interpolating pulses, often staircase steps. This is easier (less expensive) and the difference is practically not perceived by the audience.
