Author Topic: Sinc function  (Read 4153 times)

Offline darkownt

  • PixInsight Enthusiast
  • **
  • Posts: 92
Sinc function
« on: 2009 December 05 09:42:48 »
Hi:

I'd like the Sinc(x) function added to the math functions of PixelMath.

Its quite useful in its own right and has an interesting relationship with fourier transforms, sampling, the dirac delta function, and deconvolution ringing.

http://en.wikipedia.org/wiki/Sinc_function

The Definition of Sinc(x) is : Sinc(x) = 1 at x=0 and Sinc(x) = Sin(x)/x everywhere else.

It's a little unweildy to use in PixelMath right now because I have to use something like Sin(x+0.0000001)/(x+0.0000001), to avoid the singularity.

Of course in JavaScript a function can easily deal with this.


cheers
Colin


Offline darkownt

  • PixInsight Enthusiast
  • **
  • Posts: 92
Re: Sinc function
« Reply #1 on: 2009 December 05 09:49:40 »
Whups, I found that I can use the inline iff function.

iff(r(),sin(r())/r(),1)

cheers
Colin