int trig_buffer[64];
// Retrieve I/Q data packet
bbFetchRaw(handle, iq_buffer, trig_buffer);
// Retrieve the time of the first sample of the last packet retrieved
int seconds, nanoseconds;
bbQueryTimestamp(handle, &seconds, &nanoseconds);
// Done
bbCloseDevice(handle);
Additionally it may be helpful to write a function which determines the time of a single sample using the
returned times from bbQueryTimestamp.
1. /*
2. Retrieve the time of any sample in a packet
3. To do this we need to know the starting time of the packet and
4. the sample we are interested in
5. */
6. void GetSampleTime(
7. unsigned int startSeconds, // In: Seconds returned from QueryTimestamp
8. unsigned int startNanos, // In: Nanoseconds returned from QueryTimestamp
9. unsigned int sample, // In: Sample we are interested in, zero based
10. unsigned int *sampleSeconds, // Out: Seconds for interested sample
11. unsigned int *sampleNanos ) // Out: Nanoseconds for interested sample
12. {
13. // Amount of time between any two samples
14. double delTime = 1.0 / 80000000;
15.
16. // Assuming zero based sample, get output nanos
17. unsigned int outs = startSeconds;
18. unsigned int outns = startNanos + delTime * sample;
19.
20. // If nanos are greater than 1 billion, then we wrap
21. if( outns > 1000000000 ) {
22. outs++;
23. outns -= 1000000000;
24. }
25.
26. *sampleSeconds = outs;
27. *sampleNanos = outns;
28. }
Bandwidth Tables
In Native RBW mode, this table shows the possible RBWs and their corresponding FFT sizes. As of
version 1.0.7 non-native bandwidths do not use this table. Non-native bandwidths can be arbitrary.