Hi,
I'm new to Vee and I'm trying to get my first program working. The goal is to capture a sequence of spectrum analyzer plots over a 24 hour period and save them as image files. I'm using IVI-COM to control a N1996A analyzer. I can get the spectrum data back from the analyzer and it comes in the form of a 1D array of 802 values where the even indices are frequency and odd indices are amplitude. After 2 days of struggling though I cannot figure out how to get this onto any of the display options in Vee. Spectrum expects a Spectrum data type, and the two X Y plot displays both want either Coord data or separate X and Y arrays. Surely there must be an easier way of getting a spectrum plot from the data read back from the analyzer? Can anyone point me in the right direction?
Thanks
Clive
I'm new to Vee and I'm trying to get my first program working. The goal is to capture a sequence of spectrum analyzer plots over a 24 hour period and save them as image files. I'm using IVI-COM to control a N1996A analyzer. I can get the spectrum data back from the analyzer and it comes in the form of a 1D array of 802 values where the even indices are frequency and odd indices are amplitude. After 2 days of struggling though I cannot figure out how to get this onto any of the display options in Vee. Spectrum expects a Spectrum data type, and the two X Y plot displays both want either Coord data or separate X and Y arrays. Surely there must be an easier way of getting a spectrum plot from the data read back from the analyzer? Can anyone point me in the right direction?
Thanks
Clive
You could of course still use the format you have, but it is awkward. There are a couple of things you could use - either a Matlab function, such as decimate, may be useful to take out every other point in the array or there is probably a slick way to do this with VEE's clever array manipulation...
Once you've done that you'll need to use the Data -> Build Data -> Spectrum object: send your amplitude array into it and it will create a spectrum. You can programmatically set the start/stop frequencies by going to the object menu -> Add Terminal -> Data Input... Selecting the elements in the original array such as Ary[0] for the start and Ary[totSize(Ary) - 2] for the stop frequency. Note using this object assumes that the frequency points are evenly spaced, which they normally are from a spec ana.