當前位置: 首頁>>代碼示例>>Python>>正文


Python signal.wiener方法代碼示例

本文整理匯總了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 
開發者ID:mdenolle,項目名稱:NoisePy,代碼行數:26,代碼來源:noise_module.py

示例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) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:10,代碼來源:test_signaltools.py

示例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) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:13,代碼來源:test_signaltools.py

示例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 
開發者ID:jramapuram,項目名稱:LSTM_Anomaly_Detector,代碼行數:6,代碼來源:data_manipulator.py


注:本文中的scipy.signal.wiener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。