import numpy as npdef savedata():data = []i = 0c = 0while c < 100:if c == 50:data.append((127.5*np.sin(2*np.pi/(32000/1000))))# 当数据为 1 时data.append((127.5*np.cos(2*np.pi/(32000/1000))))data.append((i*127.5*np.sin(2*np.pi/(32000/1000)))) # 当数据为 0 时data.append((i*127.5*np.cos(2*np.pi/(32000/1000))))i += 1c += 1i /= (32000/1000)np.save("1",data)return def loaddata():data = np.load("1.npy")print(data)savedata()loaddata()
[0. 0. 0.777313 3.90781635 0.80160403 4.02993561 0.80236313 4.03375184 0.80238685 4.0338711 0.80238759 4.03387482 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.0338749424.87401606 125.05012325 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494 0.80238761 4.03387494]
4.03387494 为虚拟信号 也就是在gnuradio里需要虚拟信号加上数据信号
当 c = 50 时 我们让信号竖起 在没有数据时 信号是平的