dehummer.py 文件源码

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

项目:pactools 作者: pactools 项目源码 文件源码
def single_estimate(sigin, f, fs, hmax):
    """Estimate the contribution of electrical network
    signal in sigin, if ENF is f.

    return the estimated signal
    """
    X = np.empty((len(sigin), hmax))
    fact = 2.0 * np.pi * f / fs * np.arange(1, hmax + 1)[:, None]
    p = np.arange(len(sigin))[:, None]
    X = np.dot(fact, p.T)
    X = np.concatenate([X, X + np.pi / 2]).T
    X = np.cos(X)
    XX = np.dot(X.T, X)
    Xy = np.dot(X.T, sigin)
    theta = linalg.solve(XX, Xy)
    return np.dot(X, theta)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号