Engine
Engine

Reputation: 5432

what is the inverse function of Sinc

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.

Upvotes: 6

Views: 10099

Answers (2)

andand
andand

Reputation: 17497

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.

Upvotes: 1

Ami Tavory
Ami Tavory

Reputation: 76366

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.

Upvotes: 6

Related Questions