Resamples a series to an arbitrary sample rate.
RESAMPLE(series, rate, "method")
series |
- |
Input series to resample. |
|||||||||||||||
rate |
- |
A real, the
new sample rate where |
|||||||||||||||
"method" |
- |
Optional. A string, the interpolation method.
|
RESAMPLE(xseries, yseries, rate, "method")
xseries |
- |
Input X series to resample |
|||||||||||||||
yseries |
- |
Input Y series to resample. |
|||||||||||||||
rate |
- |
A real, the
new sample rate where |
|||||||||||||||
"method" |
- |
Optional. A string, the interpolation method.
|
An interval series where the Y values are sampled at the new rate.
W1: {1, 2, 3, 2}
W2: resample(W1, 3)
W3: W1;overp(W2, seriesred);setsym(14,2);setplotstyle(1,2)

W1 contains the source series with a sample rate of 1.
W2 linearly resamples W1 to a rate of 3.0 and produces a 10 point series. The time duration of W2 is the same as W1.
W3 displays the original series with the resampled values overplotted as red circles.
W4: resample(W1, 3, "spline")
Same as above except cubic spline interpolation is performed.
W1: gsin(100, 1/100, 20)
W2: resample(W1, 1000);overp(W1);setplotstyle(1, 2);setsym(circle, 2)
W3: resample(W1, 1000, "sinc");overp(W1);setplotstyle(1, 2);setsym(circle, 2)

W1 generates 100 samples of a 20 Hz sine wave sampled at 100 Htz.
W2 linearly resamples W1 to a sample rate of 1000 Hz. The original data is overplotted in red circles.
W3 resamples W1 to a sample rate of 1000 Hz using the "sinc" (i.e. sin(x)/x) interpolation method. The original data is overplotted in red circles. The resampled data accurately constructs the underlying 20 Hz sine wave.
The new sample rate must be greater than 0.
If the new rate is less than the original rate, decimation is performed.
If the input is an XY series, an evenly sampled interval series is returned.
The "sinc" method implements standard bandlimited sin(x)/x interpolation.
The "sinx" method implements bandlimited sin(Nx)/sin(x) periodic interpolation using the FFT zero insertion method of ZINTERP.