1. Home
  2. Signal processing

Signal processing · interpolation

The sinc Function: sinc(x)

Eigenfield editorial team ·

The sinc function is defined as sinc(x) = sin(πx) / (πx), with sinc(0) taken as 1. It is the shape of the spectrum of a rectangular pulse, the impulse response of an ideal low-pass filter, and the kernel behind perfect reconstruction of a sampled signal. The expression looks like a division by zero at x = 0, and the first thing to settle is why it is not. Few functions appear in as many corners of signal processing.

The value at zero

As x approaches 0, sin(πx) behaves like πx, so the ratio tends to 1. More precisely, the series sin(u) = u − u³/6 + … gives

sinc(x) ≈ 1 − (πx)²/6

and the function is smooth through the origin once the removable gap is filled with 1. A numeric check at x = 0.1 supports it: the series gives 1 − 0.01645 = 0.98355, and with the next term, +(πx)⁴/120 = 0.00008, it reaches 0.98363, which is the actual value to four digits, 0.9836.

Two conventions

Signal processing uses the normalized form above. Mathematical analysis often uses the unnormalized form sin(x)/x. They are related by a rescaling of the argument: sincnormalized(x) = sin(πx)/(πx) equals sincunnormalized(πx). The normalized one has its zeros at the nonzero integers and an integral over the whole line equal to 1. The unnormalized one has its zeros at multiples of π, with an integral of π. Always check which a given library implements before reusing a formula, since a factor of π in the argument shifts every zero.

A checked table

x πx sin(πx) sinc(x)
0 0 0 1
0.25 0.7854 0.7071 0.9003
0.5 1.5708 1 0.6366
1 3.1416 0 0
1.5 4.7124 −1 −0.2122
2.5 7.8540 1 0.1273

The value at 0.5 is 1/(π/2) = 2/π ≈ 0.6366. At 1.5 the sine is −1 and the denominator is 1.5π, so the value is about −0.2122. The envelope of the oscillation decays like 1/(π|x|), which is slow: sinc is not absolutely summable, and that matters for practical filters.

Why it is an ideal filter

An ideal low-pass filter passes every frequency below a cutoff and blocks the rest. Its spectrum is a rectangle, and the inverse transform of a rectangle is a sinc. With cutoff fc the impulse response is 2fc · sinc(2fct). Convolving a signal with it removes everything above fc.

The same fact explains interpolation. A signal bandlimited below half the sampling rate can be rebuilt from its samples x(n) as the sum of x(n) · sinc(t/T − n) over all n, where T is the sampling period. Each sinc is 1 at its own sample and 0 at every other sample, so the rebuilt curve passes exactly through the data. For the table above, take samples 1 and 0 spaced one unit apart: halfway between them the rebuilt value is contributed by every sample in the infinite sum, and the two closest each weigh 0.6366.

Practical limits

Two problems arise at once. The sinc has infinite length, so a filter must truncate it. Truncation is equivalent to multiplying by a rectangular window, which produces ripple near the cutoff. The fix is to taper the truncated sinc with a smooth window such as the Blackman window or the Gaussian window, trading a wider transition band for lower ripple. The second problem is that a filter built this way is noncausal and needs a delay, so a finite-length version is shifted to start at zero.

The same function appears inside the pulse-shaping design on the raised cosine filter page, where the sinc is multiplied by a further factor that forces the tails to fall faster.

Pseudocode

function sinc(x):
    if x == 0: return 1
    return sin(pi * x) / (pi * x)

Library versions evaluate the ratio on a vector and replace the zero entry explicitly, which prevents the 0/0 that would otherwise produce a not-a-number result at the center.

Back to top