本文整理汇总了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]