6

I've searching the whole day to calculate the inverse function of sinc(x) between -pi and pi , but couldn't find anything:

enter image description here

Does anybody know a way to get the angle value from the a given sinc value ? If it make easier I'm only interested in the area between -pi and pi Thanks in advance for any help.

Community
  • 1
  • 1
Engine
  • 5,360
  • 18
  • 84
  • 162
  • Have a look at this: http://math.stackexchange.com/questions/542353/does-sinc-function-have-any-special-inverse-function-defined – duffymo May 12 '15 at 15:09
  • @duffymo I've read that already, at Mark what do yyou mean – Engine May 12 '15 at 15:10
  • Would you consider using numerical methods? – andand May 12 '15 at 19:02
  • @andand oh yeah I would – Engine May 12 '15 at 19:18
  • @Engine It may behave poorly in places (in particular where the derivative of the function approaches 0), but you might be able to use Newton's Method to approximate zeros of y = sinc(x)-y0 where y0 = sinc(x0) and you're looking for an x0 which satisfies the equation. I haven't tried it and I don't know how well it will converge for some of the initial iterations. But it may be worth a try to see if it works. – andand May 12 '15 at 19:48
  • @andand the approximation sould only work between -pi and pi meaning the first zeros – Engine May 12 '15 at 19:56
  • I'll be greatfull for any hint – Engine May 12 '15 at 19:58
  • @Engine Couple of observations. The first is there are two branches on the interval x in [-pi, pi] so you probably are better served looking on the range [0, pi] instead. The other, is you're finding zeros of sinc(x)-y0 given some value of y0 on the interval [0, 1]. Zeros for sinc(x)-y0 where y0=0 is trivially pi. – andand May 12 '15 at 20:34
  • if you could provide me with a formel,I get a better understand it better – Engine May 12 '15 at 20:42
  • @Engine... detail for what I describe is in the answer below. – andand May 13 '15 at 03:46

2 Answers2

6

In general, even if restricted to small intervals where sinc is bijective (which I don't think is the case for your requirements), it has no simple inverse.

Perhaps you could do one of the following:

  1. You could calculate the inverse "online" using the minimization of of abs(sinc(x) - y) (see, e.g., Numerical Recipes in C. Note that you're in luck as it's a smooth function, and so you can use the derivatives.

  2. Create "offline" a lookup table for various values in the required range, and given an "online" query, interpolate between two pre-calculated results.

Ami Tavory
  • 74,578
  • 11
  • 141
  • 185
1

Newton's Method for finding zeros may be serve as a means to approximate inverses for the sinc function. If we let f(x) = sin(x)/x, then f'(x) = cos(x)/x-sin(x)/x^2 Using Newton's method, we can approximate a zero for f by

 x(n+1) = x(n) - f(x(n)) / f'(x(n))

Depending where we start and as long as we don't come across values where f'(x(n)) = 0 we should find a solution.

If we restrict f to a single branch where x∈(0,π] then f(x)∈[0,1) is bijective and Newton's Method may be useful to finding x0∈(0,π] for a given y0∈[0,1) such that y0=f(x0). We can do this by finding where g(x0)=f(x0)-y0=0. In this case g'(x) = f'(x) since the derivative of y0 is 0. and so we're left with iterating:

 x(n+1) = x(n) - [f(x(n)) - y0] / f'(x(n))

The trick then is to choose a suitable x(0) to start the process. There are likely a number of possible choices, but x(0)=π is probably adequate.

One caveat to this is you will need to guard against the possibility of f'(x(n))=0. This condition should be checked and if it is encountered, a different x(0) should be chosen and the process started again.

andand
  • 17,134
  • 11
  • 53
  • 79
  • 1
    Very good initial values can be obtained from the Taylor approximation `y=sinc(x)=1-t/3!+t²/5!-t²/7!+…` where `t:=x²`. Analytical solutions are available up to quartic order. –  Feb 13 '19 at 10:17