Cosinesum filters for resampling

 Posts: 8
 Joined: 20190827T21:27:3307:00
 Authentication code: 1152
Cosinesum filters for resampling
Cosinesum filters for resampling are filters that are designed as a sum of cosine functions, which is then truncated to a desired width.
An example formula for width4 (range from 2 to 2) cosinesum filters would be:
a+b×cos(90°×input)+c×cos(180°×input)+d×cos(270°×input)+e×cos(450°×input)+f×cos(540°×input)+g×cos(630°×input)+...
Omitting 360°, 720°, etc. because they don't produce a constant when tiled indefinitely. For width6 filters use multiples of 60° instead of 90°.
Those parameters look like some sort of digitization of the Gaussian function: the digital Gaussian is a=0.25, b=0.375, c=0.15, d=0.025.
Those parameters produce a cardinal function (assuming "tensor" resampling) with the first derivative of points at 1 and 1 being set to 0.5 and 0.5 respectively: a=0.25, b=0.45458, c=0.25, d=0.045423
Are such filters already known and researched in the community?
An example formula for width4 (range from 2 to 2) cosinesum filters would be:
a+b×cos(90°×input)+c×cos(180°×input)+d×cos(270°×input)+e×cos(450°×input)+f×cos(540°×input)+g×cos(630°×input)+...
Omitting 360°, 720°, etc. because they don't produce a constant when tiled indefinitely. For width6 filters use multiples of 60° instead of 90°.
Those parameters look like some sort of digitization of the Gaussian function: the digital Gaussian is a=0.25, b=0.375, c=0.15, d=0.025.
Those parameters produce a cardinal function (assuming "tensor" resampling) with the first derivative of points at 1 and 1 being set to 0.5 and 0.5 respectively: a=0.25, b=0.45458, c=0.25, d=0.045423
Are such filters already known and researched in the community?
 fmw42
 Posts: 25664
 Joined: 20070702T17:14:5107:00
 Authentication code: 1152
 Location: Sunnyvale, California, USA
Re: Cosinesum filters for resampling
I have not heard of anything like that for resampling. Can you point to some reference?

 Posts: 12313
 Joined: 20100123T23:01:3307:00
 Authentication code: 1151
 Location: England, UK
Re: Cosinesum filters for resampling
IM has "filter Cosine" for resampling. I don't know if this is the same as the OP.
snibgo's IM pages: im.snibgo.com

 Posts: 8
 Joined: 20190827T21:27:3307:00
 Authentication code: 1152
Re: Cosinesum filters for resampling
"filter Cosine" is using a Cosine window (made with a cosine function) to window the Sinc function to produce the filter. Cosinesum filters are made by adding cosine functions to produce the filter. Those are not the same.
There are some window functions like Hann, Hamming and Blackman that have a cosinesum structure. The same concept could be used for resampling filters.
 fmw42
 Posts: 25664
 Joined: 20070702T17:14:5107:00
 Authentication code: 1152
 Location: Sunnyvale, California, USA
Re: Cosinesum filters for resampling
Yes, but can you point to some reference so that we can see what is being done or is this just some idea of yours with no current background or theory?

 Posts: 8
 Joined: 20190827T21:27:3307:00
 Authentication code: 1152
Re: Cosinesum filters for resampling
This page demonstrates various window functions of the cosinesum structure: https://en.wikipedia.org/wiki/Window_fu ... um_windows
As for the use of the cosinesum structure for resampling filters, this is indeed "with no current background or theory".
Re: Cosinesum filters for resampling
We do include a Hann filter, a member of the cosinesum family, however we do not currently support the generalized cosine window case. You are welcome to contribute a cosinesum filter. Look for FilterFunctions in MagickCore/resize.c to get started.

 Posts: 8
 Joined: 20190827T21:27:3307:00
 Authentication code: 1152
Re: Cosinesum filters for resampling
It would be interesting to research and find out if cosinesum filters (whether "tensor" or "EWA") are any better than windowed Sinc filters and cubic filters.