[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] File format question

From: Dan Halperin
Subject: Re: [Discuss-gnuradio] File format question
Date: Tue, 14 Aug 2007 14:19:03 -0700
User-agent: Thunderbird (X11/20070807)

Hash: SHA1

Bahn William L Civ USAFA/DFCS wrote:
> I have a few questions, but they mostly come down to: What is the data file 
> format when using a file as a signal source?

These file_sink and file_source are direct wrappers for the C functions
fwrite and fread and behave exactly as they do. A file is therefore
simply a binary containing {chars,shorts,ints,floats,etc} in

> Question #1: What is the syntax for the itemsize argument?
> Since the example doesn't use one of the data types mentioned, it is hard to 
> tell what the syntax is supposed to be. For instance, if I want to use 
> gr_complex, do I specify gr.sizeof_gr_complex? If I want to use unsigned 
> char, is it "gr_sizeof_unsigned_char" so as to eliminate the space?
> Question #2: What are all of the options for the itemsize argument?
> It lists "gr_complex", "float", and "unsigned char" yet the example uses one 
> that is not in the list. Are there others?

Itemsize is the size, in bytes, of the object to be written. Valid
useful values are 1 (char), 2 (short), 4 (int/float), 8 (complex);
although I suspect you could put anything fwrite/fread accepted in there
and it would work.

> Question #3: Does the data file format for transmitting match the data file 
> format when receiving?
> Can I take a file that is recorded, say using receive_file_c.py (may not have 
> the file name exactly correct) and use that as a source without modification? 
> If so, what does it mean to use IQ pairs as input data? What does the USRP do 
> with them?

Yes. When I'm working on building a receiver for a certain modulation
scheme, for example, I transmit some data and run usrp_rx_cfile.py on
the receiver, then use a gr.file_source block as input to my receiver
blocks to allow for reproducible testing without polluting the airwaves.

Similarly, you could if you wanted generate a file to transmit by using
a file_sink instead of a usrp_sink and then send it across the USRP with
a file_source -> usrp_sink.

The I/Q pairs are processed by the USRP from files the same way they are
from a normal GNU Radio block such as e.g. the DBPSK modulator (see
dbpsk.py, tunnel.py).

- -Dan
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

[Prev in Thread] Current Thread [Next in Thread]