discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] transmitting from file stored by usrp_rx_cfile.py


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] transmitting from file stored by usrp_rx_cfile.py
Date: Thu, 2 Apr 2009 13:18:34 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

On Thu, Apr 02, 2009 at 03:59:22PM -0400, Jaze Dalton wrote:
> I am trying to transmit from a file stored using usrp_rx_cfile.py (or
> usrp_rx_cfile created using usrp_rx_cfile.cc/h).  I have been able to
> successfully do this using a usrp_tx_cfile.cc/h program derived from the rx
> version.  I can't, however, get similar functionality using python.  I am
> new to python, so I am hoping I have just missed some key insight.  I have
> listed below the source for my cc and py versions of usrp_tx_cfile and the
> associated command line output from the transmit side.  I am running on Mac
> OS X with gnuradio code pulled down on Feb 13, 2009.  My daughterboards are
> RFX2400 and I am receiving on two other machines with the same USRP set up,
> but different hardware and OS (Linux).  I am using usrp_fft and usrp_oscope
> on the receiving side.  To test functionality, I stored data on the Mac
> using usrp_rx_cfile while running "usrp_siggen -f 2500000000" on one of the
> other machines.
> 
> Also, I noticed that when I use the subdev->gain_min() and
> subdev->gain_max() functions, both return 0 instead of correct values.

Those are the right values.  min == max -> not adjustable


> C++ code is shown below first, followed by the non-working python code.  Any
> help is much appreciated!
> -Jaze
> 
> 
> Here is the python version, which doesn't seem to transmit anything:
> 
> #!/usr/bin/env python
> 
> """
> Read samples a file and transmit using USRP
> 
> """
> 
> from gnuradio import gr, eng_notation
> from gnuradio import audio
> from gnuradio import usrp
> from gnuradio.eng_option import eng_option
> from optparse import OptionParser
> import sys
> 
> class my_top_block(gr.top_block):
> 
>     def __init__(self):
>         gr.top_block.__init__(self)
> 
>         usage="%prog: [options] output_filename"
>         parser = OptionParser(option_class=eng_option, usage=usage)
>         parser.add_option("-R", "--tx-subdev-spec", type="subdev",
> default=(0, 0),
>                           help="select USRP tx side A or B (default=A)")
>         parser.add_option("-i", "--interp", type="int", default=128,
>                           help="set fgpa decimation rate to INTERP
> [default=%default]")
>         parser.add_option("-f", "--freq", type="eng_float", default=None,
>                           help="set frequency to FREQ", metavar="FREQ")
>         parser.add_option("-g", "--gain", type="eng_float", default=None,
>                           help="set gain in dB (default is midpoint)")
>         (options, args) = parser.parse_args ()
>         if len(args) != 1:
>             parser.print_help()
>             raise SystemExit, 1
>         filename = args[0]
> 
>         if options.freq is None:
>             parser.print_help()
>             sys.stderr.write('You must specify the frequency with -f
> FREQ\n');
>             raise SystemExit, 1
> 
>         # build the graph
>         self.u = usrp.sink_c(interp_rate=options.interp)

Try:

>         self.u = usrp.sink_c(0, interp_rate=options.interp)
          
Eric




reply via email to

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