[{"@context":"http:\/\/schema.org\/","@type":"BlogPosting","@id":"https:\/\/wiki.edu.vn\/en\/wiki13\/lanczos-resampling-wikipedia\/#BlogPosting","mainEntityOfPage":"https:\/\/wiki.edu.vn\/en\/wiki13\/lanczos-resampling-wikipedia\/","headline":"Lanczos resampling – Wikipedia","name":"Lanczos resampling – Wikipedia","description":"before-content-x4 Application of a mathematical formula after-content-x4 Partial plot of a discrete signal (black dots) and of its Lanczos interpolation","datePublished":"2022-11-22","dateModified":"2022-11-22","author":{"@type":"Person","@id":"https:\/\/wiki.edu.vn\/en\/wiki13\/author\/lordneo\/#Person","name":"lordneo","url":"https:\/\/wiki.edu.vn\/en\/wiki13\/author\/lordneo\/","image":{"@type":"ImageObject","@id":"https:\/\/secure.gravatar.com\/avatar\/44a4cee54c4c053e967fe3e7d054edd4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/44a4cee54c4c053e967fe3e7d054edd4?s=96&d=mm&r=g","height":96,"width":96}},"publisher":{"@type":"Organization","name":"Enzyklop\u00e4die","logo":{"@type":"ImageObject","@id":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","url":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","width":600,"height":60}},"image":{"@type":"ImageObject","@id":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/e\/e7\/Lanczos-r01-filtering.svg\/320px-Lanczos-r01-filtering.svg.png","url":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/e\/e7\/Lanczos-r01-filtering.svg\/320px-Lanczos-r01-filtering.svg.png","height":"142","width":"320"},"url":"https:\/\/wiki.edu.vn\/en\/wiki13\/lanczos-resampling-wikipedia\/","wordCount":4301,"articleBody":" (adsbygoogle = window.adsbygoogle || []).push({});before-content-x4Application of a mathematical formula (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4Partial plot of a discrete signal (black dots) and of its Lanczos interpolation (solid blue curve), with size parameter a equal to 1 (top), 2 (middle) and 3 (bottom). Also shown are two copies of the Lanczos kernel, shifted and scaled, corresponding to samples 4 and 11 (dashed curves).Lanczos filtering and Lanczos resampling are two applications of a mathematical formula. It can be used as a low-pass filter or used to smoothly interpolate the value of a digital signal between its samples. In the latter case, it maps each sample of the given signal to a translated and scaled copy of the Lanczos kernel, which is a sinc function windowed by the central lobe of a second, longer, sinc function. The sum of these translated and scaled kernels is then evaluated at the desired points.Lanczos resampling is typically used to increase the sampling rate of a digital signal, or to shift it by a fraction of the sampling interval. It is often used also for multivariate interpolation, for example to resize or rotate a digital image. It has been considered the “best compromise” among several simple filters for this purpose.[1] (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4The filter is named after its inventor, Cornelius Lanczos (Hungarian pronunciation:\u00a0[\u02c8la\u02d0nt\u0361so\u0283]).Table of ContentsDefinition[edit]Lanczos kernel[edit]Interpolation formula[edit]Properties[edit]Multidimensional interpolation[edit]Evaluation[edit]Advantages[edit]Limitations[edit]See also[edit]References[edit]External links[edit]Definition[edit]Lanczos kernel[edit] (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4Lanczos windows for a = 1, 2, 3. Lanczos kernels for the cases a = 2 and a = 3. Note that the function obtains negative values.The effect of each input sample on the interpolated values is defined by the filter’s reconstruction kernel L(x), called the Lanczos kernel. It is the normalized sinc function sinc(x), windowed (multiplied) by the Lanczos window, or sinc window, which is the central lobe of a horizontally stretched sinc function sinc(x\/a) for \u2212a \u2264 x \u2264 a.L(x)={sinc\u2061(\u03c0x)sinc\u2061(\u03c0x\/a)if\u00a0\u2212ax)sin\u2061(\u03c0x\/a)\u03c02x2if\u00a0\u2212a\u2264xi=\u230ax\u230b\u2212a+1\u230ax\u230b+asiL(x\u2212i),{displaystyle S(x)=sum _{i=lfloor xrfloor -a+1}^{lfloor xrfloor +a}s_{i}L(x-i),}where a is the filter size parameter, and \u230ax\u230b{displaystyle lfloor xrfloor } is the floor function. The bounds of this sum are such that the kernel is zero outside of them.Properties[edit]As long as the parameter a is a positive integer, the Lanczos kernel is continuous everywhere, and its derivative is defined and continuous everywhere (even at x = \u00b1a, where both sinc functions go to zero). Therefore, the reconstructed signal S(x) too will be continuous, with continuous derivative.The Lanczos kernel is zero at every integer argument x, except at x = 0, where it has value 1. Therefore, the reconstructed signal exactly interpolates the given samples: we will have S(x) = si for every integer argument x = i.Lanczos resampling is one form of a general method developed by Lanczos to counteract the Gibbs phenomenon by multiplying coefficients of a truncated Fourier series by sinc(\u03c0k\/m){displaystyle mathrm {sinc} (pi k\/m)}, where k{displaystyle k} is the coefficient index and m{displaystyle m} is how many coefficients we’re keeping.[3] The same reasoning applies in the case of truncated functions if we wish to remove Gibbs oscillations in their spectrum.Multidimensional interpolation[edit] The incipit of a black-and-white image. Original, low-quality expansion with JPEG artifacts. The same image resampled to five times as many samples in each direction, using Lanczos resampling. Pixelation artifacts were removed changing the image’s transfer function.Lanczos filter’s kernel in two dimensions isL(x,y)=L(x)L(y).{displaystyle L(x,y)=L(x)L(y).}Evaluation[edit]Advantages[edit] The theoretically optimal reconstruction filter for band-limited signals is the sinc filter, which has infinite support. The Lanczos filter is one of many practical (finitely supported) approximations of the sinc filter. Each interpolated value is the weighted sum of 2a consecutive input samples. Thus, by varying the 2a parameter one may trade computation speed for improved frequency response. The parameter also allows one to choose between a smoother interpolation or a preservation of sharp transients in the data. For image processing, the trade-off is between the reduction of aliasing artefacts and the preservation of sharp edges. Also as with any such processing, there are no results for the borders of the image. Increasing the length of the kernel increases the cropping of the edges of the image.The Lanczos filter has been compared with other interpolation methods for discrete signals, particularly other windowed versions of the sinc filter. Turkowski and Gabriel claimed that the Lanczos filter (with a = 2) the “best compromise in terms of reduction of aliasing, sharpness, and minimal ringing”, compared with truncated sinc and the Bartlett, cosine-, and Hann-windowed sinc, for decimation and interpolation of 2-dimensional image data.[1] According to Jim Blinn, the Lanczos kernel (with a = 3) “keeps low frequencies and rejects high frequencies better than any (achievable) filter we’ve seen so far.”[4]Lanczos interpolation is a popular filter for “upscaling” videos in various media utilities, such as AviSynth[5] and FFmpeg.[6]Limitations[edit]Since the kernel assumes negative values for a > 1, the interpolated signal can be negative even if all samples are positive. More generally, the range of values of the interpolated signal may be wider than the range spanned by the discrete sample values. In particular, there may be ringing artifacts just before and after abrupt changes in the sample values, which may lead to clipping artifacts. However, these effects are reduced compared to the (non-windowed) sinc filter. For a\u00a0=\u00a02 (a three-lobed kernel) the ringing is\u00a0ZL(x\u2212i){textstyle U(x)=sum _{iin mathbb {Z} }L(x-i)} of all integer-translated copies of the kernel is not always 1. Therefore, the Lanczos interpolation of a discrete signal with constant samples does not yield a constant function. This defect is most evident when\u00a0a = 1. Also, for a = 1 the interpolated signal has zero derivative at every integer argument. This is rather academic, since using a single-lobe kernel (a\u00a0=\u00a01) loses all the benefits of the Lanczos approach and provides a poor filter. There are many better single-lobe, bell-shaped windowing functions.See also[edit]References[edit]External links[edit]Anti-Grain Geometry examples: image_filters.cpp shows comparisons of repeatedly resampling an image with various kernels.imageresampler: A public domain image resampling class in C++ with support for several windowed Lanczos filter kernels. (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4"},{"@context":"http:\/\/schema.org\/","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/wiki.edu.vn\/en\/wiki13\/#breadcrumbitem","name":"Enzyklop\u00e4die"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/wiki.edu.vn\/en\/wiki13\/lanczos-resampling-wikipedia\/#breadcrumbitem","name":"Lanczos resampling – Wikipedia"}}]}]