我用加密狗usbrtl2832采集样本。我想用这个库绘制功率密度谱图:Pyrtlsdr。在
有了这个代码,就可以:
from pylab import *
from rtlsdr import *
sdr = RtlSdr()
# configure device
sdr.sample_rate = 2.4e6
sdr.center_freq = 95e6
sdr.gain = 4
samples = sdr.read_samples(256*1024)
# use matplotlib to estimate and plot the PSD
psd(samples, NFFT=1024, Fs=sdr.sample_rate/1e6, Fc=sdr.center_freq/1e6)
xlabel('Frequency (MHz)')
ylabel('Relative power (dB)')
show()
我不明白"ylabel"
,什么是相对功率(dB)?如果我们说dbm
,我们将功率与1兆瓦比较?但在这个例子中我不明白。在
谢谢你的帮助!在
目前没有回答
相关问题 更多 >
编程相关推荐