Interpolates a series to a new sample rate by FFT zero insertion.
ZINTERP(series, r)
series |
- |
An input series or array. |
r |
- |
A
real. The new sample rate of the interpolated series, |
A series or array.
W1: gsin(64, 1/64, 10)
W2: zinterp(W1, 16*rate(W1));overp(w1);setplotstyle(1, 2);setsym(circle, 2)

W1 contains 64 samples of a 10 Hz sine wave sampled at 64 Hz.
W2 produces a 3 Hz sine wave with an interpolated sample rate of 64 * 16 = 1024 Hz. The length is 1009 samples. The original sine wave in W1 is overplotted as red circles. The interpolation result accurately constructs the underlying 10 Hz sine wave.
W3: zinterp(W1, 100)
produces a 99 point interpolated 3 Hz sine wave with a sample rate of 100 Hz.
ZINTERP effectively resamples the input series to the higher rate R using ideal
1. |
For series s, the FFT is calculated. |
2. |
N zeros are inserted into the FFT starting at the Nyquist frequency, Fn = 0.5 * rate(s).
N is determined such that:
L / R = length(s) / rate(s)
where L is the length of the output series. Since:
L = length(s) + N
we have:
N = ((R * length(s)) / rate(s)) - length(s) |
3. |
The IFFT of the inserted series is computed to produce the interpolated time domain series. |
The zero insertion step is equivalent to convolving the input series
with a symmetric "continuous" periodic
X(f) = 0 for f > 0.5 * Fs
where X(f) is the Fourier Transform of the continuous time signal, then the interpolation will be exact (within numerical roundoff errors).
Although the output rate R is NOT required to be an integer multiple of the input sample rate, the relation:
R / rate(s) = L / length(s)
must hold, so the actual output rate might differ from R.
For non-periodic waveforms,
See RESAMPLE to resample a series to a specific sample rate using a variety of interpolation methods.