bbFetchRaw(handle, iq_buffer, 0);
// Done
bbCloseDevice(handle);
Another example below introduces the external trigger functionality. The code snippet is very similar to
the one above, and shows the function call for configuring the BNC port to detect rising external
triggers, and retrieving the triggers through the fetchRaw function.
int handle;
bbOpenDevice(&handle);
// Configure an I/Q data stream
bbConfigureCenterSpan(handle, 1000.0e6, 20.0e6);
bbConfigureLevel(handle, 0.0 BB_AUTO_ATTEN);
bbConfigureGain(handle, BB_AUTO_GAIN);
// Set a sample rate of 10.0e6 MS/s and bandwidth of 6 MHz
bbConfigureIQ(handle, 4, 6.0e6);
// Configure BNC port 2 for input rising edge trigger detection
bbConfigureIO(id, 0, BB_PORT2_IN_TRIGGER_RISING_EDGE);
// Initialize the device
bbInitiate(handle, BB_STREAMING, BB_STREAM_IQ);
// Allocate an array large enough for the I/Q stream configured
int buffer_len;
bbQueryStreamInfo(handle, &buffer_len, 0, 0);
float *iq_buffer;
// Allocate an array for ‘buffer_len’ alternating I/Q complex values
iq_buffer = new float[buffer_len * 2];
int trig_buffer[64];
// Retrieve I/Q data packet
bbFetchRaw(handle, iq_buffer, trig_buffer);
// Done
bbCloseDevice(handle);
Using a GPS Receiver to Time-Stamp Data
With minimal effort it is possible to determine the absolute time (up to 50ns) of the ADC samples. This
functionality is only available when the device is configured for IF or I/Q streaming.
What you will need:
1) GPS Receiver capable providing NMEA data, specifically the GPRMC string, and a 1PPS output.
(Tested with Xenith TBR FTS500)
2) The NMEA data must be provided via RS232 (Serial COM port) only once during application
startup, releasing the NMEA data stream for other applications such as a “Drive Test Solution”
to map out signal strengths.
Order of Operations:
1) Ensure correct operation of your GPS receiver.