SA API
Data Structures | Macros | Enumerations | Functions
sa_api.h File Reference

API functions for the SA44/124 spectrum analyzers. More...

Go to the source code of this file.

Data Structures

struct  saSelfTestResults
 
struct  saIQPacket
 

Macros

#define SA_TRUE   (1)
 
#define SA_FALSE   (0)
 
#define SA_MAX_DEVICES   8
 
#define SA44_MIN_FREQ   (1.0)
 
#define SA124_MIN_FREQ   (100.0e3)
 
#define SA44_MAX_FREQ   (4.4e9)
 
#define SA124_MAX_FREQ   (13.0e9)
 
#define SA_MIN_SPAN   (1.0)
 
#define SA_MAX_REF   (20)
 
#define SA_MAX_ATTEN   (3)
 
#define SA_MAX_GAIN   (2)
 
#define SA_MIN_RBW   (0.1)
 
#define SA_MAX_RBW   (6.0e6)
 
#define SA_MIN_RT_RBW   (100.0)
 
#define SA_MAX_RT_RBW   (10000.0)
 
#define SA_MIN_IQ_BANDWIDTH   (100.0)
 
#define SA_MAX_IQ_DECIMATION   (128)
 
#define SA_IQ_SAMPLE_RATE   (486111.111)
 
#define SA_IDLE   (-1)
 
#define SA_SWEEPING   (0x0)
 
#define SA_REAL_TIME   (0x1)
 
#define SA_IQ   (0x2)
 
#define SA_AUDIO   (0x3)
 
#define SA_TG_SWEEP   (0x4)
 
#define SA_RBW_SHAPE_FLATTOP   (0x1)
 
#define SA_RBW_SHAPE_CISPR   (0x2)
 
#define SA_MIN_MAX   (0x0)
 
#define SA_AVERAGE   (0x1)
 
#define SA_LOG_SCALE   (0x0)
 
#define SA_LIN_SCALE   (0x1)
 
#define SA_LOG_FULL_SCALE   (0x2)
 
#define SA_LIN_FULL_SCALE   (0x3)
 
#define SA_AUTO_ATTEN   (-1)
 
#define SA_AUTO_GAIN   (-1)
 
#define SA_LOG_UNITS   (0x0)
 
#define SA_VOLT_UNITS   (0x1)
 
#define SA_POWER_UNITS   (0x2)
 
#define SA_BYPASS   (0x3)
 
#define SA_AUDIO_AM   (0x0)
 
#define SA_AUDIO_FM   (0x1)
 
#define SA_AUDIO_USB   (0x2)
 
#define SA_AUDIO_LSB   (0x3)
 
#define SA_AUDIO_CW   (0x4)
 
#define TG_THRU_0DB   (0x1)
 
#define TG_THRU_20DB   (0x2)
 
#define SA_REF_UNUSED   (0)
 
#define SA_REF_INTERNAL_OUT   (1)
 
#define SA_REF_EXTERNAL_IN   (2)
 

Enumerations

enum  saDeviceType {
  saDeviceTypeNone = 0 , saDeviceTypeSA44 = 1 , saDeviceTypeSA44B = 2 , saDeviceTypeSA124A = 3 ,
  saDeviceTypeSA124B = 4
}
 
enum  saStatus {
  saUnknownErr = -666 , saFrequencyRangeErr = -99 , saInvalidDetectorErr = -95 , saInvalidScaleErr = -94 ,
  saBandwidthErr = -91 , saExternalReferenceNotFound = -89 , saLNAErr = -21 , saOvenColdErr = -20 ,
  saInternetErr = -12 , saUSBCommErr = -11 , saTrackingGeneratorNotFound = -10 , saDeviceNotIdleErr = -9 ,
  saDeviceNotFoundErr = -8 , saInvalidModeErr = -7 , saNotConfiguredErr = -6 , saTooManyDevicesErr = -5 ,
  saInvalidParameterErr = -4 , saDeviceNotOpenErr = -3 , saInvalidDeviceErr = -2 , saNullPtrErr = -1 ,
  saNoError = 0 , saNoCorrections = 1 , saCompressionWarning = 2 , saParameterClamped = 3 ,
  saBandwidthClamped = 4 , saCalFilePermissions = 5
}
 

Functions

SA_API saStatus saGetSerialNumberList (int serialNumbers[8], int *deviceCount)
 
SA_API saStatus saOpenDeviceBySerialNumber (int *device, int serialNumber)
 
SA_API saStatus saOpenDevice (int *device)
 
SA_API saStatus saCloseDevice (int device)
 
SA_API saStatus saPreset (int device)
 
SA_API saStatus saSetCalFilePath (const char *path)
 
SA_API saStatus saGetSerialNumber (int device, int *serial)
 
SA_API saStatus saGetFirmwareString (int device, char firmwareString[16])
 
SA_API saStatus saGetDeviceType (int device, saDeviceType *device_type)
 
SA_API saStatus saConfigAcquisition (int device, int detector, int scale)
 
SA_API saStatus saConfigCenterSpan (int device, double center, double span)
 
SA_API saStatus saConfigLevel (int device, double ref)
 
SA_API saStatus saConfigGainAtten (int device, int atten, int gain, bool preAmp)
 
SA_API saStatus saConfigSweepCoupling (int device, double rbw, double vbw, bool reject)
 
SA_API saStatus saConfigRBWShape (int device, int rbwShape)
 
SA_API saStatus saConfigProcUnits (int device, int units)
 
SA_API saStatus saConfigIQ (int device, int decimation, double bandwidth)
 
SA_API saStatus saConfigAudio (int device, int audioType, double centerFreq, double bandwidth, double audioLowPassFreq, double audioHighPassFreq, double fmDeemphasis)
 
SA_API saStatus saConfigRealTime (int device, double frameScale, int frameRate)
 
SA_API saStatus saConfigRealTimeOverlap (int device, double advanceRate)
 
SA_API saStatus saSetTimebase (int device, int timebase)
 
SA_API saStatus saInitiate (int device, int mode, int flag)
 
SA_API saStatus saAbort (int device)
 
SA_API saStatus saQuerySweepInfo (int device, int *sweepLength, double *startFreq, double *binSize)
 
SA_API saStatus saQueryStreamInfo (int device, int *returnLen, double *bandwidth, double *samplesPerSecond)
 
SA_API saStatus saQueryRealTimeFrameInfo (int device, int *frameWidth, int *frameHeight)
 
SA_API saStatus saQueryRealTimePoi (int device, double *poi)
 
SA_API saStatus saGetSweep_32f (int device, float *min, float *max)
 
SA_API saStatus saGetSweep_64f (int device, double *min, double *max)
 
SA_API saStatus saGetPartialSweep_32f (int device, float *min, float *max, int *start, int *stop)
 
SA_API saStatus saGetPartialSweep_64f (int device, double *min, double *max, int *start, int *stop)
 
SA_API saStatus saGetRealTimeFrame (int device, float *minSweep, float *maxSweep, float *colorFrame, float *alphaFrame)
 
