无线电 计算分贝值 扫描每个频率的分贝值 和 列出最高分贝值的程序

发布时间:2024年01月03日
import rtlsdr as rsdr
import numpy as np
import matplotlib.pyplot as plt



def BB(data,len):
    sum = None
    bb = None
    for i in range(0,len):
        sum = data[i]*data[i]
    bb = np.sqrt(sum/len)
    bb = 20*np.log10(bb)

    return bb



s = rsdr.RtlSdr()


for i in range(75000000,107700000,10000):
    s.center_freq = i
    data = s.read_samples(256)

    data = np.array(data).view(np.float64)

    b = BB(data,len(data))
    print(i)
    print(int(b))
import rtlsdr as rsdr
import numpy as np
import matplotlib.pyplot as plt



def BB(data,len):
    sum = None
    bb = None
    for i in range(0,len):
        sum = data[i]*data[i]
    bb = np.sqrt(sum/len)
    bb = 20*np.log10(bb)

    return bb



s = rsdr.RtlSdr()
blist = []

for i in range(75000000,107700000,100000):
    s.center_freq = i
    data = s.read_samples(256)

    data = np.array(data).view(np.float64)

    b = BB(data,len(data))
    if int(b) > -40:
        print(str(i) + "  " + str(int(b)))

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