本文主要是介绍hackrf OOK算法简单数据分析(傅里叶计算),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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.801604034.02993561 0.80236313 4.03375184 0.80238685 4.03387110.80238759 4.03387482 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.0338749424.87401606 125.05012325 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494 0.80238761 4.03387494 0.802387614.03387494 0.80238761 4.03387494 0.80238761 4.033874940.80238761 4.03387494]
4.03387494 为虚拟信号 也就是在gnuradio里需要虚拟信号加上数据信号
当 c = 50 时 我们让信号竖起 在没有数据时 信号是平的
这篇关于hackrf OOK算法简单数据分析(傅里叶计算)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!