SA_API saStatus saGetIQ_32f (int device, float *iq)
 
SA_API saStatus saGetIQ_64f (int device, double *iq)
 
SA_API saStatus saGetIQData (int device, saIQPacket *pkt)
 
SA_API saStatus saGetIQDataUnpacked (int device, float *iqData, int iqCount, int purge, int *dataRemaining, int *sampleLoss, int *sec, int *milli)
 
SA_API saStatus saGetAudio (int device, float *audio)
 
SA_API saStatus saQueryTemperature (int device, float *temp)
 
SA_API saStatus saQueryDiagnostics (int device, float *voltage)
 
SA_API saStatus saAttachTg (int device)
 
SA_API saStatus saIsTgAttached (int device, bool *attached)
 
SA_API saStatus saConfigTgSweep (int device, int sweepSize, bool highDynamicRange, bool passiveDevice)
 
SA_API saStatus saStoreTgThru (int device, int flag)
 
SA_API saStatus saSetTg (int device, double frequency, double amplitude)
 
SA_API saStatus saSetTgReference (int device, int reference)
 
SA_API saStatus saGetTgFreqAmpl (int device, double *frequency, double *amplitude)
 
SA_API saStatus saConfigIFOutput (int device, double inputFreq, double outputFreq, int inputAtten, int outputGain)
 
SA_API saStatus saSelfTest (int device, saSelfTestResults *results)
 
SA_API const char * saGetAPIVersion ()
 
SA_API const char * saGetProductID ()
 
SA_API const char * saGetErrorString (saStatus code)
 

Detailed Description

API functions for the SA44/124 spectrum analyzers.

This is the main file for user accessible functions for controlling the SA44 and SA124 spectrum analyzers.

Macro Definition Documentation

◆ SA_TRUE

#define SA_TRUE   (1)

Used for boolean true when integer parameters are being used.

◆ SA_FALSE

#define SA_FALSE   (0)

Used for boolean false when integer parameters are being used.

◆ SA_MAX_DEVICES

#define SA_MAX_DEVICES   8

Maximum number of devices that can be interfaced in the API. See saGetSerialNumberList.

◆ SA44_MIN_FREQ

#define SA44_MIN_FREQ   (1.0)

Minimum frequency (Hz) for sweeps, and minimum center frequency for I/Q measurements for SA44 devices. See saConfigCenterSpan.

◆ SA124_MIN_FREQ

#define SA124_MIN_FREQ   (100.0e3)

Minimum frequency (Hz) for sweeps, and minimum center frequency for I/Q measurements for SA124 devices. See saConfigCenterSpan.

◆ SA44_MAX_FREQ

#define SA44_MAX_FREQ   (4.4e9)

Maximum frequency (Hz) for sweeps, and maximum center frequency for I/Q measurements for SA44 devices. See saConfigCenterSpan.

◆ SA124_MAX_FREQ

#define SA124_MAX_FREQ   (13.0e9)

Maximum frequency (Hz) for sweeps, and maximum center frequency for I/Q measurements for SA124 devices. See saConfigCenterSpan.

◆ SA_MIN_SPAN

#define SA_MIN_SPAN   (1.0)

Minimum span (Hz) for sweeps. See saConfigCenterSpan.

◆ SA_MAX_REF

#define SA_MAX_REF   (20)

Maximum reference level in dBm. See saConfigLevel.

◆ SA_MAX_ATTEN

#define SA_MAX_ATTEN   (3)

Maximum attentuation. Valid values [0,3] or -1 for auto. See saConfigGainAtten.

◆ SA_MAX_GAIN

#define SA_MAX_GAIN   (2)

Maximum gain. Valid values [0,2] or -1 for auto. See saConfigGainAtten.

◆ SA_MIN_RBW

#define SA_MIN_RBW   (0.1)

Minimum RBW (Hz) for sweeps. See saConfigSweepCoupling.

◆ SA_MAX_RBW

#define SA_MAX_RBW   (6.0e6)

Maximum RBW (Hz) for sweeps. See saConfigSweepCoupling.

◆ SA_MIN_RT_RBW

#define SA_MIN_RT_RBW   (100.0)

Minimum RBW (Hz) for device configured in real-time measurement mode. See saConfigSweepCoupling.

◆ SA_MAX_RT_RBW

#define SA_MAX_RT_RBW   (10000.0)

Maximum RBW (Hz) for device configured in real-time measurement mode. See saConfigSweepCoupling.

◆ SA_MIN_IQ_BANDWIDTH

#define SA_MIN_IQ_BANDWIDTH   (100.0)

Minimum I/Q bandwidth (Hz). See saConfigIQ.

◆ SA_MAX_IQ_DECIMATION

#define SA_MAX_IQ_DECIMATION   (128)

Maximum I/Q bandwidth (Hz). See saConfigIQ.

◆ SA_IQ_SAMPLE_RATE

#define SA_IQ_SAMPLE_RATE   (486111.111)

Base I/Q sample rate in Hz. See saConfigIQ.

◆ SA_IDLE

#define SA_IDLE   (-1)

Measurement mode: Idle, no measurement. See saInitiate.

◆ SA_SWEEPING

#define SA_SWEEPING   (0x0)

Measurement mode: Swept spectrum analysis. See saInitiate.

◆ SA_REAL_TIME

#define SA_REAL_TIME   (0x1)

Measurement mode: Real-time spectrum analysis. See saInitiate.

◆ SA_IQ

#define SA_IQ   (0x2)

Measurement mode: I/Q streaming. See saInitiate.

◆ SA_AUDIO

#define SA_AUDIO   (0x3)

Measurement mode: Audio demod. See saInitiate.

◆ SA_TG_SWEEP

#define SA_TG_SWEEP   (0x4)

Measurement mode: Tracking generator sweeps for scalar network analysis. See saInitiate.

◆ SA_RBW_SHAPE_FLATTOP

#define SA_RBW_SHAPE_FLATTOP   (0x1)

Specifies the Stanford flattop window used for sweep and real-time analysis. See saConfigRBWShape.

◆ SA_RBW_SHAPE_CISPR

#define SA_RBW_SHAPE_CISPR   (0x2)

Specifies a Gaussian window with 6dB cutoff used for sweep and real-time analysis. See saConfigRBWShape.

◆ SA_MIN_MAX

#define SA_MIN_MAX   (0x0)

Use min/max detector for sweep and real-time spectrum analysis. See saConfigAcquisition.

◆ SA_AVERAGE

#define SA_AVERAGE   (0x1)

Use average detector for sweep and real-time spectrum analysis. See saConfigAcquisition.

◆ SA_LOG_SCALE

#define SA_LOG_SCALE   (0x0)

Specifies dBm units of sweep and real-time spectrum analysis measurements. See saConfigAcquisition.

◆ SA_LIN_SCALE

#define SA_LIN_SCALE   (0x1)

Specifies mV units of sweep and real-time spectrum analysis measurements. See saConfigAcquisition.

