From a5ef1d0468e4d8f76602450182f151369a04b0e9 Mon Sep 17 00:00:00 2001 From: zhongjin Date: Wed, 14 Dec 2022 09:03:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20'HackRF.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HackRF.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 HackRF.py diff --git a/HackRF.py b/HackRF.py deleted file mode 100644 index c3ee1d3..0000000 --- a/HackRF.py +++ /dev/null @@ -1,36 +0,0 @@ -import numpy -import logging -############################################################### -# Further work on fork -# Copyright (C) 2017 David Robinson -class HackRF: - """The HackRF class has functions from converting data into a format into which the hackrf can process - """ - - logger = None - - def __init__(self): - self.logger = logging.getLogger(__name__) - - def hackrf_raw_IQ_format(self, ppm): - """ - Args: - ppm: this is some data in ppm (pulse position modulation) which you want to convert into raw IQ format - - Returns: - bytearray: containing the IQ data - """ - self.logger.debug('Creating hackRF bytearray from the ppm stuff') - signal = [] - bits = numpy.unpackbits(numpy.asarray(ppm, dtype=numpy.uint8)) - for bit in bits: - if bit == 1: - I = 127 - Q = 127 - else: - I = 0 - Q = 0 - signal.append(I) - signal.append(Q) - - return bytearray(signal)