SM API
I/Q Sweep List / Frequency Hopping

I/Q sweep list measurements perform frequency hopping I/Q captures at a list of preconfigured frequencies and capture sizes. Captures can be queued to sustain > 8000 frequency hops per second.

Example

For a list of all examples, please see the examples/ folder in the SDK.

// Configure and perform a single sweep in the I/Q sweep list mode.
// Configure a sweep with 3 different frequencies and different capture sizes at each frequency.
// Shows how to index the sweep.
// For a more basic example, see the 'simple' example.
// For an example which queues multiple sweeps, see the 'queue' example.
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include "sm_api.h"
void sm_example_iq_sweep_list_single()
{
int handle = -1;
// Open a USB SM device
SmStatus status = smOpenDevice(&handle);
// Open a networked SM device
//SmStatus status = smOpenNetworkedDevice(&handle, SM_ADDR_ANY, SM_DEFAULT_ADDR, SM_DEFAULT_PORT);
if(status != smNoError) {
printf("Unable to open device\n");
exit(-1);
}
// The data returned should be corrected, scaled to sqrt(mW) instead of full scale.
// Returne the data at 32-bit floating point complex values
// 3 frequency steps
// If the GPS antenna is connected, this will instruct the device to
// discipline to the internal GPS PPS. This will improve frequency
// and timestamp accuracy.
// Configure all three frequency steps
// 1GHz, 1000 samples to be collected
smSetIQSweepListFreq(handle, 0, 1.0e9);
smSetIQSweepListRef(handle, 0, -20.0);
smSetIQSweepListSampleCount(handle, 0, 1000);
// 2GHz, 3000 samples to be collected
smSetIQSweepListFreq(handle, 0, 2.0e9);
smSetIQSweepListRef(handle, 0, -20.0);
smSetIQSweepListSampleCount(handle, 0, 2000);
// 3GHz, 3000 samples to be collected
smSetIQSweepListFreq(handle, 0, 3.0e9);
smSetIQSweepListRef(handle, 0, -20.0);
smSetIQSweepListSampleCount(handle, 0, 3000);
// Total samples between all 3 frequency steps
const int totalSamples = 6000;
// Configure the device
// Allocate memory for the capture
std::vector<std::complex<float>> iq(totalSamples);
// Memory for the timestamps
int64_t timestamps[3];
// Perform the sweep
smIQSweepListGetSweep(handle, &iq[0], timestamps);
// Example of how to index the data
// Get pointers to the data for the 3 steps
std::complex<float> *step1 = &iq[0];
std::complex<float> *step2 = &iq[1000];
std::complex<float> *step3 = &iq[3000];
// Do something with the data here
// The three timestamps will be the times of the samples at
// step1[0], step2[0], and step3[0]
// GPS lock doesn't occur immediately upon opening. If
// the GPS is cold it could take several minutes to acquire lock. If warm, it
// might not lock for several seconds. Generally the hardware will need
// to see at least 1 PPS after opening before lock can be determined.
// It will take multiple PPS after opening for disciplining to be achieved.
// Call the smGetGPSState function to determine if the timestamps were returned
// under GPS lock.
// Done with device
smCloseDevice(handle);
}
API functions for the SM435/SM200 spectrum analyzers.
SM_API SmStatus smOpenDevice(int *device)
SM_API SmStatus smSetIQSweepListSampleCount(int device, int step, uint32_t samples)
SM_API SmStatus smSetIQSweepListDataType(int device, SmDataType dataType)
@ smDataType32fc
Definition: sm_api.h:234
@ smTrue
Definition: sm_api.h:380
@ smModeIQSweepList
Definition: sm_api.h:254
SM_API SmStatus smSetIQSweepListCorrected(int device, SmBool corrected)
SM_API SmStatus smIQSweepListGetSweep(int device, void *dst, int64_t *timestamps)
SM_API SmStatus smSetIQSweepListRef(int device, int step, double level)
SM_API SmStatus smCloseDevice(int device)
SM_API SmStatus smSetIQSweepListSteps(int device, int steps)
SM_API SmStatus smConfigure(int device, SmMode mode)
SM_API SmStatus smSetIQSweepListFreq(int device, int step, double freq)
SmStatus
Definition: sm_api.h:142
@ smNoError
Definition: sm_api.h:203
SM_API SmStatus smSetGPSTimebaseUpdate(int device, SmBool enabled)

Basics

I/Q sweep lists are finite length I/Q acquisitions across a series of frequencies. Lists of up to 1200 frequencies can be provided. At each frequency, the reference level and number of samples to be collected must be configured. One measurement/list is referred to as a “sweep” and iterates through all configured frequency steps. Several sweeps can be queued to maintain maximum throughput.

I/Q sweep lists are advantageous when needing to acquire a discrete number of I/Q samples at several different frequencies. I/Q samples are collected at the devices native sample rate, 50MS/s for the USB SM devices and 200MS/s for the networked SM devices. The absolute fastest the SM device can switch frequencies is 120us. When I/Q capture amounts are small at each frequency, 120us frequency switch times can be achieved for a maximum of 8333.33 frequencies per second.

At each frequency, a timestamp is provided indicating the nanoseconds since epoch for the fist I/Q sample at that frequency. If the internal GPS is locked, this time is GPS time, If GPS is not locked, system time is provided. Regardless of GPS lock, relative timings between timestamps are highly accurate through use of internal device counters.

Sweep List Configuration Example

A list of 3 frequencies is provided, 1GHz, 2GHz, and 3GHz. At each frequency 1000 I/Q samples are configured to be collected. Once configured a sweep can be performed which captures I/Q samples at the 3 frequencies, for a total of 3000 samples. If desired, N sweeps can be queued to be performed back-to-back, resulting in N * 3000 samples to be collected. By queuing the sweeps, blind time between sweeps is reduced or eliminated, improving probability of intercept and overall measurement speed.

Notes on Performance

While the user can specify an arbitrary number of samples at each frequency, the SM device is internally limited to multiples of 2048 samples. For this reason, it is optimum to round up to the next multiple of 2048, which will not affect acquisition speed and reduce the number samples discarded.

Maximum sweep speed occurs when at most N samples are requested at each frequency. For the USB SM devices, N is 2048 samples, and for the networked devices, N is 6144 samples. When <= N samples are requested, the device will step at the maximum rate of 8333.33 frequencies per second. This equates to ~333GHz of spectrum coverage per second for the USB SM devices and ~1.333THz of spectrum coverage per second for the networked SM devices.

I/Q Streaming vs I/Q Sweep List

One use case where I/Q sweep lists are preferred to I/Q streaming for single frequency measurements is when you know in advance how many I/Q samples you want to collect at that frequency. Using I/Q sweep lists to acquire these samples has less overhead than using I/Q streaming. Starting and stopping the I/Q stream can take ~30ms, where as the overhead associated with performing a single I/Q sweep list acquisition is 1-5ms.

Additional Information

See I/Q Acquisiton for more information.