◆ SA_LOG_FULL_SCALE

#define SA_LOG_FULL_SCALE   (0x2)

Specifies dBm units, with no corrections, of sweep and real-time spectrum analysis measurements. See saConfigAcquisition.

◆ SA_LIN_FULL_SCALE

#define SA_LIN_FULL_SCALE   (0x3)

Specifies mV units, with no corrections, of sweep and real-time spectrum analysis measurements. See saConfigAcquisition.

◆ SA_AUTO_ATTEN

#define SA_AUTO_ATTEN   (-1)

Automatically choose attenuation based on reference level. See saConfigGainAtten.

◆ SA_AUTO_GAIN

#define SA_AUTO_GAIN   (-1)

Automatically choose gain based on reference level. See saConfigGainAtten.

◆ SA_LOG_UNITS

#define SA_LOG_UNITS   (0x0)

VBW processing occurs in dBm. See saConfigProcUnits.

◆ SA_VOLT_UNITS

#define SA_VOLT_UNITS   (0x1)

VBW processing occurs in linear voltage units (mV). See saConfigProcUnits.

◆ SA_POWER_UNITS

#define SA_POWER_UNITS   (0x2)

VBW processing occurs in linear power units (mW). See saConfigProcUnits.

◆ SA_BYPASS

#define SA_BYPASS   (0x3)

No VBW processing. See saConfigProcUnits.

◆ SA_AUDIO_AM

#define SA_AUDIO_AM   (0x0)

Audio demodulation type: AM. See saConfigAudio.

◆ SA_AUDIO_FM

#define SA_AUDIO_FM   (0x1)

Audio demodulation type: FM. See saConfigAudio.

◆ SA_AUDIO_USB

#define SA_AUDIO_USB   (0x2)

Audio demodulation type: Upper side band. See saConfigAudio.

◆ SA_AUDIO_LSB

#define SA_AUDIO_LSB   (0x3)

Audio demodulation type: Lower side band. See saConfigAudio.

◆ SA_AUDIO_CW

#define SA_AUDIO_CW   (0x4)

Audio demodulation type: CW. See saConfigAudio.

◆ TG_THRU_0DB

#define TG_THRU_0DB   (0x1)

In scalar network analysis, use the next trace as a thru. See saStoreTgThru.

◆ TG_THRU_20DB

#define TG_THRU_20DB   (0x2)

In scalar network analysis, improve accuracy with a second thru step. See saStoreTgThru.

◆ SA_REF_UNUSED

#define SA_REF_UNUSED   (0)

Additional corrections are applied to tracking generator timebase. See saSetTgReference.

◆ SA_REF_INTERNAL_OUT

#define SA_REF_INTERNAL_OUT   (1)

Use tracking generator timebase as frequency standard for system, and do not apply additional corrections. See saSetTgReference.

◆ SA_REF_EXTERNAL_IN

#define SA_REF_EXTERNAL_IN   (2)

Use an external reference for TG124A, and do not apply additional corrections to timebase. See saSetTgReference.

Enumeration Type Documentation

◆ saDeviceType

Device type

Enumerator
saDeviceTypeNone 

None

saDeviceTypeSA44 

SA44

saDeviceTypeSA44B 

SA44B

saDeviceTypeSA124A 

SA124A

saDeviceTypeSA124B 

SA124B

◆ saStatus

enum saStatus

Status code returned from all SA API functions. Errors are negative and suffixed with 'Err'. Errors stop the flow of execution, warnings do not.

Enumerator
saUnknownErr 

Unknown/unexpected error.

saFrequencyRangeErr 

Span outside frequency range.

saInvalidDetectorErr 

Invalid detector value provided.

saInvalidScaleErr 

Invalid scale provided.

saBandwidthErr 

Invalid resolution bandwidth provided: must be between 0.1 Hz and 4.4 GHz.

saExternalReferenceNotFound 

External Reference Not Found. Internal reference will be used.

saLNAErr 

LNA error.

saOvenColdErr 

10 MHz OCXO cold. Try again after 60 second warm-up.

saInternetErr 

Unable to connect to the internet or unable to find the necessary calibration file on the internet during initialization. Ensure your PC has an internet connection and try again. If it is connected to the internet and you are still receiving this message, please contact Signal Hound.

saUSBCommErr 

USB communications error.

saTrackingGeneratorNotFound 

Unable to find a connected and available Signal Hound tracking generator.

saDeviceNotIdleErr 

Cannot perform requested operation while the device is active.

saDeviceNotFoundErr 

Device not found.

saInvalidModeErr 

Cannot perform the requested operation in this mode of operation.

saNotConfiguredErr 

The device is not properly configured.

saTooManyDevicesErr 

Unable to open any more devices.

saInvalidParameterErr 

Invalid parameter provided.

saDeviceNotOpenErr 

Device specified is not open.

saInvalidDeviceErr 

Invalid device number provided.

saNullPtrErr 

One or more parameters are NULL.

saNoError 

Function returned successfully. No warnings or errors.

saNoCorrections 

No corrections found on device, data will be uncalibrated.

saCompressionWarning 

Device in compression. IF Overload.

saParameterClamped 

Supplied parameter clamped/limited to a set of known values or to within an accepted range of operating values.

saBandwidthClamped 

Supplied bandwidth limited to within an accepted range of operating values.

saCalFilePermissions 

Unable to store correction data locally.

Function Documentation

◆ saGetSerialNumberList()

SA_API saStatus saGetSerialNumberList ( int  serialNumbers[8],
int *  deviceCount 
)

This function returns the devices that are unopened in the current process. Up to SA_MAX_DEVICES devices will be returned. The serial numbers of the unopened devices are returned. The provided array will be populated starting at index 0. The integer pointed to by deviceCount will equal the number of devices reported by this function upon returning.

Parameters
[out]serialNumbersA pointer to an array of at minimum SA_MAX_DEVICES contiguous 32-bit integers. It is undefined behavior if the array pointed to by serialNumbers is not SA_MAX_DEVICES integers in length.
[out]deviceCountPointer to an integer. Will be set to the number of devices found on the system.
Returns

◆ saOpenDeviceBySerialNumber()

SA_API saStatus saOpenDeviceBySerialNumber ( int *  device,
int  serialNumber 
)

This function is similar to saOpenDevice except you can specify the serial number of the device you wish to open. Everything else is identical.

Parameters
[out]devicePointer to 32-bit integer variable. If this function returns successfully, the value device points to will contain a unique handle value to the device opened. This number is used for all successive API function calls.
[in]serialNumberUser-provided serial number.
Returns

◆ saOpenDevice()

SA_API saStatus saOpenDevice ( int *  device)

This function attempts to open the first SA44/SA124 it detects. If a device is opened successfully, a handle to the device will be returned through the device pointer which can be used to target that device for other API calls.

When successful, this function takes about 5 seconds to perform. If it is the first time a device is opened on a host PC, this function can potentially take much longer. See First Time Opening a New Device.

