I've searching the whole day to calculate the inverse function of sinc(x)
between -pi and pi
, but couldn't find anything:
我整天都在搜索-pi和pi之间的sinc(x)的反函数,但找不到任何东西:
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.
有人知道从给定的sinc值获得角度值的方法吗?如果它变得更容易我只对-pi和pi之间的区域感兴趣,请提前感谢您的帮助。
2 个解决方案
#1
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.
一般来说,即使限制在sinc是双射的小间隔(我不认为是你的要求的情况),它也没有简单的逆。
Perhaps you could do one of the following:
也许您可以执行以下操作之一:
-
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.
您可以使用abs(sinc(x) - y)的最小化来计算逆“在线”(参见,例如,C中的数字食谱)请注意,你很幸运,因为它是一个平滑的函数,所以你可以使用衍生品。
-
Create "offline" a lookup table for various values in the required range, and given an "online" query, interpolate between two pre-calculated results.
为所需范围内的各种值创建“离线”查找表,并给出“在线”查询,在两个预先计算的结果之间进行插值。
#2
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
牛顿寻找零的方法可以作为近似sinc函数逆的方法。如果我们让f(x)= sin(x)/ x,那么f'(x)= cos(x)/ x-sin(x)/ x ^ 2使用牛顿方法,我们可以用f逼近零
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.
取决于我们开始的地方,只要我们没有遇到f'(x(n))= 0的值,我们应该找到一个解决方案。
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:
如果我们将f限制为单个分支,其中x∈(0,π)则f(x)∈[0,1)是双射的,而牛顿方法可能对于找到给定y0∈的x0∈(0,π)有用[ 0,1)使得y0 = f(x0)。我们可以通过找到g(x0)= f(x0)-y0 = 0的位置来做到这一点。在这种情况下g'(x)= f'(x),因为y0的导数是0.所以我们留下迭代:
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.
然后,技巧是选择合适的x(0)来启动该过程。可能存在许多可能的选择,但x(0)=π可能是足够的。
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.
有一点需要注意的是,你需要防止f'(x(n))= 0的可能性。应检查此条件,如果遇到此情况,则应选择不同的x(0)并再次启动该过程。
#1
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.
一般来说,即使限制在sinc是双射的小间隔(我不认为是你的要求的情况),它也没有简单的逆。
Perhaps you could do one of the following:
也许您可以执行以下操作之一:
-
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.
您可以使用abs(sinc(x) - y)的最小化来计算逆“在线”(参见,例如,C中的数字食谱)请注意,你很幸运,因为它是一个平滑的函数,所以你可以使用衍生品。
-
Create "offline" a lookup table for various values in the required range, and given an "online" query, interpolate between two pre-calculated results.
为所需范围内的各种值创建“离线”查找表,并给出“在线”查询,在两个预先计算的结果之间进行插值。
#2
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
牛顿寻找零的方法可以作为近似sinc函数逆的方法。如果我们让f(x)= sin(x)/ x,那么f'(x)= cos(x)/ x-sin(x)/ x ^ 2使用牛顿方法,我们可以用f逼近零
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.
取决于我们开始的地方,只要我们没有遇到f'(x(n))= 0的值,我们应该找到一个解决方案。
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:
如果我们将f限制为单个分支,其中x∈(0,π)则f(x)∈[0,1)是双射的,而牛顿方法可能对于找到给定y0∈的x0∈(0,π)有用[ 0,1)使得y0 = f(x0)。我们可以通过找到g(x0)= f(x0)-y0 = 0的位置来做到这一点。在这种情况下g'(x)= f'(x),因为y0的导数是0.所以我们留下迭代:
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.
然后,技巧是选择合适的x(0)来启动该过程。可能存在许多可能的选择,但x(0)=π可能是足够的。
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.
有一点需要注意的是,你需要防止f'(x(n))= 0的可能性。应检查此条件,如果遇到此情况,则应选择不同的x(0)并再次启动该过程。