本文整理汇总了Python中scipy.special.i1方法的典型用法代码示例。如果您正苦于以下问题:Python special.i1方法的具体用法?Python special.i1怎么用?Python special.i1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scipy.special
的用法示例。
在下文中一共展示了special.i1方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: estimate_kappa
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def estimate_kappa(N, ssx, scx):
if N == 0:
return 10.**-6
elif N == 1:
return 10*pi
else:
rbar2 = (ssx / N) ** 2. + (scx / N) ** 2.
rbar = rbar2 ** .5
kappa = rbar*(2. - rbar2) / (1. - rbar2)
A_p = lambda k : bessel_1(k) / bessel_0(k)
Apk = A_p(kappa)
kappa_1 = kappa - (Apk - rbar)/(1. - Apk**2 - (1. / kappa) * Apk)
Apk = A_p(kappa_1)
kappa = kappa_1 - (Apk - rbar)/(1. - Apk**2 - (1. / kappa_1) * Apk)
Apk = A_p(kappa)
kappa_1 = kappa - (Apk - rbar)/(1. - Apk**2 - (1. / kappa) * Apk)
Apk = A_p(kappa_1)
kappa = kappa_1 - (Apk - rbar)/(1. - Apk**2 - (1. / kappa_1) * Apk)
if isnan(kappa):
return 10.**-6
else:
return abs(kappa)
示例2: mmse_stsa
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def mmse_stsa(xi, gamma):
"""
Computes the MMSE-STSA gain function.
Argument/s:
xi - a priori SNR.
gamma - a posteriori SNR.
Returns:
G - MMSE-STSA gain function.
"""
nu = np.multiply(xi, np.divide(gamma, np.add(1, xi)))
G = np.multiply(np.multiply(np.multiply(np.divide(np.sqrt(np.pi), 2),
np.divide(np.sqrt(nu), gamma)), np.exp(np.divide(-nu,2))),
np.add(np.multiply(np.add(1, nu), i0(np.divide(nu,2))),
np.multiply(nu, i1(np.divide(nu, 2))))) # MMSE-STSA gain function.
idx = np.isnan(G) | np.isinf(G) # replace by Wiener gain.
G[idx] = np.divide(xi[idx], np.add(1, xi[idx])) # Wiener gain.
return G
示例3: _entropy
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def _entropy(self, kappa):
return (-kappa * sc.i1(kappa) / sc.i0(kappa) +
np.log(2 * np.pi * sc.i0(kappa)))
示例4: test_i1
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def test_i1(self):
assert_equal(cephes.i1(0),0.0)
示例5: test_i1_series
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def test_i1_series(self):
for z in [1., 10., 200.5]:
value, err = self.iv_series(1, z)
assert_tol_equal(special.i1(z), value, atol=err, err_msg=z)
示例6: test_i1_series
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def test_i1_series(self):
for z in [1., 10., 200.5]:
value, err = self.iv_series(1, z)
assert_allclose(special.i1(z), value, atol=err, err_msg=z)
示例7: cy_bispev
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def cy_bispev(tx, ty, c, kx, ky, x, y):
'''Possible optimization: Do not evaluate derivatives, ever.
'''
nx = len(tx)
ny = len(ty)
mx = len(x)
my = len(y)
kx1 = kx + 1
ky1 = ky + 1
nkx1 = nx - kx1
nky1 = ny - ky1
wx = [[0.0]*kx1]*mx
wy = [[0.0]*ky1]*my
lx = [0]*mx
ly = [0]*my
size_z = mx*my
z = [0.0]*size_z
init_w(tx, kx, x, lx, wx)
init_w(ty, ky, y, ly, wy)
for j in range(my):
for i in range(mx):
sp = 0.0
err = 0.0
for i1 in range(kx1):
for j1 in range(ky1):
l2 = lx[i]*nky1 + ly[j] + i1*nky1 + j1
a = c[l2]*wx[i][i1]*wy[j][j1] - err
tmp = sp + a
err = (tmp - sp) - a
sp = tmp
z[j*mx + i] += sp
return z
示例8: i1
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def i1(*args, **kwargs):
from scipy.special import i1
return i1(*args, **kwargs)
示例9: erf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def erf(*args, **kwargs):
from scipy.special import erf
return erf(*args, **kwargs)
# from scipy.special import lambertw, ellipe, gammaincc, gamma # fluids
# from scipy.special import i1, i0, k1, k0, iv # ht
# from scipy.special import hyp2f1
# if erf is None:
# from scipy.special import erf