10-12-2012 05:51 PM
Hey guys,
I have a problem that's been bothering me for some time. The issue is that the FFT Power Spectrum and PSD VI gives me a different peak amplitude for test signals that the RFSA soft front panel gives me. Here's what I'm doing:
I transmit a sine wave at IQ rate of 2MHz, carrier freq. 5.5GHz from a VSG (separate box) into the RFSA. When looking at the spectrum in in the Soft Front Panel application, the height of the peak is -50dBm and very stable. I also tested this by transmitting into our other HP spectrum analyzer, and got nearly the exact same result, -50dBm peak height. So, I am quite confident that this is an accurate measure of the received signal power.
However, when I try to use the very same RFSA to receive a signal and analyze with a simple labView program, I get problems. I take the output of the RFSA Fetch IQ VI, and funnel it into the FFT Power Spectrum and PSD VI, and plot the result on screen. The spectrum looks as it should, except that the peak height of the sine wave is at -60 dBm! I have the VI set to power spectrum, not PSD.
Has anyone seen this strange behavior? I have tried at least 5 different methods of computing a power spectrum in Labview, but none of them give me the same peak height as the Soft Front panel, and the spectrum analyzer hardware! Our experiment depends on getting accurate amplitude information, and I feel that there is a problem with how the peak is being computer in the VI, or I am missing something. Could someone experienced with the Power Spectrum VI please help? I need to know how to hook up the Power Spectrum VI such that it gives me the same result as the Soft Front Panel.
Thanks so much!
Brian
10-15-2012 03:11 PM - edited 10-15-2012 03:13 PM
Hi Brian,
I set up a test of this and I'm not seeing the same discrepancy between the two programs. I started with the example RFSA Acquire Continuous IQ.vi and made the modifications shown below to turn the IQ data into a scaled complex waveform, and then ran that into the FFT Power Spectrum and PSD.
The steps above de-interleave (or decimate) the array of IQ pairs and then combine them into a complex number. After that I scaled them by the number of samples (in this case 10000) and made the step size the inverse of the bandwidth (20M). Running this into a waveform graph shows a signal that passes the eye test of being the same as what the Soft Front Panel shows. There may be some difference since I didn't do a peak search but nothing like the 10 dBm shift you are seeing.
Are you performing the same calculations on the samples in your LabVIEW program? If so then I would double check the "Amptd" settings in the SFP to make sure they align with the settings in your program.
Regards,
Peter Williams
10-15-2012 03:56 PM
Hmm, thank you for taking a look at this. I am also using the RFSA Acquire Continuous IQ VI as a base. In my version, I use the waveform instance of the RFSA fetch IQ VI, which gives complex data. I am then feeding it directly into the PS/PSD VI. Why are you scaling the data in your version like this?
I figured my issue was something to this effect. If you could explain why you manipulate the output of the Fetch VI like this, I think I will understand my problem. From my perspective, the Fetch VI gives you complex WDT, measured in volts, so it could be fed into the PS/PSD VI directly. Apparently this is wrong.
Thanks for clarifying.
Brian
10-16-2012 10:01 AM
Hi Brian,
If you do not need to simultaneously view the spectrum and analyze the IQ data for other purposes, you may consider setting the acquisition type to Spectrum rather than IQ. In this mode, you can specify parameters like Span and RBW directly and the NI-RFSA driver will then handle creating the spectrum for you. In general, this is the mode that the NI-RFSA Soft Front Panel is using to display the spectrum.
For an example of calculating a spectrum from IQ data in the same way as the NI-RFSA Soft Front Panel, I recommend looking at the Triggered Spectrum Example found at:
https://decibel.ni.com/content/docs/DOC-22813
This example utilizes the Spectral Measurements Toolkit (SMT) for calculating the spectrum.
10-16-2012 04:01 PM
Thank you for the examples. I was aware that the RFSA can generate the spectrum directly. However, what I am really trying to understand is why this is wrong:
There must be some scaling of the data that I am missing. I want to know what the problem is here so that I can avoid it in the future. The waveform graph displays output that is about 10dBm LOWER than what is displayed on the soft front panel.
Thank you for the examples and other info. If you can tell me why the above is giving me bad output, I will greatly appreciate it and close the topic. Thanks for your help!
Brian
01-21-2013 08:40 AM
I'm facing the exact same problem.
I'm not 100% I'm still studying the problem my guess is it could connected to the Video BW settings of the RFSA
http://venus.ni.com/white-paper/13869/en
Any suggestion is more than welcome.
For the sake of clarity my test signal is similar to DME signal: a couple of pulses spaced by 12us on a carrier of 1GHz.
Regards
Filippo
01-21-2013 11:40 AM
I'm glad someone has reproduced this issue. I still don't know the answer. Hopefully someone from NI will hook up a VI like I have shown and can explain why we don't get the right spectrum amplitude.
01-22-2013 03:52 PM
Hi Brian,
I believe you are seeing this because the SFP is returning the value in dBm whereas the FFT Power Spectrum and PSD VI is allowing you to choose dB or Vrms but not dBm. By returning the value as Vrms (dB On? to False) and then manually converting the peak to dBm then the value was coming out to what I was seeing on the SFP, at least for the few test cases I tried. Digging into the FFT... subVI functions there is a conversion to dB with a reference to "1" that isn't clearly labeled, but most likely isn't 1 mW for dBm. If you want the graph to show exactly what is in the SFP then I would recommend looking at the examples Matt linked above that reference the actual architecture of the SFP and use the Spectral Measurements Toolkit VIs instead.
Regards,
Peter W.
01-25-2013 03:07 PM
OK thanks, I think I see your point. From now on we will compute the FFT's, being more mindful of the unit of measurement. Hopefully that will take care of whatever scaling problem is occurring.
-Brian
02-08-2013 01:47 PM - edited 02-08-2013 01:49 PM
I just posted a seperate post on a similar topic...as I too have been running into issues trying to convince myself I understand what NI's vi's are giving me and what the units really mean.
I've noticed that if you drill down into the Power Spectrum and PSD.vi....you'll find there's a vi called, "One Sided Power Spectrum". In this vi...there's another VI called "Power Spectrum.vi", that ends in a code interface node. However, the artwork of this vi suggests that it takes in IQ samples, and returns V^2_rms.
This V^2_rms then goes into the "Convert to dB.vi"...where, with the "Power Spectrum" option chosen, simply does 10*log10(V^2_rms).
Based on Peter's suggestion....I took the "dB" output from the Power Spectrum and PSD.vi...went back to V^2_rms....then dividedn that by 50ohms and divided again by 1mW....THEN did 10*log10 of that to get to dBm. However....the "dBm" result is about 10 higher than the "dB" result.....which is leading me to think that the V^2_rms that the Power Spectrum and PSD.vi calculates is already scaled by 50ohms and referenced to a mW?
Is this possible? As I mentioned, I'm unable to verify this by looking at the code since the VI that does this computation is a CIN.
---
Brandon