IQ-wave files question

Status
Not open for further replies.

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,850
GNU-Radio should be able to decimate the file. BUT.

How much effort are you prepared to do this. GNU-Radio is not easy to understand and use.

How does AOR AR-IQ-II save the IQ samples to WAV (8/16bit, mono/stereo) 900Ksps
You would probably need to remove the WAV header (44 bytes), assuming no other chunks used.

As an example you could decimate by 18 (which downsamples to 50Ksps) with low pass filter block which should deal with any aliasing.

Of course this is just a generalized example. GNU-Radio is never that easy.
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,850
Here is an example flowgraph I slapped together with GNU-Radio.
Here I used a baseband IQ WAV file that was output by SDR# "Recording *" feature. (as 16 bit stereo)
SampleRate is 2.4Msps (Default for most dongles) the decimation is 50, so the resulting SampleRate output to file is 48000Ksps

The downside to this method is that GNU-Radio processes it in realtime, so 10 minute play time = process time.

I'm sure you speed it up by changing it to a "File Source" block, but that would probably require pre-processing data to skip the WAV header and then block align the data and split into I and Q components. (i.e. Left=I, Right=Q). Not to sure as I've never done it.


ZK6owng.png
 

PB0AOG

Member
Joined
Jul 26, 2018
Messages
7
Location
Westdorpe , the Netherlands
Thanks for your reply,

Like you mentioned , the WAV header of these IQ-files contain besides baseband identification probably other information (chunk), which “audio” software can`t handle to convert these files correctly, this could be a first challenge.
Because AOR making multiple IQ-wave files (2Gb) during a recording, so we need to bond these IQ-files as one (big) iq-file to handle further .
The AOR-IQ Wave files are saved as 2 channel 32 bit, sample rate 1.150Msps, bitrate 72Msps.
(These ratings are fixed by the AOR-IQ interface, but I`m sure by the Perseus you can select)
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,850
...the WAV header of these IQ-files contain besides baseband identification probably other information (chunk), which “audio” software can`t handle to convert these files correctly, this could be a first challenge.

The RIFF header is fairly easy to breakdown, As it turns out GNU-Radio has a WAV file source block to handle these files.

Because AOR making multiple IQ-wave files (2Gb) during a recording, so we need to bond these IQ-files as one (big) iq-file to handle further .

Once you decimate the signal, the files will be smaller and you can load them into a audio editor and join them to one big file that uses the 64 bit WAV format. (RF64)
Actually we can join them without decimation. The Audio editor doesn't care, so long as it knows a file format.

The AOR-IQ Wave files are saved as 2 channel 32 bit, sample rate 1.150Msps, bitrate 72Msps.
(These ratings are fixed by the AOR-IQ interface, but I`m sure by the Perseus you can select)

A look at the AR-IQ-II PDF here. On page 3 it states:
Page 3 said:
The digital I/Q output interface streams I/Q data to the PC through USB2.0 isochronous mode, at 72Mbit
/sec with a sampling rate of 1.125Msample/sec. All commands are sent to the AR2300/AR5001D through the receiver’s remote control USB port.

This is the USB data rate. For the WAV sample rate:
On page 26 said:
AR-IQ II allows to record 900kHz of the RF spectrum ...

Which most likely is 900Ksps, 2 channel 16bit. While I don't know what the ADC is, it's most likely 8 or 10 bit. Saving to 32 bit would just be a waste of space.


Is the signal a digital or analog?
For what purpose are you wanting to change the samplerate. To create analog audio WAV from a transmission? This would require further processing to demodulate before saving as audio WAV. GNU-Radio could do this too.

Seems a bit crumby that they don't have a audio recording feature if this is what you need too do.
 

PB0AOG

