SM API
I/Q Segmented Captures

Segmented I/Q captures allow USB 3.0 SM200B and SM435B devices to capture I/Q data with up to a 160MHz bandwidth. Complex triggering options allow 160MHz I/Q captures up to 2 seconds in length.

Segmented I/Q measurements are only available on the SM200B and SM435B devices.

10GbE devices support 160MHz I/Q bandwidth streaming and do not have segmented I/Q measurement capability.

Example

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

// SM200B/SM435B only.
// This example demonstrates setting up a single immediate triggered I/Q capture
// using the 160MHz I/Q capture capabilities of the SM200B/SM435B. This examples uses the
// convenience function for completing the capture. See the "imm_manual" example for a full
// example.
#include "sm_api.h"
#include <vector>
void sm_example_segmented_iq_imm_simple()
{
// Number of I/Q samples, 50 million, 1/5th of a second
const int CAPTURE_LEN = 50e6;
int handle = -1;
SmStatus status = smOpenDevice(&handle);
if(status != smNoError) {
// Unable to open device
const char *errStr = smGetErrorString(status);
return;
}
// Verify device has segmented I/Q capture capability
SmDeviceType deviceType;
smGetDeviceInfo(handle, &deviceType, 0);
if(deviceType != smDeviceTypeSM200B && deviceType != smDeviceTypeSM435B) {
// Invalid device type
smCloseDevice(handle);
return;
}
// Set device reference level, maximum expected input signal
status = smSetRefLevel(handle, 0.0);
// Configure the 160MHz capture
status = smSetSegIQCenterFreq(handle, 2.45e9);
// Setup a single segment capture
status = smSetSegIQSegmentCount(handle, 1);
status = smSetSegIQSegment(handle, 0, smTriggerTypeImm, 0, CAPTURE_LEN, 0.0);
if(status != smNoError) {
// Unable to configure device
const char *errStr = smGetErrorString(status);
return;
}
// 2 floats for each I/Q sample
std::vector<float> buf(CAPTURE_LEN * 2);
int64_t nsSinceEpoch = 0;
SmBool timedOut = smFalse;
// This example uses the convenience function for completing the capture.
// See the manual example for performing the full sequence of capture functions.
// Immediate triggered acquisitions can't time out, so we ignore the timeout.
status = smSegIQCaptureFull(handle, 0, buf.data(), 0, CAPTURE_LEN, &nsSinceEpoch, &timedOut);
// Do something with data
smAbort(handle);
smCloseDevice(handle);
}
API functions for the SM435/SM200 spectrum analyzers.
SM_API SmStatus smOpenDevice(int *device)
SM_API SmStatus smGetDeviceInfo(int device, SmDeviceType *deviceType, int *serialNumber)
SM_API SmStatus smSetSegIQSegmentCount(int device, int segmentCount)
@ smTriggerTypeImm
Definition: sm_api.h:353
@ smDataType32fc
Definition: sm_api.h:234
SM_API SmStatus smAbort(int device)
SmBool
Definition: sm_api.h:376
@ smFalse
Definition: sm_api.h:378
SmDeviceType
Definition: sm_api.h:406
@ smDeviceTypeSM200B
Definition: sm_api.h:410
@ smDeviceTypeSM435B
Definition: sm_api.h:414
SM_API SmStatus smSetSegIQCenterFreq(int device, double centerFreqHz)
@ smModeIQSegmentedCapture
Definition: sm_api.h:252
SM_API SmStatus smSetRefLevel(int device, double refLevel)
SM_API SmStatus smSetSegIQSegment(int device, int segment, SmTriggerType triggerType, int preTrigger, int captureSize, double timeoutSeconds)
SM_API SmStatus smCloseDevice(int device)
SM_API SmStatus smSetSegIQDataType(int device, SmDataType dataType)
SM_API SmStatus smConfigure(int device, SmMode mode)
SM_API const char * smGetErrorString(SmStatus status)
SmStatus
Definition: sm_api.h:142
@ smNoError
Definition: sm_api.h:203
SM_API SmStatus smSegIQCaptureFull(int device, int capture, void *iq, int offset, int len, int64_t *nsSinceEpoch, SmBool *timedOut)

Basics

The SM200B and SM435B have an internal I/Q sample rate of 250MS/s with 160MHz of usable bandwidth. Due to the bandwidth limitations of USB 3.0 we cannot stream this full sample rate over USB to the PC. To accommodate these rates, these devices have 2GB of high-speed internal memory allowing customers to capture up to 2 seconds of I/Q data at the full 250MS/s rate.

With the API you can configure single triggered I/Q acquisitions up to 2 seconds or using the complex triggering capabilities, configure a sequence of trigger acquisitions to capture low duty cycle signals.

Acquisition Description

The sequence of a program performing segmented I/Q captures is,

  1. Configure the segmented captures using the smSetSegIQ** functions.
  2. Call smConfigure with the smModeIQSegmentedCapture parameter. This initializes the segmented captures with the settings set in step 1.
  3. Retrieve measurement parameters with the smGetIQParameters and smSegIQGetMaxCaptures functions.
  4. Retrieve measurement data using the smSegIQCapture** functions.
    • Start a trigger sequence.
    • Wait for it to finish.
    • Retrieve the measurement info and data.
    • Finish the capture. (Frees up resources)
    • Repeat (go to step a.)

Triggering

The API gives you the ability to configure a simple or complex trigger sequence. A trigger sequence is a sequence of triggers (imm/video/ext/FMT) that occur back to back, that allow re-arm times up to 25us (depending on parameters). A trigger sequence allows you to capture the signals you care about and ignore samples where signals are not present. A trigger sequence and the data it captures might look like this.

Trigger sequence captures 3 sparse signal events and ignores all other samples.

Trigger sequences can include up to 250 triggers. You are limited to one configuration of each trigger type, these types being,

  • Video trigger (level/edge)
  • External trigger (edge)
  • Frequency mask trigger (size/mask).

For each trigger in a sequence you can configure

  1. The trigger type
  2. Pre-trigger length
  3. Post-trigger length
  4. Timeout length

Once you have configured your trigger sequence, you can queue many trigger sequences up simultaneously to increase capture throughput.

The maximum timeout length for a trigger sequence is the sum of the timeout lengths for all triggers in the sequence. The timeout period of one trigger does not start until the previous trigger has either been captured or timed-out.

Active trigger sequences must be finished before the device can be reconfigured for a different measurement, therefore it is important to avoid large timeout values if you need the device to remain responsive.