[Top][All Lists]

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

RE: [Discuss-gnuradio] File format question

From: Bahn William L Civ USAFA/DFCS
Subject: RE: [Discuss-gnuradio] File format question
Date: Tue, 14 Aug 2007 15:33:41 -0600

Thanks, that helps some.

I figured that I could put in the literal size of the data, in bytes, but that 
only helps if it actually matches how the GR blocks are going to process those 

When possible, I would prefer to use the constants that have been set up so 
that the code is (1) more readable, and (2) more maintainable. So instead of 
using "8" for complex, I would like to use gr.sizeof_"whatever". But I don't 
know what "whatever" needs to be. Where do I find this?

I'll look at dbpsk.py and tunnel.py when I get my Linux box set back up. Is 
there a module that takes time domain data and converts it to IQ pairs, or am I 
responsible for doing that when I generate the file? If so, what LO frequency 
would I need to use?

It would be so much simpler if I could just use the generated time domain data 


> -----Original Message-----
> From: Dan Halperin [mailto:address@hidden
> Sent: Tuesday, August 14, 2007 3:19 PM
> To: Bahn William L Civ USAFA/DFCS
> Cc: address@hidden
> Subject: Re: [Discuss-gnuradio] File format question
> 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
> local-endianness.
> > 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
> iD8DBQFGwhxHy9GYuuMoUJ4RAstQAKC+k5g89aTnmXZsjU9ctb6sqjtCoACgjuCz
> =HBOu

reply via email to

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