def filter_bytes(self, databytes, bit_mask):
"""
Detect from a bit mask which bits
to keep to recompose the signal.
"""
n_bytes = len(databytes)
mask = np.ones(n_bytes, dtype=int)
np.putmask(mask, mask, bit_mask)
to_keep = np.where(mask > 0)[0]
return databytes.take(to_keep)
评论列表
文章目录