本文整理汇总了Python中scipy.signal.wiener方法的典型用法代码示例。如果您正苦于以下问题:Python signal.wiener方法的具体用法?Python signal.wiener怎么用?Python signal.wiener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scipy.signal
的用法示例。
在下文中一共展示了signal.wiener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: NCF_denoising
# 需要导入模块: from scipy import signal [as 别名]
# 或者: from scipy.signal import wiener [as 别名]
def NCF_denoising(img_to_denoise,Mdate,Ntau,NSV):
if img_to_denoise.ndim ==2:
M,N = img_to_denoise.shape
if NSV > np.min([M,N]):
NSV = np.min([M,N])
[U,S,V] = svd(img_to_denoise,full_matrices=False)
S = scipy.linalg.diagsvd(S,S.shape[0],S.shape[0])
Xwiener = np.zeros([M,N])
for kk in range(NSV):
SV = np.zeros(S.shape)
SV[kk,kk] = S[kk,kk]
X = U@SV@V
Xwiener += wiener(X,[Mdate,Ntau])
denoised_img = wiener(Xwiener,[Mdate,Ntau])
elif img_to_denoise.ndim ==1:
M = img_to_denoise.shape[0]
NSV = np.min([M,NSV])
denoised_img = wiener(img_to_denoise,Ntau)
temp = np.trapz(np.abs(np.mean(denoised_img) - img_to_denoise))
denoised_img = wiener(img_to_denoise,Ntau,np.mean(temp))
return denoised_img
示例2: test_basic
# 需要导入模块: from scipy import signal [as 别名]
# 或者: from scipy.signal import wiener [as 别名]
def test_basic(self):
g = array([[5,6,4,3],[3,5,6,2],[2,3,5,6],[1,6,9,7]],'d')
h = array([[2.16374269,3.2222222222, 2.8888888889, 1.6666666667],
[2.666666667, 4.33333333333, 4.44444444444, 2.8888888888],
[2.222222222, 4.4444444444, 5.4444444444, 4.801066874837],
[1.33333333333, 3.92735042735, 6.0712560386, 5.0404040404]])
assert_array_almost_equal(signal.wiener(g), h, decimal=6)
assert_array_almost_equal(signal.wiener(g, mysize=3), h, decimal=6)
示例3: test_basic
# 需要导入模块: from scipy import signal [as 别名]
# 或者: from scipy.signal import wiener [as 别名]
def test_basic(self):
g = array([[5, 6, 4, 3],
[3, 5, 6, 2],
[2, 3, 5, 6],
[1, 6, 9, 7]], 'd')
h = array([[2.16374269, 3.2222222222, 2.8888888889, 1.6666666667],
[2.666666667, 4.33333333333, 4.44444444444, 2.8888888888],
[2.222222222, 4.4444444444, 5.4444444444, 4.801066874837],
[1.33333333333, 3.92735042735, 6.0712560386, 5.0404040404]])
assert_array_almost_equal(signal.wiener(g), h, decimal=6)
assert_array_almost_equal(signal.wiener(g, mysize=3), h, decimal=6)
示例4: flt
# 需要导入模块: from scipy import signal [as 别名]
# 或者: from scipy.signal import wiener [as 别名]
def flt(mat):
whitened = wiener(mat)
# whitened = PCA(whiten=True).fit_transform(np.matrix(mat).T).flatten()
return whitened