Your Equation

Library / Signal processing and digital filters / DSP-48

Signal processing and digital filters

Sinc interpolation of a sampled waveform

Value at time t of the ideal bandlimited reconstruction from up to six samples x₀ … x₅ at indices 0 to 5 (extra values zero).

Ref
DSP-48
Rev
v1
Field
Signal processing and digital filters
Result
x(t) [V]

The sampling theorem says that a signal bandlimited below fs/2 is recovered exactly by x(t) = Σ x[n] sinc(fs t − n), a sum of shifted sinc pulses weighted by the samples. At a sample time t = m/fs it returns x[m] exactly, since all other sincs are zero there. Between samples, a finite record causes truncation error, which grows with distance from the data.

Value at time t of the ideal bandlimited reconstruction from up to six samples x₀ … x₅ at indices 0 to 5 (extra values zero). The exact result needs the full infinite record of a signal bandlimited below fs/2; truncation causes error away from the sample points.

Calculator

Solve for
V
V
−1010
V
−1010
V
−1010
V
−1010
V
−1010
V
−1010
Hz
0.11,000,000
s
05
  • Time in sample units, fs·t1.5
  • Nearest sample index2
  • Weight of the nearest sample0.6366

What drives the result

Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.

Interpolated value (V) current value 0.6366 V
x1Sample 1Key driver
−6.376.37
x2Sample 2
−5.737
x0Sample 0
−1.492.76
x3Sample 3
−1.492.76
x4Sample 4
−0.6371.91
x5Sample 5
−0.2731.55
tTime
−0.2071
fsSampling rate
−0.010.983
  • Between the samples the interpolated value at t = 0.75 s (1.5 sample intervals) is 0.6366 V.
  • At the exact sample times the formula returns the samples themselves, so interpolation never changes the data; with only 6 stored samples, expect error near the ends of the record.
Chart data as tables

Ranked variables

VariableTypical rangeLowest resultHighest resultSwing (V)Local stepChange in result
x1 Sample 1−10 to 10 V−6.3666.36612.73+0.4 V+40 %
x2 Sample 2−10 to 10 V−5.737.00312.73+0.4 V+40 %
x0 Sample 0−10 to 10 V−1.4852.7594.244+0.4 V−13.3 %
x3 Sample 3−10 to 10 V−1.4852.7594.244+0.4 V−13.3 %
x4 Sample 4−10 to 10 V−0.63661.912.546+0.4 V+8 %
x5 Sample 5−10 to 10 V−0.27281.5461.819+0.4 V−5.71 %
t Time0 to 5 s−0.206711.207+10%−31.5 %
fs Sampling rate0.1 to 1,000,000 Hz−0.010020.98340.9934+10%−31.5 %

Sweep of Time

Time (s)Interpolated value (V)
03.898e-17
0.6250.9003
1.25−0.2122
1.8750.08185
2.5−3.898e-17
3.125−0.04287
3.750.04897
4.375−0.02904
53.898e-17

Sweep one variable

Interpolated value (V)Hover, touch, or use the arrow keys on the chart
−0.200.20.40.60.81 012345 Time (s) now 0.6366

Variables and how each one contributes

x(t)

Interpolated value

Result · V

What the equation gives you. Everything else feeds it.

x0

Sample 0

V · typical −10 to 10

The sample x[0], in V. Is weighted by sinc(fs·t − 0), which peaks at t = 0/fs. Raising it by 10 % (to 0) moves the result by +0 %, from 0.6366 to 0.6366 V.

x1

Sample 1

V · typical −10 to 10

The sample x[1], in V. Is weighted by sinc(fs·t − 1), which peaks at t = 1/fs. Raising it by 10 % (to 1.1) moves the result by +10 %, from 0.6366 to 0.7003 V.

x2

Sample 2

V · typical −10 to 10

The sample x[2], in V. Is weighted by sinc(fs·t − 2), which peaks at t = 2/fs. Raising it by 10 % (to 0) moves the result by +0 %, from 0.6366 to 0.6366 V.

x3

Sample 3

V · typical −10 to 10

The sample x[3], in V. Is weighted by sinc(fs·t − 3), which peaks at t = 3/fs. Raising it by 10 % (to 0) moves the result by +0 %, from 0.6366 to 0.6366 V.

x4

Sample 4

V · typical −10 to 10

The sample x[4], in V. Is weighted by sinc(fs·t − 4), which peaks at t = 4/fs. Raising it by 10 % (to 0) moves the result by +0 %, from 0.6366 to 0.6366 V.

x5

Sample 5

V · typical −10 to 10

The sample x[5], in V. Is weighted by sinc(fs·t − 5), which peaks at t = 5/fs. Raising it by 10 % (to 0) moves the result by +0 %, from 0.6366 to 0.6366 V.

fs

Sampling rate

Hz · typical 0.1 to 1,000,000

The sampling rate, in Hz. Scales the time axis: the sample spacing is 1/fs. Raising it by 10 % (to 2.2) moves the result by −31.5 %, from 0.6366 to 0.4363 V.

t

Time

s · typical 0 to 5

The time at which to interpolate, in s. Moves along the record; at t = n/fs the value is exactly x[n]. Raising it by 10 % (to 0.825) moves the result by −31.5 %, from 0.6366 to 0.4363 V.

Worked example with the values above

  1. Time in sample units: fs·t = 2 × 0.75 = 1.5.
  2. Nonzero terms: x[1] sinc(0.5) = 1 × 0.63662.
  3. x(t) = 0.63662 V.

Assumptions and limits

  • Integer, positive resampling factors, with a low-pass filter that gives enough alias rejection.
  • For analytic-signal formulas, a narrowband signal with a clean quadrature component and less than π of phase change per sample.

Common mistakes

  • Not reducing L/M by the common factor, which wastes computation.
  • Forgetting the filter delay when counting output samples.
  • Using the phase difference when the true change per sample exceeds π.

Statistics and uncertainty

Rates and lengths here are exact integer relations. Estimates of envelope and frequency from analytic samples are sensitive to noise, since the phase of a small sample is poorly defined, so use only samples well above the noise floor.

Where it is used

  • Converting between audio and instrumentation sample rates and sizing buffers.
  • Demodulating amplitude and frequency from complex baseband data.

Maths you need

  • Interpolation and decimation: raising and lowering the sampling rate by integer factors
  • Analytic signal: a real signal plus i times its Hilbert transform
  • Principal phase: phase wrapped to the range −π to π

Related formulas

Practise this formula