Parameters
[out]devicePointer to 32-bit integer variable. If this function returns successfully, the value device points to will contain a unique handle value to the device opened. This number is used for all successive API function calls.
Returns

◆ saCloseDevice()

SA_API saStatus saCloseDevice ( int  device)

This function is called when you wish to terminate a connection with a device. Any resources the device has allocated will be freed and the USB 2.0 connection to the device is terminated. The device closed will be released and will become available to be opened again. Any activity the device is performing is aborted automatically before closing.

Parameters
[in]deviceDevice handle.
Returns

◆ saPreset()

SA_API saStatus saPreset ( int  device)

This function exists to invoke a hard reset of the device. This will function similarly to a power cycle (unplug/re-connect the device). This might be useful if the device has entered an undesirable or unrecoverable state. This function might allow the software to perform the reset rather than ask the user to perform a power cycle.

Functionally, in addition to a hard reset, this function closes the device as if saCloseDevice was called. This means the device handle becomes invalid and the device must be reopened for use.

This function is a blocking call and takes about 2.5 seconds to return.

Example

{c++}
// This short function shows how to preset a device in the
// quickest way possible. Both saPreset and saOpenDevice
// are blocking calls. It may be preferred to perform this
// function in a separate thread.
saStatus PresetDevice(int *device_id)
{
saPreset(*device_id);
return saOpenDevice(device_id);
}
SA_API saStatus saOpenDevice(int *device)
saStatus
Definition: sa_api.h:237
SA_API saStatus saPreset(int device)
Parameters
[in]deviceDevice handle.
Returns

◆ saSetCalFilePath()

SA_API saStatus saSetCalFilePath ( const char *  path)

This function should be called before opening the device. Ideally it should be the first function called in a program interfacing the device. The path specified should be suffixed with the ‘/’ or ‘\’ character, denoting that it is a directory. Failure to append a slash character will result in undesired behavior.

See examples of usage below.

When a device is opened, the API will look in the supplied path for the required calibration files. If the folder does not exist, it will be created. If the files do not exist in the folder, they will be acquired from the device flash memory where applicable, and for all other devices downloaded from the Signal Hound web server. The files will be placed in the supplied directory for future use. If the files exist in the directory, they will simply be loaded into memory.

This function does not need to be called, as it will use a default system path, typically C:/ProgramData/SignalHound/cal_files/.

Examples

To set the working directory as the calibration file path call the function as saSetCalFilePath(“.\\”);

To set an absolute path, you might call the function as saSetCalFilePath(“C:\\ProgramData\\SignalHound\\CalFiles\\”);

Parameters
[in]path
Returns

◆ saGetSerialNumber()

SA_API saStatus saGetSerialNumber ( int  device,
int *  serial 
)

This function may be called only after the device has been opened. The serial number returned should match the number on the case.

Parameters
[in]deviceDevice handle.
[out]serialPointer to a 32-bit integer which will be assigned the serial number of the device specified.
Returns

◆ saGetFirmwareString()

SA_API saStatus saGetFirmwareString ( int  device,
char  firmwareString[16] 
)

Use this function to determine the firmware version of a specified device.

Parameters
[in]deviceDevice handle.
[out]firmwareStringPointer to a char array. The array should be at minimum 16 chars in length.
Returns

◆ saGetDeviceType()

SA_API saStatus saGetDeviceType ( int  device,
saDeviceType device_type 
)

This function may be called only after the device has been opened. If the device handle is valid, type will contain the model type of the device pointed to by the handle. type is an enumerated value of type saDeviceType.

Parameters
[in]deviceDevice handle.
[out]device_typePointer to an integer to receive the model type.
Returns

◆ saConfigAcquisition()

SA_API saStatus saConfigAcquisition ( int  device,
int  detector,
int  scale 
)

detector specifies how to produce the results of the signal processing for the final sweep. Depending on settings, potentially many overlapping FFTs will be performed on the input time domain data to retrieve a more consistent and accurate final result. When the results overlap detector chooses whether to average the results together, or maintain the minimum and maximum values. If averaging is chosen, the min and max sweep arrays will contain the same averaged data.

The scale parameter will change the units of returned sweeps. If SA_LOG_SCALE is provided sweeps will be returned in amplitude unit dBm. If SA_LIN_SCALE, the returned units will be in millivolts. If the full scale units are specified, no corrections are applied to the data and amplitudes are taken directly from the full scale input

Parameters
[in]deviceDevice handle.
[in]detectorSpecifies the video detector. The two possible values are SA_MIN_MAX and SA_AVERAGE
[in]scaleSpecifies the scale in which sweep results are returned. The four possible values are SA_LOG_SCALE, SA_LIN_SCALE, SA_LOG_FULL_SCALE, and SA_LIN_FULL_SCALE.
Returns

◆ saConfigCenterSpan()

SA_API saStatus saConfigCenterSpan ( int  device,
double  center,
double  span 
)

This function configures the operating frequency band of the device. Start and stop frequencies can be determined from the center and span.

start = center – (span / 2) stop = center + (span / 2)

The values provided are used by the device during initialization and a more precise start frequency is returned after initiation. Refer to saQuerySweepInfo for more information.

Each device has a specified operational frequency range between some minimum and maximum frequency. The limits are defined by SA44_MIN_FREQ, SA124_MIN_FREQ, SA44_MAX_FREQ, and SA124_MAX_FREQ. The center and span provided cannot specify a sweep outside of this range. Certain modes of operation have specific frequency range limits. Those mode-dependent limits are tested against during saInitiate and not here.

Parameters
[in]deviceDevice handle.
[in]centerCenter frequency in hertz.
[in]spanSpan in hertz.
Returns

◆ saConfigLevel()

SA_API saStatus saConfigLevel ( int  device,
double  ref 
)

This function is best utilized when the device attenuation and gain are set to automatic (default). When both attenuation and gain are set to SA_AUTO_ATTEN and SA_AUTO_GAIN, respectively, the API uses the reference level to best choose the gain and attenuation for maximum dynamic range. The API chooses attenuation and gain values best for analyzing signal at or below the reference level. For this reason, to achieve the best results, use auto gain and atten, and set your reference level at or slightly about your expected input power for best sensitivity. Reference level is specified in dBm units.

Parameters
[in]deviceDevice handle.
[in]refReference level in dBm.
Returns

◆ saConfigGainAtten()

SA_API saStatus saConfigGainAtten ( int  device,
int  atten,
int  gain,
bool  preAmp 
)

To set attenuation or gain to automatic, pass SA_AUTO_GAIN and SA_AUTO_ATTEN as parameters. The preamp parameter is ignored when gain and attenuation are automatic and is chosen automatically.

<em>atten</em> parameter

Supplied Parameter SA44 Attenuation SA124 Attenuation
SA_AUTO_ATTEN (-1) Auto Auto
0 0 dB 0 dB
1 5 dB 10 dB
2 10 dB 20 dB
3 15 dB 30 dB

<em>gain</em> parameter

