comms.py 文件源码

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

项目:arlpy 作者: org-arl 项目源码 文件源码
def iqplot(data, spec='.', labels=None):
    """Plot signal points.

    :param data: complex baseband signal points
    :param spec: plot specifier (see :func:`matplotlib.pyplot.plot`)
    :param labels: label for each signal point

    >>> import arlpy
    >>> arlpy.comms.iqplot(arlpy.comms.psk(8))
    >>> arlpy.comms.iqplot(arlpy.comms.qam(16), 'rx')
    >>> arlpy.comms.iqplot(arlpy.comms.psk(4), labels=['00', '01', '11', '10'])
    """
    import matplotlib.pyplot as plt
    data = _np.asarray(data)
    if labels is None:
        plt.plot(data.real, data.imag, spec)
    else:
        if labels == True:
            labels = range(len(data))
        for i in range(len(data)):
            plt.text(data[i].real, data[i].imag, str(labels[i]))
    plt.axis([-2, 2, -2, 2])
    plt.grid()
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号