![]() |
SM API
|
Sweep mode represents the common spectrum analyzer measurement of plotting amplitude over frequency. The API provides a simple interface through smGetSweep for acquiring single sweeps, or using smStartSweep and smFinishSweep, you can perform high throughput sweep measurements up to 1THz per second.
For a list of all examples, please see the examples/ folder in the SDK.
Only 1 sweep configuration can be active at a time.
Changing a sweep setting requires reconfiguring the device with a new sweep configuration.
All sweeps must be finished to change sweep configuration.
To achieve a sustained 1THz/s sweep speed, use fast sweep speed and queued sweeps.
Only linear spaced sweeps can be performed.
A sweep is returned from the API as a 1-dimensional array of measurement values. Each element in the array corresponds to a specific frequency. The frequency of any given element can be calculated as
Frequency of N'th element in sweep = StartFreq + N * BinSize
where StartFreq
and BinSize
are reported in the smGetSweepParameters function.
The measurement values can be returned in dBm or mV units.
All sweep functions in the API return 2 separate sweep arrays. The parameters 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 API reduces this to either minmax or average. When the detector is set to minmax, 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 and will be the result of an average detector.
If you are not interested in one of the sweeps, you can pass a NULL pointer for this parameter.
Most users will be interested in the sweepMax array as it will provide you either the peak+ and average detector results depending on detector setting. In this case, pass NULL for the sweepMin 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 many types of measurements but does not optimize for sweep speed. System latencies can be very large compared to total acquisition/processing time. To eliminate latencyies, you will need to take advantage of queued acquisitions.
The smStartSweep and smFinishSweep functions provide a way to eliminate latencies between sweeps which allows the device to sustain the full sweep speed throughput. Using these functions you can start up to several 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.
Blocking and queued sweep acquisitions should not be mixed.
All SM devices have 3 sweeps speeds depending on the user’s configuration. The sweep speed is determined from the sweep configuration, 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.
This sweep speed can be partially controlled smSetSweepSpeed. Also see SmSweepSpeed.