Forums › BB Series Discussions › Convert bbr file to other format
- This topic has 3 replies, 2 voices, and was last updated 8 years, 4 months ago by
Andrew.
- AuthorPosts
magintdParticipantI am trying to convert a recorded bbr file into a format that can be viewed in one of a coupld different analysis tools (Inspectrum for example – https://github.com/miek/inspectrum), however, I am running into some issues parsing the bbr file.
It is my understanding that the bbr file contains 32 bit IQ file (i.e. 32 bit I and 32 bit Q samples), is that correct?
From looking around the forums here, I found the header spec and the spec of the contents of the file. In parsing the file, the header looks right, and it sounds like there is a MIN and MAX array for each sweep. I was thinking that perhaps one of these was the I and one the Q, but when I parsed a sample file, MIN seems to equal the MAX in each bin.
I will also need to figure out the sample rate. Since the file is a 32 IQ file, is the sample rate equal to the span (i.e. 32kHz span equates to 32ksamples/sec)?
Am I parsing the file incorrectly, or does the file actually only contain a min and max trace of real (I) values? Thanks very much for your help.
AndrewModeratorHello magintd,
I can clarify. The bbr file is a flat recording of sweeps only (frequency domain ‘bins’). The IQ data is not recorded in this file. The sweeps are stored as min/max arrays. If the avg detector is enabled, min/max should equal the same values. I will attach a basic bbr parser so you can see the layout and how we parse the files in our software.
If you are looking to get IQ data, then we do have another recording feature in zero-span that records IQ data. If you are looking for the ultimate flexibility, you could grab IQ data directly from the device with our APIs.
Let me know if you have additional questions.
Regards,
A.J.Attachments:
You must be logged in to view attached files.
magintdParticipantAndrew – Thanks for the help. Given that, sounds like the bbr file isn’t what we are looking for after all. I didn’t realize that the zero span outputted a different format though, looks like that might work. I just collected a file and here is some of the XML output:
…
<DataType>Complex Short</DataType>
…
<SampleRate>1250000</SampleRate>
<Decimation>32</Decimation>
<IFBandwidth>1000000</IFBandwidth>
<ScaleFactor>1</ScaleFactor
…Could you clarify a couple things for me though? So that mean the data is unsigned 16-bit precision (u16 versus signed 16, u/s 32, etc), sampled at 1250ksamples right? What about machine format (i.e. endian-ness big/little/etc)?
Again, thank you for the support.
AndrewModeratorHello magintd,
The IQ samples are stored in the binary file as 16 bit signed integers, interleaved (I1, Q1, I2, Q2 … etc). The 16 bit integers are scaled to +/- 32767 with an additional scaleFactor to bring them into the 0-1 range.
The proper way to recover the IQ values are
float floatReal = ((float)int16Real / 32767.0) * (1.0 / scalefactor);
float floatImag = ((float)int16Imag / 32767.0) * (1.0 / scalefactor);Where the scaleFactor is found in the XML file.
Let me know if you have additional questions.
Regards,
A.J.- AuthorPosts
You must be logged in to reply to this topic.