Supplied Parameter Gain
SA_AUTO_GAIN (-1) Auto
0 16 dB Attenuation
1 Mid-Range
2 12 dB Digital Gain

By default, if this function is not called, gain and attenuation are set to automatic. It is suggested to leave these values as automatic as it will greatly increase the consistency of your results. If you choose to manually control gain and attenuation please read Setting Gain and Attenuation.

Parameters
[in]deviceDevice handle.
[in]attenAttenuator setting.
[in]gainGain setting.
[in]preAmpSpecify whether to enable the internal device pre-amplifier.
Returns

◆ saConfigSweepCoupling()

SA_API saStatus saConfigSweepCoupling ( int  device,
double  rbw,
double  vbw,
bool  reject 
)

The resolution bandwidth, or RBW, represents the bandwidth of spectral energy represented in each frequency bin. For example, with an RBW of 10 kHz, the amplitude value for each bin would represent the total energy from 5 kHz below to 5 kHz above the bin’s center.

The video bandwidth, or VBW, is applied after the signal has been converted to frequency domain as power, voltage, or log units. It is implemented as a simple rectangular window, averaging the amplitude readings for each frequency bin over several overlapping FFTs. A signal whose amplitude is modulated at a much higher frequency than the VBW will be shown as an average, whereas amplitude modulation at a lower frequency will be shown as a minimum and maximum value.

Available RBWs are [0.1Hz – 100kHz] and 250kHz. For the SA124 devices, a 6MHz RBW is available as well. Not all RBWs will be available depending on span, for example the API may restrict RBW when a sweep size exceeds a certain amount. Also there are many hardware limitations that restrict certain RBWs, for a full list of these restrictions, see Setting RBW and VBW.

The parameter reject determines whether software image reject will be performed. The SA series spectrum analyzers do not have hardware-based image rejection, instead relying on a software algorithm to reject image responses. See the SA44B User Manual or SA124B User Manual for additional details. Generally, set reject to true for continuous signals, and false to catch short duration signals at a known frequency. To capture short duration signals with an unknown frequency, consider the Signal Hound BB60C, BB60D, SM200B, SM200C, or SM435B spectrum analyzers.

Parameters
[in]deviceDevice handle.
[in]rbwResolution bandwidth in Hz. RBW can be arbitrary.
[in]vbwVideo bandwidth in Hz. VBW must be less than or equal to RBW. VBW can be arbitrary. For best performance use RBW as the VBW.
[in]rejectIndicates whether to enable image rejection.
Returns

◆ saConfigRBWShape()

SA_API saStatus saConfigRBWShape ( int  device,
int  rbwShape 
)

Specify the RBW filter shape, which is achieved by changing the window function. When specifying SA_RBW_SHAPE_FLATTOP, a custom bandwidth flat-top window is used measured at the 3dB cutoff point. When specifying SA_RBW_SHAPE_CISPR, a Gaussian window with zero-padding is used to achieve the specified RBW. The Gaussian window is measured at the 6dB cutoff point.

Parameters
[in]deviceDevice handle.
[in]rbwShapeAn acceptable RBW filter shape value, either SA_RBW_SHAPE_FLATTOP or SA_RBW_SHAPE_CISPR.
Returns

◆ saConfigProcUnits()

SA_API saStatus saConfigProcUnits ( int  device,
int  units 
)

The units provided determines what unit type video processing occurs in. The chart below shows which unit types are used for each units selection.

For “average power” measurements, SA_POWER_UNITS should be selected. For cleaning up an amplitude modulated signal, SA_VOLT_UNITS would be a good choice. To emulate a traditional spectrum analyzer, select SA_LOG_UNITS. To minimize processing power and bypass video bandwidth processing, select SA_BYPASS.

Macro Unit
SA_LOG_UNITS dBm
SA_VOLT_UNITS mV
SA_POWER_UNITS mW
SA_BYPASS No video processing
Parameters
[in]deviceDevice handle.
[in]unitsThe possible values are SA_POWER_UNITS, SA_LOG_UNITS, SA_VOLT_UNITS, and SA_BYPASS.
Returns

◆ saConfigIQ()

SA_API saStatus saConfigIQ ( int  device,
int  decimation,
double  bandwidth 
)

This function is used to configure the digital I/Q data stream. A decimation factor and filter bandwidth are able to be specified. The decimation rate divides the I/Q sample rate directly while the bandwidth parameter further filters the digital stream.

For any given decimation rate, a minimum filter bandwidth must be applied to account for sufficient filter roll off. If a bandwidth value is supplied above the maximum for a given decimation, the bandwidth will be clamped to the maximum value. For a list of possible decimation values and associated bandwidth values, see the table below.

The base sample rate of the SA44 and SA124 spectrum analyzers is 486.111111 (repeating) kS/s. To get a precise sample rate given a decimation value, use this equation.

sample rate = 486111.11111~ / decimation

Decimation Rate Maximum Bandwidth
1 250.0 kHz
2 225.0 kHz
4 100.0 kHz
8 50.0 kHz
16 20 kHz
32 12.0 kHz
64 5.0 kHz
128 3.0 kHz
Parameters
[in]deviceDevice handle.
[in]decimationSpecify a decimation rate for the I/Q data stream.
[in]bandwidthSpecify the band pass filter width on the I/Q digital stream.
Returns

◆ saConfigAudio()

SA_API saStatus saConfigAudio ( int  device,
int  audioType,
double  centerFreq,
double  bandwidth,
double  audioLowPassFreq,
double  audioHighPassFreq,
double  fmDeemphasis 
)

This function is used to configure the majority of the audio stream settings. A number of audio modulation types are supported, and a number of filter parameters can be set.

Below is the overall flow of data through our audio processing algorithm:

Parameters
[in]deviceDevice handle.
audioTypeSpecifies the demodulation scheme, possible values are SA_AUDIO_AM, SA_AUDIO_FM, SA_AUDIO_USB, SA_AUDIO_LSB, and SA_AUDIO_CW.
centerFreqCenter frequency in Hz of audio signal to demodulate.
bandwidthIntermediate frequency bandwidth centered on freq. Filter takes place before demodulation. Specified in Hz. Should be between 500Hz and 500kHz.
audioLowPassFreqPost demodulation filter in Hz. Should be between 1kHz and 12kHz.
audioHighPassFreqPost demodulation filter in Hz. Should be between 20 and 1000Hz.
fmDeemphasisSpecified in microseconds. Should be between 1 and 100. This value is ignored if audioType is not equal to SA_AUDIO_FM.
Returns

◆ saConfigRealTime()

SA_API saStatus saConfigRealTime ( int  device,
double  frameScale,
int  frameRate 
)

The function allows you to configure additional parameters of the real-time frames returned from the API. If this function is not called a scale of 100dB is used and a frame rate of 30fps is used. For more information regarding real-time mode see Real-Time Spectrum Analysis.

Parameters
[in]deviceDevice handle.
[in]frameScaleSpecify the real-time frame height in dB. Values can be between [10 - 200].
[in]frameRateSpecify the real-time frame rate in frames per seconds. Values can be between [4 – 30].
Returns

