aprsrecv.py 文件源码

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

项目:weakmon 作者: rtmrtmrtmrtm 项目源码 文件源码
def process1(self, sliced):
    global advance

    bitsamples = self.rate / float(self.baud)
    flagsamples = bitsamples * 9 # HDLC 01111110 flag (9 b/c NRZI)

    ff = self.findflag(sliced[0:int(round(flagsamples+advance*bitsamples+2))])
    if ff != None:
      indices = numpy.arange(0, len(sliced) - (ff+2*bitsamples), bitsamples)
      indices = indices + (ff + 0.5*bitsamples)
      indices = numpy.rint(indices).astype(int)
      rawsymbols = sliced[indices]
      symbols = numpy.where(rawsymbols > 0, 1, -1)

      [ ok, msg, nsymbols ] = self.finishframe(symbols[8:])
      if ok >= 1:
        return [ ok, msg, nsymbols, ff ]

    return [ 0, None, 0, 0 ]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号