wonkey_monkey
27th December 2022, 20:46
If you have evenly spaced data points you can easily interpolate them using (for example) a bicubic spline with a 4 taps:
https://i.imgur.com/9LrP0ds.png
and you get a nice smooth line through all of the points.
But what's a good way to get a similar result when the points aren't evenly separated along the x-axis? If you just stretch out the curve between each pair of points horizontally, you get a sharp angle at the point instead of a line that passes smoothly through it:
https://i.imgur.com/jaycoh1.png
A thin plate spline gives a nice result:
https://i.imgur.com/vxAkPdH.png
but it's too computationally intensive for what I have in mind. I've also tried a few ways of modifying the standard kernel-based 4-tap spline but to no avail so far. Can anyone point me in the right direction?
Edit: what I really want is something that, given four x positions and an x position to interpolate to (e.g. [4, 5, 7, 10], and 5.65) will just give me four coefficients which don't depend on the actual values at the four near points.
https://i.imgur.com/9LrP0ds.png
and you get a nice smooth line through all of the points.
But what's a good way to get a similar result when the points aren't evenly separated along the x-axis? If you just stretch out the curve between each pair of points horizontally, you get a sharp angle at the point instead of a line that passes smoothly through it:
https://i.imgur.com/jaycoh1.png
A thin plate spline gives a nice result:
https://i.imgur.com/vxAkPdH.png
but it's too computationally intensive for what I have in mind. I've also tried a few ways of modifying the standard kernel-based 4-tap spline but to no avail so far. Can anyone point me in the right direction?
Edit: what I really want is something that, given four x positions and an x position to interpolate to (e.g. [4, 5, 7, 10], and 5.65) will just give me four coefficients which don't depend on the actual values at the four near points.