◆ saConfigRealTimeOverlap()

SA_API saStatus saConfigRealTimeOverlap ( int  device,
double  advanceRate 
)

By setting the advance rate users can control the overlap rate of the FFT processing in real-time spectrum analysis. The advanceRate parameter specifies how far the FFT window slides through the data for each FFT as a function of FFT size. An advanceRate of 0.5 specifies that the FFT window will advance 50% the FFT length for each FFT for a 50% overlap rate. Specifying a value of 1.0 would mean the FFT window advances the full FFT length meaning there is no overlap in real-time processing. The default value is 0.125 and the range of acceptable values is between [0.125, 10]. Increasing the advance rate reduces processing considerably but also increases the 100% probability of intercept of the device.

Parameters
[in]deviceDevice handle.
[in]advanceRateFFT advance rate. See description.
Returns

◆ saSetTimebase()

SA_API saStatus saSetTimebase ( int  device,
int  timebase 
)

Configure the time base reference port for the device. By passing a value of SA_REF_INTERNAL_OUT you can output the internal 10MHz time base of the device out on the reference port. By passing a value of SA_REF_EXTERNAL_IN the API attempts to enable a 10MHz reference on the reference BNC port. If no reference is found, the device continues to use the internal reference clock. Once a device has successfully switched to an external reference it must remain using it until the device is closed, and it is undefined behavior to disconnect the reference input from the reference BNC port.

Parameters
[in]deviceDevice handle.
[in]timebaseTime base setting value. Acceptable inputs are SA_REF_INTERNAL_OUT and SA_REF_EXTERNAL_IN.
Returns

◆ saInitiate()

SA_API saStatus saInitiate ( int  device,
int  mode,
int  flag 
)

This function configures the device into a state determined by the mode parameter. For more information regarding operating states, refer to the Theory of Operation and Modes of Operation sections. This function calls saAbort before attempting to reconfigure. It should be noted, if an error occurs attempting to configure the device, any past operating state will no longer be active and the device will become idle.

Parameters
[in]deviceDevice handle.
[in]modeThe possible values for mode are SA_IDLE, SA_SWEEPING, SA_REAL_TIME, SA_IQ, SA_AUDIO, and SA_TG_SWEEP.
[in]flagThis value is currently unused. Pass 0 as a parameter.
Returns

◆ saAbort()

SA_API saStatus saAbort ( int  device)

Stops the device operation and places the device into an idle state. If the device is currently idle, then the function returns normally and returns saNoError.

Parameters
[in]deviceDevice handle.
Returns

◆ saQuerySweepInfo()

SA_API saStatus saQuerySweepInfo ( int  device,
int *  sweepLength,
double *  startFreq,
double *  binSize 
)

This function should be called to determine sweep characteristics after a device has been configured and initiated.

Parameters
[in]deviceDevice handle.
[out]sweepLengthA pointer to a 32-bit integer. If the function returns successfully, the integer pointed to will contain the size of the min and max arrays returned by saGetSweep_32f and saGetSweep_64f.
[out]startFreqA pointer to a 64-bit floating point variable. If the function returns successfully, the variable startFreq points to will equal the frequency of the first bin in the configured sweep.
[out]binSizeA pointer to a 64-bit floating point variable. If the function returns successfully, the variable binSize points to will contain the frequency difference between each bin in the configured sweep.
Returns

◆ saQueryStreamInfo()

SA_API saStatus saQueryStreamInfo ( int  device,
int *  returnLen,
double *  bandwidth,
double *  samplesPerSecond 
)

Use this function to get the parameters of the I/Q data stream.

Parameters
[in]deviceDevice handle.
[out]returnLenPointer to a 32-bit integer. If the function returns successfully, the variable returnLen points to will contain the number of I/Q sample pairs that will be returned by calling saGetIQ_32f/saGetIQ_64f.
[out]bandwidthPointer to a 64-bit float. If the function returns successfully, the variable bandwidth points to will contain the bandpass filter bandwidth width in Hz. Width is specified by the 3dB roll-off points.
[out]samplesPerSecondPointer to a 32-bit integer. If the function returns successfully, the variable samplesPerSecond points to will contain the sample rate of the configured I/Q data stream.
Returns

◆ saQueryRealTimeFrameInfo()

SA_API saStatus saQueryRealTimeFrameInfo ( int  device,
int *  frameWidth,
int *  frameHeight 
)

This function should be called after initializing the device for real-time mode. This device returns the frame size of the real-time frame configured.

Parameters
[in]deviceDevice handle.
[out]frameWidthPointer to a 32-bit signed integer representing the width of the real-time frame.
[out]frameHeightPointer to a 32-bit signed integer representing the height of the real-time frame.
Returns

◆ saQueryRealTimePoi()

SA_API saStatus saQueryRealTimePoi ( int  device,
double *  poi 
)

When this function returns successfully, the value poi points to will contain the 100% probability of intercept duration in seconds of the device as currently configured in real-time spectrum analysis. The device must actively be configured and initialized in the real-time spectrum analysis mode.

Parameters
[in]deviceDevice handle.
[out]poiPointer to double. See description.
Returns

◆ saGetSweep_32f()

SA_API saStatus saGetSweep_32f ( int  device,
float *  min,
float *  max 
)

Upon returning successfully, this function returns the minimum and maximum floating point arrays of one full sweep. If the detector provided in saConfigAcquisition is SA_AVERAGE, the arrays will be populated with the same values. Element zero of each array corresponds to the startFreq returned from saQuerySweepInfo.

Parameters
[in]deviceDevice handle.
[out]minPointer to the beginning of an array of 32-bit floating point values, whose length is equal to or greater than sweepLength returned from saQuerySweepInfo.
[out]maxPointer to the beginning of an array of 32-bit floating point values, whose length is equal to or greater than sweepLength returned from saQuerySweepInfo.
Returns

◆ saGetSweep_64f()

SA_API saStatus saGetSweep_64f ( int  device,
double *  min,
double *  max 
)

See saGetSweep_32f.

Parameters
[in]deviceDevice handle.
[out]minPointer to the beginning of an array of 64-bit floating point values, whose length is equal to or greater than sweepLength returned from saQuerySweepInfo.
[out]maxPointer to the beginning of an array of 64-bit floating point values, whose length is equal to or greater than sweepLength returned from saQuerySweepInfo.
Returns

◆ saGetPartialSweep_32f()

SA_API saStatus saGetPartialSweep_32f ( int  device,
float *  min,
float *  max,
int *  start,
int *  stop 
)

This function is similar to the saGetSweep_32f/saGetSweep_64f functions except it can return in certain contexts before the full sweep is ready. This function might return for sweeps which are going to take multiple seconds, providing you with only a portion of the results. This might be useful if you want to perform some signal analysis on portions of the sweep as it is being received, or update other portions of your application during a long acquisition process. Subsequent calls will always provide the next contiguous portion of spectrum.

