Jump to content
  • 0
John User

What is the .qvrt IQ data format?

Question

In the WBT File Format document, section 5.4 IQ Data, it says that "The main IQ data is stored as two, 16 bit numbers per 32-bit word in the Q0-15 format (two’s complement fixed point data format with the radix to the right of bit 15, allowing numbers between -1 and 32767/32768)."  This implies the values are integers.  The figure associated with the description shows two "data fractional parts."

Q: How should the values be interpreted, both numeric values and units (dBm, V2/Hz?)?

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

The I (real) and Q (imaginary) components of the complex sample data are stored as a fixed point representations of decimal numbers that go from -1 to ~1.

There is no "unit" per-se, the extents of the values represent the extents of the data that the ADC / tuner returns.

The following third party link has reasonably good explanatory value as to the nature of the data itself:

http://whiteboard.ping.se/SDR/IQ

Now, expanding on this further with a usage example:

To get the data out of the QVRT file and into a more useful / usable dBm power values, the following process can be used:

  • Note: The API's QVRTFileReadIterator's getCurrentIQDataFloat function will perform steps 1-4 .

1. Read the raw IQ values from the file.

Each IFData packet at this time contrains 995 IQ pairs stored in big-endian,,Q0-15 (a fixed point format).

In short the data is formatted as Big Endian 16 Bit I, followed by a Big endian 16 bit Q followed by the next Big Endian 16 Bit I, followed by a Big endian 16 bit Q, and so on.

2. Swap The bytes for each I and Q to change the data from big to little endian. 

This will turn the sequence of bytes from:

I(Low Byte), I(High Byte), Q(Low Byte), Q(High Byte)...

to 

I(High Byte), I(Low Byte), Q(High Byte), Q(Low Byte)...

 

3. Convert each I and Q from Q0-15 to floating point.

Do this by treating each (flipped) value as a 16 bit signed integer, converting that integer to a single precision floating point number, and then dividing that number by 32768.0 to scale the data. The result will be a series of numbers ranging from  -1.0 to ~1.0.

 

4. Scale floating point IQ data taking into account gain settings and calibration values from the IF Context / Data extension packets.

multiply the following value by all I and Q values:  

 sqrtf(powf(10.0, (rx_offset - rx_gain)/10.0f))

where rx_offset is the calibration offset and rx_gain is the receive gain setting.

 

5. Calculate instantaneous dBm power values from transformed IQ data

For each scaled IQ pair, get dBm in the following manner

power_mW = 10.0f * log10f( I * I + Q * Q)

 

 

 

 

 

Edited by Joey P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×