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 ]
评论列表
文章目录