3 # Copyright 2008 Free Software Foundation, Inc.
5 # This file is part of GNU Radio
7 # GNU Radio is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3, or (at your option)
12 # GNU Radio is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License along
18 # with this program; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 from gnuradio.eng_option import eng_option
26 from optparse import OptionParser
29 parser = OptionParser(option_class=eng_option)
30 parser.add_option("-d", "--decim", type="int", default=16,
31 help="set fgpa decimation rate to DECIM [default=%default]")
32 parser.add_option("-f", "--freq", type="eng_float", default=0.0,
33 help="set frequency to FREQ", metavar="FREQ")
34 parser.add_option("-g", "--gain", type="string", default=None,
35 help="set gain to GAIN [default=%default]")
36 parser.add_option("-W", "--waterfall", action="store_true", default=False,
37 help="Enable waterfall display")
38 parser.add_option("-S", "--oscilloscope", action="store_true", default=False,
39 help="Enable oscilloscope display")
40 parser.add_option("-F", "--samples-per-frame", type="int", default=250,
41 help="[default=%default]")
42 parser.add_option("-e", "--eth", default="eth0",
43 help="specify ethernet interface [default=%default]")
45 (options, args) = parser.parse_args()
51 path = os.path.dirname(sys.argv[0])
59 if options.oscilloscope:
64 gain_clause = '-g ' + options.gain
67 cmd = "%s/rx_streaming_samples -s -e %s -f %g -d %d %s -o /proc/self/fd/1 | %s/stdin_int32_fft.py %s -f %g -d %d" % (
68 path, options.eth, options.freq, options.decim, gain_clause,
69 path, display_type, options.freq, options.decim)
75 if __name__ == '__main__':