BB API
|
Please also see the C++ programming examples for an example of interfacing the device for each measurement type.
Swept analysis represents the most traditional form of spectrum analysis. This mode offers the largest amount of configuration options and returns traditional frequency domain sweeps. A frequency domain sweep displays amplitude on the vertical axis and frequency on the horizontal axis.
For a list of all examples, please see the examples/ folder in the SDK.
The configuration routines which affect the sweep results are:
Once you have configured the device, you will initialize the device using the BB_SWEEPING flag.
This mode is driven by the programmer, causing a sweep to be collected only when the program requests one through the bbFetchTrace functions. The length of the sweep is determined by a combination of resolution bandwidth, video bandwidth and sweep time.
Once the device is initialized you can determine the characteristics of the sweep you will be collecting with bbQueryTraceInfo. This function returns the length of the sweep, the frequency of the first bin, and the bin size (difference in frequency between any two samples). You will then need to allocate memory for the sweep.
Now you can call bbFetchTrace. This is a blocking call that does not begin the sweep until the function is called.
Determining the frequency of any point returned is determined by the function below, where ‘n’ starts at zero for the first sample point.
Frequency of nth sample point in returned sweep = startFreq + n * binSize
The API provides the functionality of a real-time spectrum analyzer for the full instantaneous bandwidth of the device (20MHz for the BB60A, 27MHz for the BB60C and BB60D). Using FFTs at an overlapping rate of 50%, the spectrum results have no blind time (100% probability of intercept) for events as short as 4.8us at full amplitude (at 631kHz RBW). The RBW shape is restricted to the Nuttall window, and VBW is not configurable.
For a list of all examples, please see the examples/ folder in the SDK.
The configuration routines which affect the spectrum results are:
Once you have configured the device, you will initialize the device using the BB_REAL_TIME flag.
The number of sweep results far exceeds a program’s capability to acquire, view, and process, therefore the API combines sweeps results for a user specified amount of time. It does this in two ways. One, is the API either max holds or averages the sweep results into a standard sweep.
Also, the API creates an image frame which acts as a density map for every sweep result processed during a period. Both the sweep and density map are returned at rate specified by the function bbConfigureRealTime.
An alpha frame is also provided by the API. The alphaFrame is the same size as the frame and each index correlates to the same index in the frame. The alphaFrame values represent activity in the frame. When activity occurs in the frame, the index correlating to that activity is set to 1. As time passes and no further activity occurs in that bin, the alphaFrame exponentially decays from 1 to 0. The alpha frame is useful to determine how recent the activity in the frame is and useful for plotting the frames.
The API can be used to stream I/Q data up to 40 MS/s. I/Q data can be retrieved as 32-bit complex floats or 16-bit complex shorts. I/Q data provided as 32-bit floats are corrected for IF flatness and RF leveling. I/Q data returned as 16-bit shorts is provided as full scale, only correcting for IF flatness and the user must apply a correction value to recover the fully amplitude corrected I/Q data.
For a list of all examples, please see the examples/ folder in the SDK.
See the following functions for configuring and retrieving I/Q data:
Once configured, initialize the device with the BB_STREAMING flag.
The I/Q data can be decimated by powers of 2 up to a decimation of 8192. The API provides users a customizable bandpass filter cutoff frequency at any sample rate.
The I/Q data stream can be tuned to any frequency within the BB60 frequency range.
Data acquisition begins immediately. The API buffers ~3/4 second worth of I/Q samples in a circular buffer. Samples can be retrieved with the bbGetIQ function. If you wish to retrieve all samples, it is the responsibility of the user’s application to poll the samples fast enough to prevent the APIs internal buffers from accumulating too much I/Q data. We suggest a separate polling thread and synchronized data structure (buffer) for retrieving the samples and using them in your application.
NOTE: Decimation and filtering occur on the PC and can be processor intensive on certain hardware. Please characterize the processor load.
External trigger information can be retrieved when I/Q streaming. Trigger information is provided through the triggers buffer in the bbGetIQ function.
For a list of all examples, please see the examples/ folder in the SDK.
If a trigger buffer is provided to bbGetIQ, any external trigger events seen during the acquisition of the returned I/Q data will be placed in the trigger buffer. External trigger events are returned as indices into the I/Q data at which the trigger event occurred. For example, if 1000 I/Q samples are requested and a trigger buffer of size 3 is provided, and the function returns with the trigger buffer set to [12,300,876], this indicates that an external trigger event occurred at I/Q sample index 12, 300, and 876 in the I/Q data returned from this function call.
If fewer external triggers were seen during the I/Q acquisition than the size of the trigger buffer provided, the remainder of the trigger buffer is set to the sentinel value. The default sentinel value is 0, so for example, if a trigger buffer of size 3 is provided, and only a single trigger event was seen, the trigger buffer will return [N, 0, 0] where N is the single trigger index returned.
If more trigger events were seen during the I/Q acquisition than the size of the trigger buffer, those trigger events that cannot fit in the buffer are discarded.
A note on trigger sentinel values: the default sentinel value of 0 does not allow the detection of triggers occurring at the first sample point. If this is an issue, set the sentinel value to -1 or some other negative value which cannot be normally returned. The default value of 0 is the result of historical choices and will remain the default value.
For a list of all examples, please see the examples/ folder in the SDK.
Initialize the device with the BB_AUDIO_DEMOD flag.
When audio is being performed, no other measurements can take place. If you need the I/Q data and the ability to demodulate audio, consider using the I/Q streaming functionality and performing the audio demodulation on the I/Q data from there.
Once the device is streaming audio it is possible to continue to change the audio settings via bbConfigureDemod if the updated center frequency does not exceed +/- 8 MHz of the value specified when bbInitiate was called. The center frequency is specified in bbConfigureDemod.
Once the device is streaming, use bbFetchAudio to retrieve 4096 audio samples for an audio sample rate of 32k.
When a Signal Hound tracking generator is paired together with a BB60D, BB60C, or BB60A spectrum analyzer, the products can function as a scalar network analyzer to perform insertion loss measurements or return loss measurements by adding a directional coupler. Throughout this document, this functionality will be referred to as tracking generator (or TG) sweeps.
For a list of all examples, please see the examples/ folder in the SDK.
Initialize the device with the BB_TG_SWEEPING flag.
Scalar Network Analysis can be realized by following these steps:
If you modify the test setup or want to re-initialize the device with a new configuration, the store through must be performed again.