Application Program Interfaces

This section documents the interfaces to programs and functions that are part of GNU Radio.

While the eventual goal is for this section to provide complete documentation on all programs and functions, this is a slow, evolutionary process that will probably never be more than partially completed. Therefore, to provide the greatest utility as quickly as possible, this section focuses on items NOT contained in other obvious places - most specifically any command line help option that is available for the program or function in question.

Python Programs

USAGE: [options] outputfilename
(NOTE: Contrary to the above description, the -f option is not optional)
LOCATION: gnuradio-examples/python/usrp
PURPOSE: To record data from a USRP RX (receiver) Daughterboard and dump it to a file.
OUTPUT: The data is written to the file as binary I,Q pairs. By default, values are IEEE single-precision (4-byte) floats but 16-bit integers can be selected using the -s option. The Endian-ness of the data is that of the processor.



DESCRIPTION: Set mixer frequency.
FORMAT: Engineering notation - a float followed immediately by an S.I. suffix (e.g., 3M or 2.9k).
DEFAULT VALUE: none (this is a required option - and, yes, that's an oxymoron)

FREQ is the frequency for the quadrature mixer located on the USRP. The incoming signal is multiplied by sin(FREQ*2pi*t) to yield the I output and cos(FREQ*2pi*t) to yield the Q output. This results in a frequency translation of the signal.

FREQ can be any value from -fs/2 to +fs/2. A value of 0 will result in no signal on the I output and the input signal being transferred directly to the Q output (after passing through the decimation filter).


DESCRIPTION: Select signal source.
FORMAT: {A,B}[:{0,1}] (e.g., A or B:1)
DEFAULT VALUE: A (same as A:0)

The USRP has two slots for RX daughterboards, RXA and RXB. This option selects which daughterboard the data will be taken from. The RX daughterboard selected may also have two input ports, in which case a number following a colon can be added to select which one with :0 selecting the first input and :1 selecting the other. For instance, on the BasicRX board, the inputs are labeled "RX-A" and "RX-B", if this board is plugged into RXB on the USRP, then B:0 will select RX-A on this board while B:1 will select RX-B on it.


DESCRIPTION: Set decimation factor.
FORMAT: An even integer in the range from 4 to 256

The output from the mixer is decimated by a factor of decimation factor

The USRP sampling frequency is typically 64 MSa/s, so a decimation factor of 64 will result in an effective sampling rate of 1 MSa/s being written to the file.


DESCRIPTION: Set limit on number of samples to acquire.
FORMAT: positive integer
DEFAULT: infinity

The program is to terminate after collecting and writing the specified number of samples to the file. By default, the program will continue writing data until killed by the User.


DESCRIPTION: Change output format to short integers instead of floats
FORMAT: No arguments
DEFAULT: IEEE single-precision (32-bit) floats.

If specified, the program will output 16-bit signed integers instead of 32-bit floats.

注:Application Program Interfaces  (原文出处,翻译整理仅供者参考!)