RESAMPLE

Purpose:

Resamples a series to an arbitrary sample rate.

Syntax:

RESAMPLE(series, rate, "method")

series

-

Input series to resample.

rate

-

A real, the new sample rate where rate > 0.

"method"

-

Optional. A string, the interpolation method.

"linear"

:

linear interpolation (default)

"spline"

:

cubic spline interpolation

"sinx"

:

periodic sinx/sin interpolation

"none"

:

nearest neighbor (no interpolation) 

Alternate Syntax:

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 rate > 0.

"method"

-

Optional. A string, the interpolation method.

"linear"

:

linear interpolation (default)

"spline"

:

cubic spline interpolation

"sinx"

:

periodic sinx/sin interpolation

"none"

:

nearest neighbor (no interpolation) 

Returns:

An interval series where the Y values are sampled at the new rate.

Example:

W1: {1, 2, 3, 2}

W2: resample(W1, 3)

W3: W1;overp(W2, lred);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.

Example:

W4: resample(W1, 3, "spline")

 

Same as above except cubic spline interpolation is performed.

Remarks:

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 "sinx" method does not operate on XY series.

See Also:

DECILP

DECIMATE

DOWNSAMPLE

INTERPOLATE

SPLINE

UPSAMPLE

XY

XYINTERP

XYLOOKUP

ZINTERP