简体   繁体   English

如何使用USRP数据计算功率谱密度?

[英]How to Calculate power spectral density using USRP data?

I wanted to plot a graph between Average power spectral density(in dbm) and the frequency (2.4 GHZ to 2.5 GHZ). 我想在平均功率谱密度(以dbm为单位)和频率(2.4 GHZ至2.5 GHZ)之间绘制图表。

The basic procedure i used earlier for power vs freq plot was to store the data generated by "usrp_specteum_sense.py" for some time period and then taking average. 我之前用于功率与频率图的基本过程是将“ usrp_specteum_sense.py”生成的数据存储一段时间,然后取平均值。

Can i calculate PSD from the power used in "usrp_spectrum_sense.py"? 我可以根据“ usrp_spectrum_sense.py”中使用的功率来计算PSD吗?
Is there any way to calculate PSD directly from usrp data? 有什么方法可以直接从usrp数据计算PSD吗?
Is there any other apporch which can be used to calculate PSD using USRP for desired range of frquency?? 是否有其他方法可用于使用USRP针对所需的频率范围来计算PSD?

PS: I recently found out about the psd() in matplotlib, can it be use to solve my problem?? PS:我最近在matplotlib中发现了psd(),可以用来解决我的问题吗?

I wasn't 100% sure whether or not to mark this question a duplicate of Retrieve data from USRP N210 device ; 我不确定100%是否将这个问题标记为从USRP N210设备检索数据的重复项; however, since the poster of that question was very confused and so was his question, let's answer this in a concise way: 但是,由于该问题的发布者非常困惑,而他的问题也很困惑,因此,我们以一种简洁的方式来回答这个问题:

What an SDR device like the USRP does is give you digital samples. 像USRP这样的SDR设备可以为您提供数字样本。 What these are is nothing more or less than what the ADC (Analog-to-Digital converter) makes out of the voltages it sees. 这些无非是比ADC(模数转换器)从所看到的电压中产生的更多或更少。 Then, those numbers are subject to a DSP chain that does frequency shifting, decimation and appropriate filtering. 然后,这些数字将受DSP链的影响,该链会进行频移,抽取和适当的滤波。 In other words, the discrete complex signal's envelope coming from the USRP should be proportional to the voltages observed by the ADC. 换句话说,来自USRP的离散复合信号的包络应与ADC观察到的电压成比例 Thanks to physics, that means that the magnitude square of these samples should be proportional to the signal power as seen by the ADC. 由于物理原因,这意味着这些样本的幅度平方应与ADC看到的信号功率成正比。

Thus, the values you get are "dBFS" (dB relative to Full Scale), which is an arbitrary measure relative to the maximum value the signal processing chain might produce. 因此,您获得的值为“ dBFS”(相对于满量程的dB),这是相对于信号处理链可能产生的最大值的任意度量。

Now, notice two things: 现在,注意两件事:

  • As seen by the ADC is important. 从ADC来看很重要。 Prior to the ADC there's 在ADC之前
    • an unknown antenna with a) an unknown efficiency and b) unknown radiation pattern illuminated from an unknown direction, 未知天线,其中a)效率未知,b)未知方向的辐射方向图未知,
    • connected to a cable that might or might not perfectly match the antennas impedance, and that might or might not perfectly match the USRP's RF front-end's impedance, 连接到可能或可能不完全匹配天线阻抗,可能或可能不完全匹配USRP射频前端阻抗的电缆,
    • potentially a bank of preselection filters with different attenuations, 可能是一组具有不同衰减的预选滤波器,
    • a low-noise frontend amplifier, depending on the device/daughterboard with adjustable gain, with non-perfectly flat gain over frequency 一个低噪声前端放大器,取决于具有可调增益的设备/子板,在整个频率范围内增益非理想地平坦
    • a mixer with frequency-dependent gain, 具有增益相关频率的混频器
    • baseband and/or IF gain stages and attenuators, adjustable, 可调节的基带和/或IF增益级和衰减器,
    • baseband filters, might be adjustable, 基带滤波器,可能是可调的,
    • component variances in PCBs, connectors, passives and active components, temperature-dependent gain and intermodulation, as well as PCB,连接器,无源和有源元件中的元件差异,与温度有关的增益和互调以及
    • ADC non-linearity, frequency-dependent behaviour. ADC非线性,频率相关行为。
  • proportional is important here, since after sampling, there will be 比例在这里很重要,因为采样后
    • I/Q imbalance correction, I / Q失衡校正,
    • DC/LO leakage cancellation, DC / LO泄漏消除,
    • anti-aliasing filtering prior to 抗混叠滤波之前
    • decimation, 抽取
    • and bit-width and numerical type changing operations. 以及位宽和数字类型更改操作。

