The API provides the ability to stream I/Q samples contained in data packets that conform to the ANSI/VITA 49 Radio Transport (VRT) standard.
Examples
For a list of all examples, please see the examples/cpp/vita49 folder in the SDK.
#pragma comment(lib, "sm_api")
void getVRTPackets() {
int device = -1;
}
}
uint32_t contextWordCount;
}
const int dataPacketCount = 1000;
uint16_t samplesPerPkt;
uint32_t dataWordCount;
}
uint32_t wordCount = contextWordCount + dataWordCount * dataPacketCount;
uint32_t *words = new uint32_t[wordCount];
uint32_t *curr = words;
uint32_t actualContextWordCount;
}
if(actualContextWordCount != contextWordCount) {
}
curr += contextWordCount;
uint32_t actualDataWordCount;
}
if(actualDataWordCount != dataWordCount * dataPacketCount) {
}
if(words) delete[] words;
}
API functions for the SM435/SM200 spectrum analyzers.
SM_API SmStatus smSetIQCenterFreq(int device, double centerFreqHz)
#define SM_DEFAULT_PORT
Definition: sm_api.h:64
#define SM_DEFAULT_ADDR
Definition: sm_api.h:62
SM_API SmStatus smSetIQBandwidth(int device, SmBool enableSoftwareFilter, double bandwidth)
SM_API SmStatus smOpenNetworkedDevice(int *device, const char *hostAddr, const char *deviceAddr, uint16_t port)
@ smFalse
Definition: sm_api.h:378
@ smTrue
Definition: sm_api.h:380
@ smModeIQStreaming
Definition: sm_api.h:250
SM_API SmStatus smSetIQSampleRate(int device, int decimation)
SM_API SmStatus smSetRefLevel(int device, double refLevel)
SM_API SmStatus smCloseDevice(int device)
SM_API SmStatus smConfigure(int device, SmMode mode)
SmStatus
Definition: sm_api.h:142
@ smNoError
Definition: sm_api.h:203
#define SM_ADDR_ANY
Definition: sm_api.h:60
SM_API SmStatus smSetVrtStreamID(int device, uint32_t sid)
SM_API SmStatus smSetVrtPacketSize(int device, uint16_t samplesPerPkt)
SM_API SmStatus smGetVrtPackets(int device, uint32_t *words, uint32_t *wordCount, uint32_t packetCount, SmBool purgeBeforeAcquire)
SM_API SmStatus smGetVrtPacketSize(int device, uint16_t *samplesPerPkt, uint32_t *wordCount)
SM_API SmStatus smGetVrtContextPkt(int device, uint32_t *words, uint32_t *wordCount)
SM_API SmStatus smGetVrtContextPktSize(int device, uint32_t *wordCount)
Parsing Example
The parsing example demonstrates how to ingest VRT packets. The code can be used directly in projects that wish to use the VRT functionality.
It is located in examples/cpp/vita49/gui.
GUI Example
The GUI application provides a user-friendly graphical interface to easily experiment with the VRT functionality.
It is located in examples/cpp/vita49/gui, and uses the Qt library.
Basics
VRT is an open radio transport protocol used to transmit and receive sample data between devices. It is defined by the VITA 49 standard. Signal Hound uses the latest version of the standard, 49.2 (2017).
At a high level, blocks of I/Q samples and information about the receiver's state are wrapped/embedded in packets with standard formats.
Type and Function of Packets
VRT uses Signal Data packets and Context packets. Both types contain headers with metadata which includes a Stream Identifier and timestamp.
Signal Data Packets
Signal Data packets encapsulate variable-sized blocks of IQ data, along with a 32-bit trailer to convey additional critical information about the state of the receiver at the time the samples were obtained. For example, if the system was being overdriven this would be reported by an indicator in the trailer.
Context Packets
Context packets contain information about the receiver’s settings. They are of variable size, depending on how many of the possible ~25 fields are used. Which fields are used is communicated by the Context Indicator field, a 32-bit value which precedes the context fields. Signal Hound uses 10 of the possible context fields.
Specification
For a full, precise specification, please see the VRT Manual in the SDK.