gold.py 文件源码

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

项目:Thrifty 作者: swkrueger 项目源码 文件源码
def plot(seq):
    """Plot the autocorrelation of the given sequence."""
    import matplotlib.pyplot as plt

    bipolar = np.where(seq, 1.0, -1.0)
    autocorr = np.correlate(bipolar, bipolar, 'same')

    plt.figure()
    plt.title("Length {} Gold code autocorrelation".format(len(seq)))
    xdata = np.arange(len(seq)) - len(seq) // 2
    plt.plot(xdata, autocorr, '.-')
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号