All in all, the USRPs are not calibrated measurement devices. 总而言之,USRP 不是经过校准的测量设备。 They are pretty nice, and if chose the right one for your specific application, you might just need to calibrate once with a known external power source feeding exactly your system from antenna to sampling rate coming out at the end, at exactly the frequency you want to observe. 它们非常好,如果为您的特定应用选择了合适的设备,您可能只需要使用已知的外部电源进行一次校准,即可将您的系统从天线准确地馈送到最终的采样率,并以您想要的频率观察。 After knowing "ok, when I feed in x dBm of power, I see y dBFS, so there's this factor (xy) dB between dBFS", you now have calibrated your device for exactly one configuration consisting of 知道“好了,当我输入x dBm的功率时,我看到y dBFS,因此dBFS之间存在这个因数(xy)dB”,现在您已经针对包括

  • hardware models and individual units used, including antennas and cables, 硬件模型和使用的单个单元,包括天线和电缆,
  • center frequency, 中心频率
  • gain, 获得,
  • filter settings, 过滤器设置
  • decimation/sampling rate 抽取/采样率

Note that doing such calibrations, especially in the 2.4 GHz ISM band will require a "RF silent" room – it'll be hard to find an office or lab with no 2.4 GHz devices these days, and the reason why these frequencies are free for usage is that microwave ovens interfere; 请注意,进行此类校准(尤其是在2.4 GHz ISM频段中)将需要“ RF静音”房间–如今很难找到没有2.4 GHz设备的办公室或实验室,以及这些频率可用于用法是微波炉会干扰; and then there's the fact that these frequencies tend to diffract and reflect on building structures, PC cases, furniture with metal parts... In other words: get access to an anechoic chamber, a reference transmit antenna and transmit power source, and do the whole antenna system calibration dance that results in a directivity diagram normally, but instead generate a "digital value relative to transmit power" measurement. 实际上,这些频率会发生衍射并反射到建筑结构,PC机箱,带有金属零件的家具上……换句话说:进入消声室,参考发射天线和发射电源,并进行整个天线系统校准过程通常会产生方向图,但会生成“相对于发射功率的数字值”测量结果。 Whether or not that measurement is really representative for how you'll be using your USRP in a lab environment is very much up for your consideration. 该测量是否真的可以代表您在实验室环境中如何使用USRP,这完全取决于您的考虑。

That is a problem of any microwave equipment, not only the USRPs – RF propagation isn't easy to predict in complex environments, and the power characteristics of a receiving system isn't determined by a single component, but by the system as a whole in exactly its intended operational environment. 这是任何微波设备都存在的问题,不仅是USRP,在复杂环境中难以预测RF传播,而且接收系统的功率特性不是由单个组件决定的,而是由系统整体决定的完全在其预期的操作环境中。 Thus, calibration must require you either know your antenna, cable, measurement frontend, digitizer and DSP exactly and can do the math including error margins, or that you calibrate the system as a whole, and change as little as possible afterwards. 因此,校准必须要求您完全了解天线,电缆,测量前端,数字化仪和DSP,并且可以进行包括误差容限在内的数学运算,或者您必须对系统进行整体校准,然后再进行尽可能少的更改。

So: No. No Matlab function in this world can give meaning to numbers that isn't in these numbers – for absolute power, you'll need to calibrate against a reference. 因此:不会。这个世界上没有任何Matlab函数可以赋予不在这些数字中的数字含义-为了获得绝对的威力,您需要根据参考进行校准。

Another word on linearity: A USRP's analog hardware at full gain is pretty sensitive – so much sensitive that operating eg a WiFi device in the same room would be like screaming in its ear, blanking out weaker signals, and driving the analog signal chain into non-linearity. 关于线性度的另一句话:USRP的全增益模拟硬件非常敏感-如此敏感,以至于在同一个房间内操作(例如WiFi设备)就像是在尖叫,遮蔽较弱的信号,并将模拟信号链驱动到非-线性。 In that case, not only do the voltages observed by the ADC lose their linear relation to the voltages inserted at the antenna port, but also, and that is usually worse, amplifiers become mixers, so unwanted intermodulation introduces energy in spectral places where there was none. 在这种情况下,ADC观察到的电压不仅与天线端口上插入的电压失去线性关系,而且,更糟糕的是,放大器变成混频器,因此有害的互调会在存在频谱的地方引入能量。没有。 So make sure you operate your device in a place where you make the most of your signal's dynamic range without running into nonlinearities. 因此,请确保在可以充分利用信号动态范围而又不会出现非线性的地方操作设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 实际加速度计数据的功率谱密度显示了0 Hz时的异常值 - Power spectral density of real accelerometer data shows outlier at 0 Hz 具有间隙的信号的功率谱密度? - Power spectral density of a signal with gaps? 使用连续小波变换形式 pycwt 估计功率谱密度 - Estimate Power spectral density using Continuous wavelet transform form pycwt 功率谱密度信号 - power spectral density-scipy.signal matplotlib功率谱密度(PSD)值差异 - matplotlib power spectral density (PSD) value discrepancy 使用scipy.welch估算时间序列DF的功率谱密度 - Estimate power spectral density of time series DF using scipy.welch 如何找到信号周期(自相关 vs 快速傅立叶变换 vs 功率谱密度)? - How to find period of signal (autocorrelation vs fast fourier transform vs power spectral density)? 如何使用交叉谱密度计算两个相关信号的相移 - How to use the cross-spectral density to calculate the phase shift of two related signals 计算白噪声的功率谱密度时出现无法解释的对称性 - Unexplained symmetry when computing Power Spectral Density of white noise python中离散功率谱密度的正确归一化实际问题 - Correct normalization of discrete power spectral density in python for a real problem
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM