# Optimal non-negative resampling kernel

Sampling theory says the best kernel for resampling is $$sinc(x)$$ which is box function in frequency domain. Which kernel is optimal under constraint that the kernel is non-negative everywhere?

More formally:

$$f(x)$$ is a real-valued non-negative symmetric function.

$$F(s)$$ is its Fourier transform: $$F(s) = \int_{-\infty}^{+\infty} f(x) e^{-2 \pi i s x}dx$$

Find $$f(x)$$ to minimize weighted L2 diff:

$$err = \int_{-\infty}^{+\infty} W(s) (F(s) - Box(s))^2 ds$$

where $$W(s)$$ is a weight function: $$W(s) \geq 0, \int_{-\infty}^{+\infty} W(s) = 1$$

and $$Box(s)$$ is the target response: $$Box(s) = [|s| \leq 1/2]$$

Less formally: The standard resampling kernel has ringing artifacts at object boundaries (Gibbs effect), which is especially unpleasant when resampling unsigned data such as masks or weights. But it's still desirable to keep as much resolution as possible when downsampling.