Skip to contents

Convenient wrapper to signal::interp1() for linear interpolation. Assumes that you want interpolated values of xy_old at n_xy_new equidistant data points.

Usage

interp2(time_old, xy_old, n_xy_new = 101)

Arguments

time_old

Timestamps of the xy_old coordinates.

xy_old

To-be normalized x or y coordinates.

n_xy_new

Number of equidistant timepoints that should be generated. Defaults to 101.

Value

Vector of length n_xy_new with interpolated x or y values.

References

Wirth, R., Foerster, A., Kunde, W., & Pfister, R. (2020). Design choices: Empirical recommendations for designing two-dimensional finger tracking experiments. Behavior Research Methods, 52, 2394 - 2416. doi:10.3758/s13428-020-01409-0

Examples

plot(interp2(0:10, (0:10)^2))