pyhackrf.py 发送程序:
import pyhackrf
import numpy as np
import time
hackrf = pyhackrf.HackRF()
hackrf.set_sample_rate_manual(10e3,1)
hackrf.set_baseband_filter_bandwidth(20000)
hackrf.set_amp_enable = 1
hackrf.set_freq(100000000)
hackrf.set_txvga_gain(42)
pyhackrf.txbuffer = np.fromfile("1.npy")
hackrf.start_tx((pyhackrf.tx_callback))
pyhackrf.py 接收程序:
import pyhackrf
import numpy as np
hackrf = pyhackrf.HackRF()
hackrf.sample_rate = 20e6
hackrf.center_freq = 88.5e6
samples,data2 = hackrf.read_samples(10e6,0)
np.save("1",data2)
pyhackrf.py 文件在这个链接里: