colour.kernel_lanczos#

colour.kernel_lanczos(x: ArrayLike, a: float = 3) NDArrayFloat[source]#

Return the Lanczos kernel evaluated at specified samples.

The Lanczos kernel is a sinc-based windowing function commonly used in signal processing and image resampling applications. It is defined as \(L(x) = \text{sinc}(x) \cdot \text{sinc}(x/a)\) for \(|x| < a\), and zero otherwise.

Parameters:
  • x (ArrayLike) – Samples at which to evaluate the Lanczos kernel.

  • a (float) – Size of the Lanczos kernel, defining the support region \([-a, a]\).

Returns:

The Lanczos kernel evaluated at specified samples.

Return type:

numpy.ndarray

References

[Wikipedia05a]

Examples

>>> kernel_lanczos(np.linspace(0, 1, 10))
array([  1.0000000...e+00,   9.7760615...e-01,   9.1243770...e-01,
         8.1030092...e-01,   6.8012706...e-01,   5.3295773...e-01,
         3.8071690...e-01,   2.3492839...e-01,   1.0554054...e-01,
         3.2237621...e-17])