Piecewise quadratic interpolation in a symmetric manner

166 Views Asked by At

I am trying to derive a reasonable symmetric interpolant for quadratic $C^0$ interpolation. For odd degrees I have no trouble since things are symmetric. For example for a piecewise cubic interpolant I could define it in each interval $[x_{i-1},x_i]$ to be the cubic polynomial passing through $(x_{i-2},y_{i-2}),\, (x_{i-1},y_{i-1}), \,(x_{i},y_i),\, (x_{i+1},y_{i+1})$. For odd degrees this results in $C^{k-2}$ continuity, where $k$ is the degree of the polynomial. I am aware that I can construct a $C^{k-1}$ interpolant if I additionally solve a linear system of equations, but due to performance considerations I have decided to avoid this.

The issue is that the even degree case is not symmetric. For example I am not sure what constraints would make sense for piecewise quadratic interpolation. If for an interval $[x_{i-1}, x_i]$ I were to take the quadratic polynomial passing through $(x_{i-1}, y_{i-1}),\, (x_i, y_i), \, (x_{i+1},y_{i+1})$ then this emphasizes $(x_{i+1},y_{i+1})$ while it ignores $(x_{i-2}, y_{i-2})$. On the other hand if I were to take the quadratic polynomial passing through $(x_{i-2}, y_{i-2}), \,(x_{i-1}, y_{i-1}),\, (x_i, y_i)$ then this emphasizes $(x_{i-2}, y_{i-2})$ and ignores $(x_{i+1}, y_{i+1})$. Is there some standard approach for constructing a symmetric constraint that doesn't involve solving a system of linear equations for the global piecewise interpolant?

I want the piecewise interpolant in the interval $[x_{i-1}, x_i]$ to pass through $(x_{i-1},y_{i-1})$ and $(x_i, y_i)$, which leaves me with 1 parameter. Ideally I want to determine said parameter symmetrically from both $(x_{i-2},y_{i-2})$ and $(x_{i+1}, y_{i+1})$.

2

There are 2 best solutions below

4
On BEST ANSWER

The following is not standard, as far as I know, but it might work.

We’re interested in how to construct a quadratic interpolant $Q(x)$ on $[x_{i-1}, x_i]$. Let $z=\tfrac12(x_{i-1} + x_i)$. If we could decide a suitable value for $Q(z)$, we’d be done.

So, let $A(x)$ be the quadratic interpolant through $x_{i-2}, x_{i-1}, x_i$, let $B(x)$ be the interpolant through $x_{i-1}, x_i, x_{i+1}$, and let $Q(z) = \tfrac12 (A(z) + B(z))$.

That’s symmetric, at least.

0
On

I also tried deriving an interpolating synthesis function by analogy to how it is done in Keys' paper Cubic convolution interpolation for digital image processing. Granted there are multiple choices so I am not claiming that what I derived is the best in any sense of the word.

For a synthesis function (on a regular grid) one typically desires symmetry around $0$, interpolation at the different points, and smoothness.

Taking into account symmetry, it is enough to only consider the intervals $[0,1]$ and $[1,2]$ and fit a quadratic functions within each: $u_1(x) = a_1x^2 + b_1x + c_1$ and $u_2(x) = a_2x^2 + b_2x + c_2$. Then the symmetric versions would have minuses in front of the odd degrees. The interpolating conditions read:

$$u_1(0) = 1, \, u_1(1) = 0, \, u_2(1) = 0, \, u_2(2) = 0$$ $$c_1 = 1, \, a_1+b_1 = -1, \, a_2+b_2+c_2 = 0, 4a_2 + 2b_2 + c_2 = 0$$

I can additionally require that $u_1'(0) = 0$ resulting in $b_1 = 0$ which yields:

$$u_1(x) = -x^2+1.$$

Furthermore I can require that $u_1'(1) = -2 = u_2'(1) = 2a_2 + b_2$. Solving for $a_2, b_2, c_2$ yields:

$$u_2(x) = 2x^2-6x+4.$$

Ultimately the synthesis function is:

$$\phi_2(x) = \begin{cases} -x^2+1 & |x| \leq 1 \\ 2x^2-6|x|+4 & 1 \leq |x| \leq 2 \\ 0 & |x| > 2\end{cases}$$

It has the following shape:

Quadratic synthesis function

The $\frac{1}{2}$ version that bubba suggested results in the synthesis function:

$$\phi_2(x) = \begin{cases} -\frac{1}{4}x^2-\frac{3}{4}|x|+1 & |x| \leq 1 \\ \frac{1}{4}x^2-\frac{3}{4}|x|+\frac{1}{2} & 1 \leq |x| \leq 2 \\ 0 & |x| > 2\end{cases}$$

This seems to match quite well what one should expect from Lagrange interpolating functions (I discuss some details here, also using the idea of bubba Constructing $C^{k−2}$ and $C^{k−1}$ splines on a regular grid through convolution). The shape of the synthesis function is:

enter image description here