analog.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:nengolib 作者: arvoelke 项目源码 文件源码
def _proper_delay(q, c):
    """Analytically derived state-space when p = q - 1.

    We use this because it is numerically stable for high q
    and doesn't have a passthrough.
    """
    j = np.arange(q, dtype=np.float64)
    u = (q + j) * (q - j) / (c * (j + 1))

    A = np.zeros((q, q))
    B = np.zeros((q, 1))
    C = np.zeros((1, q))
    D = np.zeros((1,))

    A[0, :] = -u[0]
    B[0, 0] = u[0]
    A[1:, :-1][np.diag_indices(q-1)] = u[1:]
    C[0, :] = (j + 1) / float(q) * (-1) ** (q - 1 - j)
    return LinearSystem((A, B, C, D), analog=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号