diff options
author | matt | 2007-09-08 21:17:20 +0000 |
---|---|---|
committer | matt | 2007-09-08 21:17:20 +0000 |
commit | f1b81c4d4a4d5bc3d040970fa5296be7f932c854 (patch) | |
tree | 220341f1e1b792e668c9ef0949045b315a54699e /gr-utils | |
parent | 1de3b0ded031368de377d44305f6aa506e0d6ec5 (diff) | |
download | gnuradio-f1b81c4d4a4d5bc3d040970fa5296be7f932c854.tar.gz gnuradio-f1b81c4d4a4d5bc3d040970fa5296be7f932c854.tar.bz2 gnuradio-f1b81c4d4a4d5bc3d040970fa5296be7f932c854.zip |
added option to set the gain
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6370 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-utils')
-rwxr-xr-x | gr-utils/src/python/usrp_siggen.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gr-utils/src/python/usrp_siggen.py b/gr-utils/src/python/usrp_siggen.py index 7f5285885..c2929939c 100755 --- a/gr-utils/src/python/usrp_siggen.py +++ b/gr-utils/src/python/usrp_siggen.py @@ -133,6 +133,8 @@ def main (): help="set waveform frequency to FREQ [default=%default]") parser.add_option ("-a", "--amplitude", type="eng_float", default=16e3, help="set waveform amplitude to AMPLITUDE [default=%default]", metavar="AMPL") + parser.add_option ("-g", "--gain", type="eng_float", default=None, + help="set output gain to GAIN [default=%default]") parser.add_option ("-o", "--offset", type="eng_float", default=0, help="set waveform offset to OFFSET [default=%default]") (options, args) = parser.parse_args () @@ -163,7 +165,10 @@ def main (): fg.subdev = usrp.selected_subdev(fg.u, options.tx_subdev_spec) print "Using TX d'board %s" % (fg.subdev.side_and_name(),) - fg.subdev.set_gain(fg.subdev.gain_range()[1]) # set max Tx gain + if options.gain is None: + fg.subdev.set_gain(fg.subdev.gain_range()[1]) # set max Tx gain + else: + fg.subdev.set_gain(options.gain) # set max Tx gain if not fg.set_freq(options.rf_freq): sys.stderr.write('Failed to set RF frequency\n') |