delay.py 文件源码

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

项目:Spherical-robot 作者: Evan-Zhao 项目源码 文件源码
def fst_delay_snd(fst, snd, samp_rate):
    # Verify argument shape.
    s1, s2 = fst.shape, snd.shape
    if len(s1) != 1 or len(s2) != 1 or s1[0] != s2[0]:
        raise Exception("Argument shape invalid, in 'fst_delay_snd' function")

    half_len = int(s1[0]/2)
    corre = numpy.correlate(fst, snd, 'same')
    max_pos = numpy.argmax(corre)
    return (max_pos - half_len)/samp_rate
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号