Member
Joined
Jul 26, 2018
Messages
7
Location
Westdorpe , the Netherlands
Hope this explain somethings:
The real bandwidth, from a recorded AOR IQ-wave file is 1098.6Hz, the usable span is 900kHz, so in this span I can select a signal for analyses or demodulation.
In the aor-software I can select several filters (BW), which are related to demodulation( am fm ssb), and analyze or record ( vac and with audicity) this demodulated / filtered signal.
The signals of my interesting are modulated qpsk, and have a bandwidth of about 130kHz,( tuning I do in the middle of the baseband)
The “limited” chose of band filter is the bottleneck, the maximum bandwidth I can select is 56kHz, I can select WFM with 225kHz bw, but destroys the content of the qpsk-signal because it is fm-demodulated.
Demodulation of these signals is NOT an issue. ( programs like SDR# have now a plug-in .)

A few years ago before there was the “Meteor” SDR# plug-in, you have to a record a centered baseband signal first , and have to convert this (with e.g. audacity) to a sample rate of 130000.
This 130kbps wave file you could use directly to process the useful information, in my case a weather satellite picture.

So that is what I`m tried to do with my recorded AOR IQ-wave files, resample to 130kHz, but have no success because the modified wave format from these kind of files can not handle by audacity (or similar.)
If I import AOR IQ-wave files in Audacity, I see the details concerning the format: 32bit, float, stereo 1125000Hz
“Original” sdr#-files imported in Audacity: are 16bit PCM.
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,850
Thanks for the clear picture.

I have been looking at this because I to wish to reduce further some IQ files for a different purpose.
What I have found is that Audacity can do the job.

To summarize the process:
Load IQ file/s into Audacity, apply low pass filter, resample, export file, done.

The key here like the GNU-Radio example is to use the low pass filter.
The only thing is, you need to change the low pass filter parameters to handle the larger cutoff frequency. The default is 20Khz, you need 130Khz or so.

I can provide a more detailed procedure of how to do it if your interested. I just didn't what to type it out if your not.

I just tested on a 2.4Msps IQ file and did the above to reduce to 150Ksps.
Was a TETRA signal and it decoded fine.

If you like, you could provide a small IQ sample and I can inspect the file format and or test resample it.

“Original” sdr#-files imported in Audacity: are 16bit PCM.
When I use the SDR# plug-in "Recording *", "Baseband Recorder", "IFRecoder". they load into Audacity as 32bit, float, stereo SampleRate

If you want to join your files and then playback via "File Player" then you still need to keep them under 2gb file size I think.
 

PB0AOG

Member
Joined
Jul 26, 2018
Messages
7
Location
Westdorpe , the Netherlands
Thank you for the follow-up,
I have tried since a few weeks ago, with Audacity taking all kind of different settings and filtering to “export” a AOR-IQ wave-file that I can handle for further demodulation, no succes.
Importing SDR# IQ-files in Audacity, resample and use if needed the filtering settings, works like a charm, like you mentioned…
This morning I discovered that the AOR-IQ wave files are not little-endian but big-endian ordered, normally wave files are little-endian, whilst Mac (AIFF) have big-endian ordered . So this could be also a reason why the previous attempts to resample these kind of IQ-files did have no success.
I cannot email or send you a pm, because I don’t have any permissions on this forum (yet), otherwise I could send you one IQ-file.
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,850
Endianness should be indicated by the file format header.
If RIFF then would be little-endian.
If RIFX then would be big-endian.

AOR should not be using anything different from the "Standard".
If they are using big-endian in a RIFF that would be bad form (no pun intended).

If Audacity is opening these WAV files, then it recognizes the file format. That doesn't help if AOR are using incorrect endianness.

If this is the case then there is a way around this using Audacity's Import > Raw Data...
Here you can set endianness of source file.
You most likely need to also define encoding, channels, samplerate, start offset (maybe 44 bytes)

I think after your 5th post you can PM.

EDIT: The Import raw data in Audacity is limited.
currently, only rates between 100 Hz and 100000 Hz are supported
Maybe "currently" means it could be requested to be increased.

EDIT#2:
There is a alpha version available (v2.3.0) that has the limit increased to 384000 Hz
Looking at the source code or Audacity, I'm not sure if it is just a matter on increasing the value to a higher value for our SDR needs and then recompiling.
 
Last edited:

PB0AOG

Member
Joined
Jul 26, 2018
Messages
7
Location
Westdorpe , the Netherlands
I think to `protect` a certain product, in this case the AR-IQ software interface, the designer have prevented import of non AOR-wave files and have prevent that these files can´t be used with other software, by means of not following conventions like endianness.

The last past days I have also searched for more information concerning IQ-wave files and have find a couple of interesting facts, but need some time to order this information .

The first 4 bytes in the header of the IQ/files are 59 49 46 46 or RIFF, but my source tell me it is big-endian.

You are right, Audacity can import Raw-data, I have done this yesterday but stumble also on the rate restriction, also import, editing and resample of this kind of file is taken a long time…
Hopefully I can send you a pm now….
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,850
I think to `protect` a certain product, in this case the AR-IQ software interface, the designer have prevented import of non AOR-wave files and have prevent that these files can´t be used with other software, by means of not following conventions like endianness.

Makes no sense to do that. They have nothing to lose or gain by it. I guess that's never stopped Apple. :)

The first 4 bytes in the header of the IQ/files are 59 49 46 46 or RIFF, but my source tell me it is big-endian.

There are tests you could come up with to test this.

...also import, editing and resample of this kind of file is taken a long time…
That's the nature of it. If you want it, you'll do it.

If you do want to send a sample of your IQ data. Maybe a short analog transmission like ATIS from local airport. That way it can tell if tests are working.
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,850
Convert AOR-IQ-II WAV and resample to use in SDR#

A few weeks back I helped PB0AOG with the problem:
Can anybody share which software is capable of converting (resampling) recorded IQ-wave files from the ar-iq-2, perseus-like, without loss of content ?

Nothing off the shelf did this so I ended up creating something to perform this task and then use SoX via batch file to complete the heavy lifting (resampling etc...).

The package I've listed here is the final result of these efforts and made available for others that use AOR-IQ-II and wish to make the IQ files work with SDR#.
Download v0.3 - MD5 Hash: b4be5e55dc0092f9248cd83391611852

The batch files will perform some or all of the following:
  • AORiqToSharp will convert AOR-IQ-II IQ WAV file to SDR# compatible WAVs
  • Remove DC spike (from original center frequency only)
  • Frequency translation. (Move frequency that is offset from center to center)
  • Attenuation
  • Resample to lower (defined) samplerate
  • Join all input file and output as one file (has 2Gb limit)

[size=+2]Please read the "Readme.txt" for usage and limitations.[/size]

Jk8Khlm.png
ittOQHB.png


This AORiqToSharp program uses code from this project as a base. https://github.com/Marcin648/iqToSharp
 

PB0AOG

Member
Joined
Jul 26, 2018
Messages
7
Location
Westdorpe , the Netherlands
Again thanks to thewraith2008 who came with this solution.

Another great benefit of his approach is that the converted files taken much less disk space with all content still available.

( I have not tested this version (0.3) but will do that during the next few days.)
 
Status
Not open for further replies.
Top