<s>
Lanczos	O
filtering	O
and	O
Lanczos	B-Algorithm
resampling	I-Algorithm
are	O
two	O
applications	O
of	O
a	O
mathematical	O
formula	O
.	O
</s>
<s>
It	O
can	O
be	O
used	O
as	O
a	O
low-pass	B-Algorithm
filter	I-Algorithm
or	O
used	O
to	O
smoothly	O
interpolate	B-Algorithm
the	O
value	O
of	O
a	O
digital	O
signal	O
between	O
its	O
samples	B-Algorithm
.	O
</s>
<s>
In	O
the	O
latter	O
case	O
,	O
it	O
maps	O
each	O
sample	O
of	O
the	O
given	O
signal	O
to	O
a	O
translated	O
and	O
scaled	O
copy	O
of	O
the	O
Lanczos	B-Algorithm
kernel	I-Algorithm
,	O
which	O
is	O
a	O
sinc	B-Algorithm
function	I-Algorithm
windowed	B-Language
by	O
the	O
central	O
lobe	O
of	O
a	O
second	O
,	O
longer	O
,	O
sinc	B-Algorithm
function	I-Algorithm
.	O
</s>
<s>
Lanczos	B-Algorithm
resampling	I-Algorithm
is	O
typically	O
used	O
to	O
increase	O
the	O
sampling	O
rate	O
of	O
a	O
digital	O
signal	O
,	O
or	O
to	O
shift	O
it	O
by	O
a	O
fraction	O
of	O
the	O
sampling	O
interval	O
.	O
</s>
<s>
It	O
is	O
often	O
used	O
also	O
for	O
multivariate	O
interpolation	B-Algorithm
,	O
for	O
example	O
to	O
resize	B-Algorithm
or	O
rotate	B-General_Concept
a	O
digital	B-Algorithm
image	I-Algorithm
.	O
</s>
<s>
The	O
effect	O
of	O
each	O
input	O
sample	O
on	O
the	O
interpolated	O
values	O
is	O
defined	O
by	O
the	O
filter	O
's	O
reconstruction	B-Algorithm
kernel	I-Algorithm
,	O
called	O
the	O
Lanczos	B-Algorithm
kernel	I-Algorithm
.	O
</s>
<s>
It	O
is	O
the	O
normalized	B-Algorithm
sinc	I-Algorithm
function	I-Algorithm
,	O
windowed	B-Language
(	O
multiplied	O
)	O
by	O
the	O
Lanczos	O
window	O
,	O
or	O
sinc	B-Algorithm
window	O
,	O
which	O
is	O
the	O
central	O
lobe	O
of	O
a	O
horizontally	O
stretched	O
sinc	B-Algorithm
function	I-Algorithm
for	O
.	O
</s>
<s>
The	O
Lanczos	B-Algorithm
kernel	I-Algorithm
has	O
lobes	O
:	O
a	O
positive	O
one	O
at	O
the	O
center	O
,	O
and	O
alternating	O
negative	O
and	O
positive	O
lobes	O
on	O
each	O
side	O
.	O
</s>
<s>
Given	O
a	O
one-dimensional	O
signal	O
with	O
samples	B-Algorithm
,	O
for	O
integer	O
values	O
of	O
,	O
the	O
value	O
interpolated	O
at	O
an	O
arbitrary	O
real	O
argument	O
is	O
obtained	O
by	O
the	O
discrete	O
convolution	B-Language
of	O
those	O
samples	B-Algorithm
with	O
the	O
Lanczos	B-Algorithm
kernel	I-Algorithm
:	O
</s>
<s>
As	O
long	O
as	O
the	O
parameter	O
is	O
a	O
positive	O
integer	O
,	O
the	O
Lanczos	B-Algorithm
kernel	I-Algorithm
is	O
continuous	O
everywhere	O
,	O
and	O
its	O
derivative	B-Algorithm
is	O
defined	O
and	O
continuous	O
everywhere	O
(	O
even	O
at	O
,	O
where	O
both	O
sinc	B-Algorithm
functions	I-Algorithm
go	O
to	O
zero	O
)	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
reconstructed	O
signal	O
too	O
will	O
be	O
continuous	O
,	O
with	O
continuous	O
derivative	B-Algorithm
.	O
</s>
<s>
The	O
Lanczos	B-Algorithm
kernel	I-Algorithm
is	O
zero	O
at	O
every	O
integer	O
argument	O
,	O
except	O
at	O
,	O
where	O
it	O
has	O
value	O
1	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
reconstructed	O
signal	O
exactly	O
interpolates	O
the	O
given	O
samples	B-Algorithm
:	O
we	O
will	O
have	O
for	O
every	O
integer	O
argument	O
.	O
</s>
<s>
Lanczos	B-Algorithm
resampling	I-Algorithm
is	O
one	O
form	O
of	O
a	O
general	O
method	O
developed	O
by	O
Lanczos	O
to	O
counteract	O
the	O
Gibbs	O
phenomenon	O
by	O
multiplying	O
coefficients	O
of	O
a	O
truncated	O
Fourier	O
series	O
by	O
,	O
where	O
is	O
the	O
coefficient	O
index	O
and	O
is	O
how	O
many	O
coefficients	O
we	O
're	O
keeping	O
.	O
</s>
<s>
The	O
theoretically	O
optimal	O
reconstruction	O
filter	O
for	O
band-limited	O
signals	O
is	O
the	O
sinc	B-Algorithm
filter	I-Algorithm
,	O
which	O
has	O
infinite	O
support	O
.	O
</s>
<s>
The	O
Lanczos	B-Algorithm
filter	I-Algorithm
is	O
one	O
of	O
many	O
practical	O
(	O
finitely	O
supported	O
)	O
approximations	O
of	O
the	O
sinc	B-Algorithm
filter	I-Algorithm
.	O
</s>
<s>
Each	O
interpolated	O
value	O
is	O
the	O
weighted	O
sum	O
of	O
consecutive	O
input	O
samples	B-Algorithm
.	O
</s>
<s>
The	O
parameter	O
also	O
allows	O
one	O
to	O
choose	O
between	O
a	O
smoother	O
interpolation	B-Algorithm
or	O
a	O
preservation	O
of	O
sharp	O
transients	O
in	O
the	O
data	O
.	O
</s>
<s>
For	O
image	O
processing	O
,	O
the	O
trade-off	O
is	O
between	O
the	O
reduction	O
of	O
aliasing	B-Error_Name
artefacts	O
and	O
the	O
preservation	O
of	O
sharp	O
edges	O
.	O
</s>
<s>
The	O
Lanczos	B-Algorithm
filter	I-Algorithm
has	O
been	O
compared	O
with	O
other	O
interpolation	B-Algorithm
methods	O
for	O
discrete	O
signals	O
,	O
particularly	O
other	O
windowed	B-Language
versions	O
of	O
the	O
sinc	B-Algorithm
filter	I-Algorithm
.	O
</s>
<s>
Turkowski	O
and	O
Gabriel	O
claimed	O
that	O
the	O
Lanczos	B-Algorithm
filter	I-Algorithm
(	O
with	O
)	O
the	O
"	O
best	O
compromise	O
in	O
terms	O
of	O
reduction	O
of	O
aliasing	B-Error_Name
,	O
sharpness	O
,	O
and	O
minimal	O
ringing	O
"	O
,	O
compared	O
with	O
truncated	O
sinc	B-Algorithm
and	O
the	O
Bartlett	O
,	O
cosine-	O
,	O
and	O
Hann-windowed	O
sinc	B-Algorithm
,	O
for	O
decimation	O
and	O
interpolation	B-Algorithm
of	O
2-dimensional	O
image	O
data	O
.	O
</s>
<s>
According	O
to	O
Jim	O
Blinn	O
,	O
the	O
Lanczos	B-Algorithm
kernel	I-Algorithm
(	O
with	O
)	O
"	O
keeps	O
low	O
frequencies	O
and	O
rejects	O
high	O
frequencies	O
better	O
than	O
any	O
(	O
achievable	O
)	O
filter	O
we	O
've	O
seen	O
so	O
far.	O
"	O
</s>
<s>
Lanczos	B-Algorithm
interpolation	I-Algorithm
is	O
a	O
popular	O
filter	O
for	O
"	O
upscaling	O
"	O
videos	O
in	O
various	O
media	O
utilities	O
,	O
such	O
as	O
AviSynth	B-Application
and	O
FFmpeg	B-Library
.	O
</s>
<s>
Since	O
the	O
kernel	O
assumes	O
negative	O
values	O
for	O
,	O
the	O
interpolated	O
signal	O
can	O
be	O
negative	O
even	O
if	O
all	O
samples	B-Algorithm
are	O
positive	O
.	O
</s>
<s>
In	O
particular	O
,	O
there	O
may	O
be	O
ringing	B-Algorithm
artifacts	I-Algorithm
just	O
before	O
and	O
after	O
abrupt	O
changes	O
in	O
the	O
sample	O
values	O
,	O
which	O
may	O
lead	O
to	O
clipping	B-Algorithm
artifacts	I-Algorithm
.	O
</s>
<s>
However	O
,	O
these	O
effects	O
are	O
reduced	O
compared	O
to	O
the	O
(	O
non-windowed	O
)	O
sinc	B-Algorithm
filter	I-Algorithm
.	O
</s>
<s>
The	O
method	O
is	O
one	O
of	O
the	O
interpolation	B-Algorithm
options	O
available	O
in	O
the	O
free	O
software	O
GNU	B-Application
Image	I-Application
Manipulation	I-Application
Program	I-Application
(	O
GIMP	B-Application
)	O
.	O
</s>
<s>
One	O
way	O
to	O
visualize	O
the	O
ringing	O
effect	O
is	O
to	O
rescale	O
a	O
black	O
and	O
white	O
block	O
graphic	O
and	O
select	O
Lanczos	B-Algorithm
interpolation	I-Algorithm
.	O
</s>
<s>
When	O
using	O
the	O
Lanczos	B-Algorithm
filter	I-Algorithm
for	O
image	B-Algorithm
resampling	I-Algorithm
,	O
the	O
ringing	O
effect	O
will	O
create	O
light	O
and	O
dark	O
halos	O
along	O
any	O
strong	O
edges	O
.	O
</s>
<s>
While	O
these	O
bands	O
may	O
be	O
visually	O
annoying	O
,	O
they	O
help	O
increase	O
the	O
perceived	B-Algorithm
sharpness	I-Algorithm
,	O
and	O
therefore	O
provide	O
a	O
form	O
of	O
edge	B-Algorithm
enhancement	I-Algorithm
.	O
</s>
<s>
In	O
some	O
applications	O
,	O
the	O
low-end	O
clipping	B-Algorithm
artifacts	I-Algorithm
can	O
be	O
ameliorated	O
by	O
transforming	O
the	O
data	O
to	O
a	O
logarithmic	O
domain	O
prior	O
to	O
filtering	O
.	O
</s>
<s>
In	O
this	O
case	O
the	O
interpolated	O
values	O
will	O
be	O
a	O
weighted	O
geometric	O
mean	O
,	O
rather	O
than	O
an	O
arithmetic	O
mean	O
,	O
of	O
the	O
input	O
samples	B-Algorithm
.	O
</s>
<s>
The	O
Lanczos	B-Algorithm
kernel	I-Algorithm
does	O
not	O
have	O
the	O
partition	O
of	O
unity	O
property	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
Lanczos	B-Algorithm
interpolation	I-Algorithm
of	O
a	O
discrete	O
signal	O
with	O
constant	O
samples	B-Algorithm
does	O
not	O
yield	O
a	O
constant	O
function	O
.	O
</s>
<s>
Also	O
,	O
for	O
the	O
interpolated	O
signal	O
has	O
zero	O
derivative	B-Algorithm
at	O
every	O
integer	O
argument	O
.	O
</s>
