Interpolation using multiple neighboring points

596 Views Asked by At

I am wondering, what is the best way to do an interpolation based on $4$ points neighborhood with knowing their value and distance.

Here is the illustration:

enter image description here

I'd like to know the value of the $x$. I know the value of the four neighboring o being $v_0$, $v_1$, $v_2$, $v_3$, and I know their distance to $x$ is $d_0$, $d_1$, $d_2$, $d_3$. So what is the best way to perform the interpolation to get $x$?

I can simply do an inverse of the distance, then normalize each one. It pretty much the idea of barry centric. Is it a better estimation than simply doing the linear using the nearest ones (in this case $v_1$ and $v_2$)? Are there any high-order way to do a better job (say, spline, but I don't want to do spline here since it is too expensive)?

1

There are 1 best solutions below

0
On BEST ANSWER

So what is the best way to perform the interpolation to get $x$?

The best way is not universal but depends on the application, I think.

I can simply do an inverse of the distance, then normalize each one. It pretty much the idea of barry centric. Is it a better estimation than simply doing the linear using the nearest ones (in this case $v_1$ and $v_2$)?

If I did understood, you define $$ f(x) = \frac{\displaystyle\sum_{i=0}^4 w_i \cdot v_i }{\displaystyle\sum_{i=0}^4 w_i}, $$ where $w_i=1/d_i$. I think this approach is not the easiest to implement, because when $d_i \to 0$ you have that $w_i \to \infty$.

Are there any high-order way to do a better job (say, spline, but I don't want to do spline here since it is too expensive)?

One possibility is to use polynomial interpolation. Wikipedia writes in paragraph Polynomial interpolation:

Generally, if we have $n$ data points, there is exactly one polynomial of degree at most $n−1$ going through all the data points.

So, with $4$ distinct points you could to retrieve a cubic polynomial $f(x) = ax^3+bx^2+cx+d$ as interpolating function, and then compute $f(x)$ by simple substitution. I don't know if this is too expensive for you: to determine the coefficients $a,b,c,d$ it is required an inversion of a $4\times 4$ matrix.