11-15-2007 04:46 PM
11-19-2007 01:09 PM
MikeBail,
There are only a few reasons why you would want to specify an exact number of spectral lines to capture on your spectrum. Usually the number of spectral lines is determined by your center frequency, resolution bandwidth, frequency span and the algorithm used to calculate the spectrum. There is a shipping example that comes with the 5660 drivers called ni5660 Getting Started Spectrum which is a good starting point. There is a VI called “ni5660 Read Averaged Power Spectrum” that has a clustered output called “averaged power spectrum.” If you edit that VI so that you can see the actual size of the “spectrum” array in that cluster you should be able to get the same number as you specify in the spectral lines input.
I tested this VI with the 5660 acquiring anywhere from 400 to 4000 spectral lines and I got good results. My only question would be how many spectral lines are you trying to pull out? If you are asking for too many you may be running into other problems.
11-20-2007 09:36 AM
11-20-2007 04:54 PM
Mike,
If I understand correctly, you are passing a hard coded value of the parameter “spectral lines” to the “ni5660 Configure for Spectrum” VI.
If you are actually specifying a spectral lines input of 1024 or 2048 and getting 56,000 data points on your spectrum array, I am not sure where this is happening. My only guess is that the configure VI is not receiving these inputs and using your RBW value instead.
Which VI are you using to actually obtain a spectrum? I mentioned the “ni5660 Read Averaged Power Spectrum” VI which does the FFT and averaging for you. Another VI that can be used is the “ni5660 Read FFT Spectrum” but you will have to manipulate that data using other Vis. If you are in fact using the “ni5660 Read FFT Spectrum” VI you may be getting a funky number for the size of the FFT array on the “spectral info out” bundle. If you are storing your data ignore this value; the output you want to be looking at is “FFT spectrum (Vrms)”. This will give you an array called “spectrum” that has the same size you specify in the “spectral lines” input of the “ni5660 Configure for Spectrum” VI.
Remember, specifying a spectral lines input will stomp on your RBW setting and always return the number of data points you ask for instead of the one that will give you your desired RBW.
I have attached a screenshot & sample code (code if for LabView 8.5, if it doesn’t work on your system let me know, I can make it compatible to an older version).