diff options
Diffstat (limited to 'gr-utils')
-rwxr-xr-x | gr-utils/src/python/usrp2_rx_cfile.py | 8 | ||||
-rwxr-xr-x | gr-utils/src/python/usrp2_siggen.py | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gr-utils/src/python/usrp2_rx_cfile.py b/gr-utils/src/python/usrp2_rx_cfile.py index f8f1de69b..1f23eee4e 100755 --- a/gr-utils/src/python/usrp2_rx_cfile.py +++ b/gr-utils/src/python/usrp2_rx_cfile.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005,2007,2008 Free Software Foundation, Inc. +# Copyright 2004,2005,2007,2008,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -58,6 +58,9 @@ class rx_cfile_block(gr.top_block): self._u.set_gain(options.gain) # Set receive frequency + if options.lo_offset is not None: + self._u.set_lo_offset(options.lo_offset) + tr = self._u.set_center_freq(options.freq) if tr == None: sys.stderr.write('Failed to set center frequency\n') @@ -115,6 +118,9 @@ def get_options(): help="number of samples to collect [default=+inf]") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output") + parser.add_option("", "--lo-offset", type="eng_float", default=None, + help="set daughterboard LO offset to OFFSET [default=hw default]") + (options, args) = parser.parse_args () if len(args) != 1: parser.print_help() diff --git a/gr-utils/src/python/usrp2_siggen.py b/gr-utils/src/python/usrp2_siggen.py index 9929112ef..9cea2eff1 100755 --- a/gr-utils/src/python/usrp2_siggen.py +++ b/gr-utils/src/python/usrp2_siggen.py @@ -44,6 +44,10 @@ class siggen_top_block(gr.top_block): self._u.set_gain(options.gain) # Tune the USRP2 FPGA and daughterboard to the requested center frequency + # and LO offset + if options.lo_offset is not None: + self._u.set_lo_offset(options.lo_offset) + tr = self._u.set_center_freq(options.tx_freq) if tr == None: sys.stderr.write('Failed to set center frequency\n') @@ -143,6 +147,8 @@ def get_options(): help="set waveform amplitude to AMPLITUDE (0-1.0) [default=%default]", metavar="AMPL") parser.add_option("--offset", type="eng_float", default=0, help="set waveform offset to OFFSET [default=%default]") + parser.add_option("--lo-offset", type="eng_float", default=None, + help="set daughterboard LO offset to OFFSET [default=hw default]") parser.add_option("--sine", dest="type", action="store_const", const=gr.GR_SIN_WAVE, help="generate a complex sinusoid [default]", default=gr.GR_SIN_WAVE) parser.add_option("--const", dest="type", action="store_const", const=gr.GR_CONST_WAVE, |