hackrf OOK算法简单数据分析(傅里叶计算)

2023-12-20 08:07:30
import numpy as np



def savedata():
    data = []
    i = 0
    c = 0
    while 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 += 1
        c += 1
        i /= (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.03387494
  24.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 时? 我们让信号竖起?? 在没有数据时 信号是平的?

文章来源:https://blog.csdn.net/nn_84/article/details/135098585
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。