A buffer that can hold the full sweep must be provided. The pointers start and stop are used to determine which portion of the sweep was updated. The elements in the arrays from [start, stop] will be updated. start and _stop_ - 1 can be used to index the updated portion of the arrays.

The updated portion of the sweep will always at maximum end at the final element of the sweep. For example, if only 20 frequency bins remain after the previous call to saGetPartialSweep_32f/saGetPartialSweep_32f, the next call will update at most 20 points. When the final portion of the sweep has been updated, stop will equal the sweep length. Calling this function again will request and begin the next sweep.

Parameters
[in]deviceDevice handle.
minPointer to an array of 32-bit floating point values, whose length is equal to or greater than sweepLength returned from saQuerySweepInfo.
maxPointer to an array of 32-bit floating point values, whose length is equal to or greater than sweepLength returned from saQuerySweepInfo.
startPointer to a 32-bit integer variable. If the function returns successfully, the variable start points to will contain the start index of the updated portion of the sweep.
stopPointer to a 32-bit integer variable. If the function returns successfully, the variable stop points to will contain the index + 1 of the last update value in the updated portion of the sweep.
Returns

◆ saGetPartialSweep_64f()

SA_API saStatus saGetPartialSweep_64f ( int  device,
double *  min,
double *  max,
int *  start,
int *  stop 
)

See saGetPartialSweep_32f.

Parameters
[in]deviceDevice handle.
minPointer to an array of 64-bit floating point values, whose length is equal to or greater than sweepLength returned from saQuerySweepInfo.
maxPointer to an array of 64-bit floating point values, whose length is equal to or greater than sweepLength returned from saQuerySweepInfo.
startPointer to a 32-bit integer variable. If the function returns successfully, the variable start points to will contain the start index of the updated portion of the sweep.
stopPointer to a 32-bit integer variable. If the function returns successfully, the variable stop points to will contain the index + 1 of the last update value in the updated portion of the sweep.
Returns

◆ saGetRealTimeFrame()

SA_API saStatus saGetRealTimeFrame ( int  device,
float *  minSweep,
float *  maxSweep,
float *  colorFrame,
float *  alphaFrame 
)

This function is used to retrieve the real-time sweeps, frame, and alpha frame for a measurement interval. This function should be used instead of saGetSweep_32f/saGetSweep_64f and saGetPartialSweep_32f/saGetPartialSweep_64f for real-time mode. The sweep array should be ‘N’ contiguous floats, where N is the sweep length returned from saQuerySweepInfo. The frame and alphaFrame should be WxH values long where W and H are the values returned from saQueryRealTimeFrameInfo. For more information see Real-Time Spectrum Analysis.

Parameters
[in]deviceDevice handle.
[out]minSweepIf this pointer is non-null, the min held sweep will be returned to the user. If the detector is set to average, this array will be identical to the maxSweep array returned.
[out]maxSweepIf this pointer is non-null, the max held sweep will be returned to the user. If the detector is set to average, this array contains the averaged results over the measurement interval.
[out]colorFramePointer to a 32-bit floating point array. If the function returns successfully, the contents of the array will contain a single real-time frame.
[out]alphaFramePointer to a 32-bit floating point array. If the function returns successfully, the contents of the array will contain a single real-time alpha frame.
Returns

◆ saGetIQ_32f()

SA_API saStatus saGetIQ_32f ( int  device,
float *  iq 
)

Retrieve the next array of I/Q samples in the stream. The length of the buffer provided to this function is the return length from saQueryStreamInfo * 2. saQueryStreamInfo returns the length as I/Q sample pairs. This function will need to be called ~30 times per second for any given decimation rate for the internal circular buffers not to fall behind. We recommend polling this function from a separate thread and not performing any other tasks on the polling thread to ensure the thread does not fall behind.

The buffer will be populated with alternating I/Q sample pairs scaled to mW. The time difference between each sample can be determined from the sample rate of the configured device.

Parameters
[in]deviceDevice handle.
[out]iqA pointer to a 32-bit floating point array. The contents of this buffer will be updated with interleaved I/Q digital samples.
Returns

◆ saGetIQ_64f()

SA_API saStatus saGetIQ_64f ( int  device,
double *  iq 
)

See saGetIQ_32f.

Parameters
[in]deviceDevice handle.
[out]iqA pointer to a 64-bit floating point array. The contents of this buffer will be updated with interleaved I/Q digital samples.
Returns

◆ saGetIQData()

SA_API saStatus saGetIQData ( int  device,
saIQPacket pkt 
)

This function retrieves one block of I/Q data as specified by the saIQPacket struct.

Parameters
[in]deviceDevice handle.
[out]pktPointer to a saIQPacket struct.
Returns

◆ saGetIQDataUnpacked()

SA_API saStatus saGetIQDataUnpacked ( int  device,
float *  iqData,
int  iqCount,
int  purge,
int *  dataRemaining,
int *  sampleLoss,
int *  sec,
int *  milli 
)

