![]() |
Signal Hound BB API
|
Swept spectrum analysis represents the common spectrum analyzer measurement of plotting amplitude over frequency. In this measurement mode, the API returns sweeps from the receiver. The API provides a simple interface through smGetSweep for acquiring single sweeps, or for high throughput sweep measurements, the smStartSweep / smFinishSweep functions. Both the sweep format and acquisition methods are described below. Only 1 sweep configuration can be active at a time. Changing any sweep parameter requires reconfiguring the device with a new sweep configuration.
Sweeps are returned from the API as 1-dimensional arrays of power values. Each array element corresponds to a specific frequency. The frequency of any given can be calculated as
‘Frequency of N^’ th sample in sweep=StartFreq+N*BinSize`
where StartFreq
and BinSize
are reported in the #smGetSweepParameters function.
Several functions in the SM API return two arrays for sweeps. They are typically named sweepMin and sweepMax. To understand the purpose of these arrays, it is important to understand their relation to the analyzer’s detector setting. Traditionally, spectrum analyzers offer several detector settings, the most common being peak-, peak+, and average. The SM API reduces this to either min-max or average. When the detector is set to min-max, the sweepMin array will contain the sweep as if a peak- detector is running, and the sweepMax array will contain the sweep of a peak+ detector. When average detector is enabled, sweepMin and sweepMax will be identical arrays.
Sweeps are returned for swept analysis and real-time spectrum analysis. Generally, if you are not interested in either the min or max sweep, simply passing a NULL pointer for this parameter will tell the API you wish to ignore this sweep.
Most API users will only be interested in the sweepMax array as this will provide peak+ and average detector results. (pass NULL to the sweepMin array parameter)
The simple method of acquiring sweeps is to use the smGetSweep function. This function starts a sweep and blocks until the sweep is completed. This is adequate for most types of measurements but does not optimize for receiver sweep speed. USB latency can be very large compared to total acquisition/processing time. To eliminate USB latency, you will need to take advantage of the API sweep queuing mechanisms.
The sweep start/finish function provide a way to eliminate USB latencies between sweeps which allows the device to sustain the full sweep speed throughput. Using the #smStartSweep/#smFinishSweep functions you can start up to ‘N’ sweeps which ensures the receiver is continuously acquiring data for the next sweep. Using a circular buffer approach, you can ensure that there is no down time in sweep acquisition. See an example of this in the provided code examples.
Note: When using the blocking #smGetSweep function, the API utilizes the queued start/finish functions with a sweep index of zero (0). This means that if you want to mix the blocking and queue sweep acquisitions, avoid using index zero for queued sweeps.
This sweep speed is related to the parameter set in smSetSweepSpeed. See the description for smSetSweepSpeed for more information.
The SM has 3 sweeps speeds depending on the user’s configuration. The sweep speed is primarily set by the user explicitly, except in a few cases. The user can also configure the API to automatically choose the fastest sweep speed. The sweep speeds are described below.