comms.py 文件源码

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

项目:arlpy 作者: org-arl 项目源码 文件源码
def diff_encode(x):
    """Encode phase differential baseband signal.

    :param x: complex baseband data to encode differentially
    :returns: differentially encoded complex baseband data of length len(x)+1

    >>> import arlpy
    >>> x = arlpy.comms.modulate(arlpy.comms.random_data(100, 4), arlpy.comms.psk(4))   # QPSK
    >>> len(x)
    100
    >>> y = arlpy.comms.diff_encode(x)  # DQPSK
    >>> len(y)
    101
    >>> x[0]
    (0.707+0.707j)
    >>> y[1]/y[0]
    (0.707+0.707j)
    """
    x = _np.asarray(x)
    y = _np.insert(x, 0, 1)
    for j in range(2,len(y)):
        y[j] *= y[j-1]
    return y
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号