Create I/Q File for use in "File Source" block in GRC

1,804 views
Skip to first unread message

Neil

unread,
Jun 15, 2011, 2:46:29 PM6/15/11
to mmbtools
Hello,
I am attempting to create a simple DAB I/Q data stream (Interleaved I/
Q Samples) that can be read into the GNU Radio Companion tools via the
"File Source" block. Any help would be appreciated!

Here are my issues thus far, running from an installed version of the
Live CD tools:

1) Issuing "CRC-DabMux -A /usr/share/crc-dabmux/CRC\ pub.mp2 -O
file://test_out.eti" causes an error when file size reaches 2.0GB:
"Error while writing to output file://testing.eti
<3> Can't write to output file://test_out.eti"

2) I don't necessarily need the intermediate *.eti file, so I then
tried issuing "CRC-DabMux -A /usr/share/crc-dabmux/CRC\ pub.mp2 -O
fifo:///dev/stdout | CRC-DabMod /dev/stdin raw_out.raw -r3200000"
- This also stops creating the output file at 2.0GB, and the "Raw"
format is not something that I recognize.
a) How do I fix the 2GB issue?
b) Can the .raw file be easily manipulated into interleaved I/Q data
for GRC? I don't mind writing a script to do this, but it seems the
hooks may be in place (I haven't had a chance to dig into the source
code).

3) Just to see if anything works, I tried the command to look at the
spectrum from the documentation: "CRC-DabMux -O fifo:///dev/stdout |
CRC-DabMod -g1 -r3200000 | CRC-Dwap.py -r3200000 -s", but this
produces errors with fftsink: "NameError: global name 'fftsink' is not
defined"

Thanks in advance for any help!
Neil

Pascal Charest

unread,
Jun 15, 2011, 4:16:17 PM6/15/11
to crc-mm...@googlegroups.com
Hi Neil,

Neil wrote:
> Hello,
> I am attempting to create a simple DAB I/Q data stream (Interleaved I/
> Q Samples) that can be read into the GNU Radio Companion tools via the
> "File Source" block. Any help would be appreciated!
>
> Here are my issues thus far, running from an installed version of the
> Live CD tools:
>
> 1) Issuing "CRC-DabMux -A /usr/share/crc-dabmux/CRC\ pub.mp2 -O
> file://test_out.eti" causes an error when file size reaches 2.0GB:
> "Error while writing to output file://testing.eti
> <3> Can't write to output file://test_out.eti"
>

You just reached the limit of 32 bits number (2 ^15 = 2G). It is a
common limit found in many software that don't use the new 64 bits file
operations programming interface.

By the way, are you sure that you what longer file? The MP2 input file
is 48 kbps. For a 2G file, it is almost 4 days of recording! If you want
a shorter output, use the -n option. Each frame is 24 ms, so for 10
minute it is -n 25000.

Moreover, I strongly suggest to add -S -C options after -A otherwise no
receiver will be able to decode the service. These options will create a
service for receiver to tune in.

> 2) I don't necessarily need the intermediate *.eti file, so I then
> tried issuing "CRC-DabMux -A /usr/share/crc-dabmux/CRC\ pub.mp2 -O
> fifo:///dev/stdout | CRC-DabMod /dev/stdin raw_out.raw -r3200000"
> - This also stops creating the output file at 2.0GB, and the "Raw"
> format is not something that I recognize.
>

Same problem here, 32 bits file size limit. Here is a template command
line that can mitigate this issue:
CRC-DabMux -A file.mp2 -S -C -O fifo:///dev/stdout | CRC-DabMod
-r3200000 | cat - out.raw

Output format is 32 bits complex float (I/Q) normalized to +- 2^15.

> a) How do I fix the 2GB issue?
> b) Can the .raw file be easily manipulated into interleaved I/Q data
> for GRC? I don't mind writing a script to do this, but it seems the
> hooks may be in place (I haven't had a chance to dig into the source
> code).
>

Format is compatible with GRC complex format. Maximum and maximum value
are compatible with USRP dynamic range.

> 3) Just to see if anything works, I tried the command to look at the
> spectrum from the documentation: "CRC-DabMux -O fifo:///dev/stdout |
> CRC-DabMod -g1 -r3200000 | CRC-Dwap.py -r3200000 -s", but this
> produces errors with fftsink: "NameError: global name 'fftsink' is not
> defined"
>

Since we wrote CRC-Dwap, GnuRadio API has changed many times and this is
an issue that as slipped through the last update. Edit CRC-Dwap as root,
change line
fftWin = fftsink.fft_sink_c(self.fg, fftPanel,
to
fftWin = fftsink2.fft_sink_c(fftPanel,

As an additional side note, use the -c 128000000 option if you plan to
use the USRP as the output DAC; it will enable pre-dac equalizer
specifically design for the USRP. Otherwise, don't use this option.

Regards,

Pascal

Neil

unread,
Jun 15, 2011, 6:46:51 PM6/15/11
to mmbtools
Pascal,
Thank you very much for responding so quickly! Everything you said
worked great, with one exception:
"CRC-DabMux -A file.mp2 -S -C -O fifo:///dev/stdout | CRC-DabMod -
r3200000 | cat - out.raw" should be:
"CRC-DabMux -A file.mp2 -S -C -O fifo:///dev/stdout | CRC-DabMod -
r3200000 | cat - > out.raw"

Additionally, you were correct that I didn't really need a *.eti file
> 2.0GB. I didn't realize that CRC-DabMux automatically looped the
input .mp2 file.

I can't thank you enough for your help, this was exactly what I
needed!

Thanks again,
Neil

Coinchon, Mathias

unread,
Jun 16, 2011, 6:47:57 AM6/16/11
to crc-mm...@googlegroups.com
Hello,

You can get the output from the modulator easily, just use FIFO file.

If you are interested by an example, look at the GRC and script for our baseband player:
http://www.opendigitalradio.org/index.php/Band_3_baseband_player

Regards

Mathias
-----------------------------------------
**************************************************
This email and any files transmitted with it
are confidential and intended solely for the
use of the individual or entity to whom they
are addressed.
If you have received this email in error,
please notify the system manager.
This footnote also confirms that this email
message has been swept by the mailgateway
**************************************************

Reply all
Reply to author
Forward
0 new messages