本文整理匯總了Python中scipy.linalg.hankel方法的典型用法代碼示例。如果您正苦於以下問題:Python linalg.hankel方法的具體用法?Python linalg.hankel怎麽用?Python linalg.hankel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類scipy.linalg
的用法示例。
在下文中一共展示了linalg.hankel方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ts_vector_to_trajectory_matrix
# 需要導入模塊: from scipy import linalg [as 別名]
# 或者: from scipy.linalg import hankel [as 別名]
def ts_vector_to_trajectory_matrix(timeseries, L, K):
hankelized = hankel(timeseries, np.zeros(L)).T
hankelized = hankelized[:, :K]
return hankelized
示例2: hankel_weights_
# 需要導入模塊: from scipy import linalg [as 別名]
# 或者: from scipy.linalg import hankel [as 別名]
def hankel_weights_(self):
'''The hankel weights are used to calculate the weighted correlation
between components'''
weights = construct_hankel_weights(
self.L_,
self.K_,
self.N_
)
weights = weights.astype(float)
return weights
示例3: update
# 需要導入模塊: from scipy import linalg [as 別名]
# 或者: from scipy.linalg import hankel [as 別名]
def update(self, x_n, d_n):
'''
Updates the adaptive filter with a new sample
Parameters
----------
x_n: float
the new input sample
d_n: float
the new noisy reference signal
'''
# Update the internal buffers
self.n += 1
slot = self.L - ((self.n-1) % self.L) - 1
self.x[slot] = x_n
self.d[slot] = d_n
# Block update
if self.n % self.L == 0:
# block-update parameters
X = la.hankel(self.x[:self.L],r=self.x[self.L-1:])
e = self.d - np.dot(X, self.w)
if self.nlms:
norm = np.linalg.norm(X, axis=1)**2
if self.L == 1:
X = X/norm[0]
else:
X = (X.T/norm).T
self.w += self.mu*np.dot(X.T, e)
# Remember a few values
self.x[-self.length+1:] = self.x[0:self.length-1]