These filters are defined differently but are very similar in spatial domain. The Lanczos function is defined by:
It shows very strong anti-aliasing properties in Fourier domain, and is easily computed in spatial domain. It is possible to extend this function to superior orders if the kernel is enlarged to use more neighbouring pixels.
The tanh kernel derives from the approximation of an ideal box filter by a product of symmetric tanh functions. Let us define in Fourier space:
Figure 9 shows Hk for several values of k.
Increasing k tends to make Hk converge towards the ideal box filter, thus leads to more ringing in spatial domain. The main difference is that this function decays towards 0 as e-x, which is extremely fast and allows using small pixel neighbourhoods for resampling.
It is not easy to calculate the formal expression of the inverse Fourier transform for this filter. Instead, its expression is numerically computed by digital Fourier transform on enough points to have the kernel on the required number of tabulations.
Figure 10 shows Lanczos and scaled hyperbolic tangent kernels in the image domain.