This function provides an alternate interface to the saGetIQData function. Using this function, you can eliminate the need for the saIQPacket struct, which eases development of non-C programming language bindings (languages and environments such as LabVIEW, MATLAB, Python, C#, etc).

The parameters to this function have a one-to-one mapping to the members of the saIQPacket struct.

This function is implemented by populating the saIQPacket struct with the provided parameters and calling saGetIQData.

Parameters
[in]deviceDevice handle.
[out]iqDataSee saIQPacket.
[out]iqCountSee saIQPacket.
[out]purgeSee saIQPacket.
[out]dataRemainingSee saIQPacket.
[out]sampleLossSee saIQPacket.
[out]secSee saIQPacket.
[out]milliSee saIQPacket.
Returns

◆ saGetAudio()

SA_API saStatus saGetAudio ( int  device,
float *  audio 
)

If the device is initiated and running in the audio demodulation mode, the function is a blocking call which returns the next 4096 audio samples. The approximate blocking time for this function is 128 ms if called again immediately after returning. There is no internal buffering of audio, meaning the audio will be overwritten if this function is not called in a timely fashion. The audio values are typically -1.0 to 1.0, representing full-scale audio. In FM mode, the audio values will scale with a change in IF bandwidth.

Parameters
[in]deviceDevice handle.
[out]audioPointer to a 32-bit floating point value array.
Returns

◆ saQueryTemperature()

SA_API saStatus saQueryTemperature ( int  device,
float *  temp 
)

Requesting the internal temperature of the device cannot be performed while the device is currently active. To receive the absolute current internal device temperature, ensure the device is inactive by calling saAbort before calling this function. If the device is active, the temperature returned will be the last temperature returned from this function.

Parameters
[in]deviceDevice handle.
[out]tempPointer to a 32-bit floating point value. If the function returns successfully, the value temp points to will contain the current device temperature.
Returns

◆ saQueryDiagnostics()

SA_API saStatus saQueryDiagnostics ( int  device,
float *  voltage 
)

A USB voltage below 4.55V may cause readings to be out of spec. Check your cable for damage and USB connectors for damage or oxidation.

Parameters
[in]deviceDevice handle.
[out]voltagePointer to a 32-bit floating point value. If the function returns successfully the variable voltage points to will contain the current voltage of the system.
Returns

◆ saAttachTg()

SA_API saStatus saAttachTg ( int  device)

This function attempts to pair an unclaimed Signal Hound tracking generator with an open Signal Hound spectrum analyzer.

Parameters
[in]deviceDevice handle.
Returns

◆ saIsTgAttached()

SA_API saStatus saIsTgAttached ( int  device,
bool *  attached 
)

This function is a helper function to determine if a tracking generator has been previously paired with the specified device.

Parameters
[in]deviceDevice handle.
[out]attachedPointer to a boolean variable. If this function returns successfully, the variable attached points to will contain a true/false value as to whether a tracking generator is paired with the spectrum analyzer.
Returns

◆ saConfigTgSweep()

SA_API saStatus saConfigTgSweep ( int  device,
int  sweepSize,
bool  highDynamicRange,
bool  passiveDevice 
)

This function configures the tracking generator sweeps. Through this function you can request a sweep size. The sweep size is the number of discrete points returned in the sweep over the configured span. The final value chosen by the API can be different than the requested size by a factor of 2 at most. The dynamic range of the sweep is determined by the choice of highDynamicRange and passiveDevice. A value of true for both provides the highest dynamic range sweeps. Choosing false for passiveDevice suggests to the API that the device under test is an active device (amplification).

Parameters
[in]deviceDevice handle.
[in]sweepSizeSuggested sweep size.
[in]highDynamicRangeRequest the ability to perform two store thrus for an increased dynamic range sweep.
[in]passiveDeviceSpecify whether the device under test is a passive device (no gain).
Returns

◆ saStoreTgThru()

SA_API saStatus saStoreTgThru ( int  device,
int  flag 
)

This function, with flag set to TG_THRU_0DB, notifies the API to use the last trace as a thru (your 0 dB reference). Connect your tracking generator RF output to your spectrum analyzer RF input. This can be accomplished using the included SMA to SMA adapter, or anything else you want the software to establish as the 0 dB reference (e.g. the 0 dB setting on a step attenuator, or a 20 dB attenuator you will be including in your amplifier test setup).

After you have established your 0 dB reference, a second step may be performed to improve the accuracy below -40 dB. With approximately 20-30 dB of insertion loss between the spectrum analyzer and tracking generator, call saStoreTgThru with flag set to TG_THRU_20DB. This corrects for slight variations between the high gain and low gain sweeps.

Parameters
[in]deviceDevice handle.
[in]flagSpecify the type of store thru. Possible values are TG_THRU_0DB and TG_THRU_20DB.
Returns

◆ saSetTg()

SA_API saStatus saSetTg ( int  device,
double  frequency,
double  amplitude 
)

This function sets the output frequency and amplitude of the tracking generator. This can only be performed if a tracking generator is paired with a spectrum analyzer and is currently not configured and initiated for TG sweeps.

Parameters
[in]deviceDevice handle.
[in]frequencySet the frequency, in Hz, of the TG output.
[in]amplitudeSet the amplitude, in dBm, of the TG output.
Returns

◆ saSetTgReference()

SA_API saStatus saSetTgReference ( int  device,
int  reference 
)

Configure the time base for the tracking generator attached to the device specified. When SA_REF_UNUSED is specified additional frequency corrections are applied. If using an external reference or you are using the TG time base frequency as the frequency standard in your system, you will want to specify SA_REF_INTERNAL_OUT or SA_REF_EXTERNAL_IN so the additional corrections are not applied.

Parameters
[in]deviceDevice handle.
[in]referenceA valid time base setting value. Possible values are SA_REF_UNUSED, SA_REF_INTERNAL_OUT, and SA_REF_EXTERNAL_IN.
Returns

◆ saGetTgFreqAmpl()

SA_API saStatus saGetTgFreqAmpl ( int  device,
double *  frequency,
double *  amplitude 
)

Retrieve the last set TG output parameters the user set through the saSetTg function. The saSetTg function must have been called for this function to return valid values. If the TG was used to perform scalar network analysis at any point, this function will not return valid values until the saSetTg function is called again.

If a previously set parameter was clamped in the saSetTg function, this function will return the final clamped value.

If any pointer parameter is null, that value is ignored and not returned.

Parameters
[in]deviceDevice handle.
[out]frequencyThe double variable that frequency points to will contain the last set frequency of the TG output in Hz.
[out]amplitudeThe double variable that amplitude points to will contain the last set amplitude of the TG output in dBm.
Returns

◆ saConfigIFOutput()

SA_API saStatus saConfigIFOutput ( int  device,
double  inputFreq,
double  outputFreq,
int  inputAtten,
int  outputGain 
)

The SA124A/B allows a user to configure the device to route the 6 MHz bandwidth intermediate frequency directly to the IF output BNC port. While the IF is routed to the BNC port, the device is incapable of performing sweeps or I/Q streaming. There is no image rejection in this mode.

Calling this function while the device is currently active in a different mode will cause the API to abort the current mode of operation and enable the IF output BNC port. To disable the IF output, simply call saInitiate with the new desired configuration.

The local oscillator mixed with the RF must be 138 MHz or higher, so only high side injection is available below 201 MHz.

Parameters
[in]deviceDevice handle.
[in]inputFreqThe input center frequency on the SMA connector specified in Hz. Must be between 125MHz and 13GHz.
[in]outputFreqThe desired output frequency on the BNC port specified in Hz. Positive for low-side LO injection, negative for high-side. Must be between 34 and 38MHz for the SA124A and between 61 and 65MHz for the SA124B.
[in]inputAttenAttenuation of the input signal specified in dB. Must be between 0 and 30 dB.
[in]outputGainAmplification of the output signal specified in dB. Must be between 0 and 60 dB.
Returns

◆ saSelfTest()

SA_API saStatus saSelfTest ( int  device,
saSelfTestResults results 
)

Performs a self-test and returns the results in an saSelfTestResults struct.

Parameters
[in]deviceDevice handle.
[out]resultsA pointer to an saSelfTestResults struct.
Returns

◆ saGetAPIVersion()

SA_API const char * saGetAPIVersion ( )

Get the current API version.

The returned string is of the form major.minor.revision.

Ascii periods (“.”) separate positive integers. Major/Minor/Revision are not gauranteed to be a single decimal digit. The string is null terminated. An example string is below..

[ ‘1’ | ‘.’ | ‘2’ | ‘.’ | ‘1’ | ‘1’ | ‘\0’ ] = “1.2.11”

Returns

◆ saGetProductID()

SA_API const char * saGetProductID ( )

The product ID is 4302-1103.

Returns

◆ saGetErrorString()

SA_API const char * saGetErrorString ( saStatus  code)

Produce an ASCII string representation of a given status code. Useful for debugging.

Parameters
[in]codeA saStatus value returned from an API call.
Returns