diff options
author | Tom Rondeau | 2011-10-03 20:43:53 -0400 |
---|---|---|
committer | Tom Rondeau | 2011-10-03 22:56:08 -0400 |
commit | 97280002b62c2a89a32362a826325f5e70b8b860 (patch) | |
tree | ce66e427cdf8f3d8e009b5d3908c6323dab9edc1 | |
parent | 8f06fda1f4c19d06e4a4f9da22b2d692148fe4bc (diff) | |
download | gnuradio-97280002b62c2a89a32362a826325f5e70b8b860.tar.gz gnuradio-97280002b62c2a89a32362a826325f5e70b8b860.tar.bz2 gnuradio-97280002b62c2a89a32362a826325f5e70b8b860.zip |
uhd: removing multi-antenna stuff frmo gnuradio-examples
-rw-r--r-- | gnuradio-examples/python/multi-antenna/.gitignore | 11 | ||||
-rw-r--r-- | gnuradio-examples/python/multi-antenna/Makefile.am | 29 | ||||
-rwxr-xr-x | gnuradio-examples/python/multi-antenna/multi_fft.py | 128 | ||||
-rwxr-xr-x | gnuradio-examples/python/multi-antenna/multi_file.py | 134 | ||||
-rwxr-xr-x | gnuradio-examples/python/multi-antenna/multi_scope.py | 139 | ||||
-rw-r--r-- | gr-uhd/Makefile.am | 2 |
6 files changed, 1 insertions, 442 deletions
diff --git a/gnuradio-examples/python/multi-antenna/.gitignore b/gnuradio-examples/python/multi-antenna/.gitignore deleted file mode 100644 index ff40c06f3..000000000 --- a/gnuradio-examples/python/multi-antenna/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo -/*.dat diff --git a/gnuradio-examples/python/multi-antenna/Makefile.am b/gnuradio-examples/python/multi-antenna/Makefile.am deleted file mode 100644 index 0cb944589..000000000 --- a/gnuradio-examples/python/multi-antenna/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright 2006,2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -ourdatadir = $(exampledir)/multi-antenna - -dist_ourdata_SCRIPTS = \ - multi_fft.py \ - multi_file.py \ - multi_scope.py diff --git a/gnuradio-examples/python/multi-antenna/multi_fft.py b/gnuradio-examples/python/multi-antenna/multi_fft.py deleted file mode 100755 index 544445860..000000000 --- a/gnuradio-examples/python/multi-antenna/multi_fft.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python - -from gnuradio import gr, gru, eng_notation -from gnuradio import usrp -from gnuradio.eng_option import eng_option -from gnuradio import eng_notation -from gnuradio import optfir -from optparse import OptionParser -from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider -import wx -from usrpm import usrp_dbid -import time -import os.path -import sys - -# required FPGA that can do 4 rx channels. - - -class my_graph(stdgui2.std_top_block): - - def __init__(self, frame, panel, vbox, argv): - stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) - - self.frame = frame - self.panel = panel - - parser = OptionParser (option_class=eng_option) - #parser.add_option("-S", "--subdev", type="subdev", default=(0, None), - # help="select USRP Rx side A or B (default=A)") - parser.add_option("-d", "--decim", type="int", default=128, - help="set fgpa decimation rate to DECIM [default=%default]") - parser.add_option("-f", "--freq", type="eng_float", default=146.585e6, - help="set frequency to FREQ [default=%default])", metavar="FREQ") - parser.add_option("-g", "--gain", type="eng_float", default=20, - help="set gain in dB [default=%default]") - parser.add_option("-F", "--filter", action="store_true", default=True, - help="Enable channel filter") - (options, args) = parser.parse_args() - - if len(args) != 0: - parser.print_help() - raise SystemExit - - nchan = 4 - - if options.filter: - sw_decim = 4 - else: - sw_decim = 1 - - self.u = usrp.source_c(0, options.decim, fpga_filename="std_4rx_0tx.rbf") - if self.u.nddcs() < nchan: - sys.stderr.write('This code requires an FPGA build with %d DDCs. This FPGA has only %d.\n' % ( - nchan, self.u.nddcs())) - raise SystemExit - - if not self.u.set_nchannels(nchan): - sys.stderr.write('set_nchannels(%d) failed\n' % (nchan,)) - raise SystemExit - - input_rate = self.u.adc_freq() / self.u.decim_rate() - print "USB data rate = %s" % (eng_notation.num_to_str(input_rate),) - print "Scope data rate = %s" % (eng_notation.num_to_str(input_rate/sw_decim),) - - self.subdev = self.u.db(0) + self.u.db(1) - - if (len (self.subdev) < 4 or - self.u.db(0, 0).dbid() != usrp_dbid.BASIC_RX or - self.u.db(0, 0).dbid() != usrp_dbid.BASIC_RX): - sys.stderr.write('This code requires a Basic Rx board on Sides A & B\n') - sys.exit(1) - - self.u.set_mux(gru.hexint(0xf3f2f1f0)) - - # deinterleave four channels from FPGA - di = gr.deinterleave(gr.sizeof_gr_complex) - - self.connect(self.u, di) - - - - # taps for channel filter - chan_filt_coeffs = optfir.low_pass (1, # gain - input_rate, # sampling rate - 80e3, # passband cutoff - 115e3, # stopband cutoff - 0.1, # passband ripple - 60) # stopband attenuation - #print len(chan_filt_coeffs) - - for i in range(nchan): - scope = fftsink2.fft_sink_c(panel, sample_rate=input_rate/sw_decim, - title="Input %d" % (i,), - ref_level=80, y_per_div=20) - vbox.Add(scope.win, 10, wx.EXPAND) - - if options.filter: - chan_filt = gr.fir_filter_ccf(sw_decim, chan_filt_coeffs) - self.connect((di, i), chan_filt, scope) - else: - self.connect((di, i), scope) - - - self.set_gain(options.gain) - self.set_freq(options.freq) - - def set_gain(self, gain): - for i in range(len(self.subdev)): - self.subdev[i].set_gain(gain) - - def set_freq(self, target_freq): - ok = True - for i in range(len(self.subdev)): - r = usrp.tune(self.u, i, self.subdev[i], target_freq) - if not r: - ok = False - print "set_freq: failed to set subdev[%d] freq to %f" % ( - i, target_freq) - - return ok - - -def main (): - app = stdgui2.stdapp(my_graph, "Multi Scope", nstatus=1) - app.MainLoop() - -if __name__ == '__main__': - main () diff --git a/gnuradio-examples/python/multi-antenna/multi_file.py b/gnuradio-examples/python/multi-antenna/multi_file.py deleted file mode 100755 index 87d9085e3..000000000 --- a/gnuradio-examples/python/multi-antenna/multi_file.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python - -from gnuradio import gr, gru, eng_notation -from gnuradio import usrp -from gnuradio.eng_option import eng_option -from gnuradio import eng_notation -from gnuradio import optfir -from optparse import OptionParser -from usrpm import usrp_dbid -import time -import os.path -import sys - -# required FPGA that can do 4 rx channels. - - -class my_graph(gr.top_block): - - def __init__(self): - gr.top_block.__init__(self) - - parser = OptionParser (option_class=eng_option) - #parser.add_option("-S", "--subdev", type="subdev", default=(0, None), - # help="select USRP Rx side A or B (default=A)") - parser.add_option("-d", "--decim", type="int", default=128, - help="set fgpa decimation rate to DECIM [default=%default]") - parser.add_option("-f", "--freq", type="eng_float", default=146.585e6, - help="set frequency to FREQ [default=%default])", metavar="FREQ") - parser.add_option("-g", "--gain", type="eng_float", default=20, - help="set gain in dB [default=%default]") - parser.add_option("-F", "--filter", action="store_true", default=True, - help="Enable channel filter") - parser.add_option("-o", "--output", type="string", default=None, - help="set output basename") - (options, args) = parser.parse_args() - - if len(args) != 0: - parser.print_help() - raise SystemExit - - if options.output is None: - parser.print_help() - sys.stderr.write("You must provide an output filename base with -o OUTPUT\n") - raise SystemExit - else: - basename = options.output - - nchan = 4 - nsecs = 4.0 - - if options.filter: - sw_decim = 4 - else: - sw_decim = 1 - - self.u = usrp.source_c(0, options.decim, fpga_filename="std_4rx_0tx.rbf") - if self.u.nddcs() < nchan: - sys.stderr.write('This code requires an FPGA build with %d DDCs. This FPGA has only %d.\n' % ( - nchan, self.u.nddcs())) - raise SystemExit - - if not self.u.set_nchannels(nchan): - sys.stderr.write('set_nchannels(%d) failed\n' % (nchan,)) - raise SystemExit - - input_rate = self.u.adc_freq() / self.u.decim_rate() - print "USB data rate = %s" % (eng_notation.num_to_str(input_rate),) - sink_data_rate = input_rate/sw_decim - print "Scope data rate = %s" % (eng_notation.num_to_str(sink_data_rate),) - - self.subdev = self.u.db(0) + self.u.db(1) - - if (len(self.subdev) < 4 or - self.u.db(0, 0).dbid() != usrp_dbid.BASIC_RX or - self.u.db(1, 0).dbid() != usrp_dbid.BASIC_RX): - sys.stderr.write('This code requires a Basic Rx board on Sides A & B\n') - sys.exit(1) - - self.u.set_mux(gru.hexint(0xf3f2f1f0)) - - # collect 1 second worth of data - limit = int(nsecs * input_rate * nchan) - print "limit = ", limit - head = gr.head(gr.sizeof_gr_complex, limit) - - # deinterleave four channels from FPGA - di = gr.deinterleave(gr.sizeof_gr_complex) - - self.connect(self.u, head, di) - - # taps for channel filter - chan_filt_coeffs = optfir.low_pass (1, # gain - input_rate, # sampling rate - 80e3, # passband cutoff - 115e3, # stopband cutoff - 0.1, # passband ripple - 60) # stopband attenuation - #print len(chan_filt_coeffs) - - for i in range(nchan): - - sink = gr.file_sink(gr.sizeof_gr_complex, - basename + ("-%s-%d.dat" % (eng_notation.num_to_str(sink_data_rate), i))) - if options.filter: - chan_filt = gr.fir_filter_ccf(sw_decim, chan_filt_coeffs) - self.connect((di, i), chan_filt, sink) - else: - self.connect((di, i), sink) - - - self.set_gain(options.gain) - self.set_freq(options.freq) - - def set_gain(self, gain): - for i in range(len(self.subdev)): - self.subdev[i].set_gain(gain) - - def set_freq(self, target_freq): - ok = True - for i in range(len(self.subdev)): - r = usrp.tune(self.u, i, self.subdev[i], target_freq) - if not r: - ok = False - print "set_freq: failed to set subdev[%d] freq to %f" % ( - i, target_freq) - - return ok - - -def main (): - my_graph().run() - -if __name__ == '__main__': - main () diff --git a/gnuradio-examples/python/multi-antenna/multi_scope.py b/gnuradio-examples/python/multi-antenna/multi_scope.py deleted file mode 100755 index d1e28ad18..000000000 --- a/gnuradio-examples/python/multi-antenna/multi_scope.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python - -from gnuradio import gr, gru, eng_notation -from gnuradio import usrp -from gnuradio.eng_option import eng_option -from gnuradio import eng_notation -from gnuradio import optfir -from optparse import OptionParser -from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider -import wx -from usrpm import usrp_dbid -import time -import os.path -import sys - -# required FPGA that can do 4 rx channels. - - -class my_top_block(stdgui2.std_top_block): - - def __init__(self, frame, panel, vbox, argv): - stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) - - self.frame = frame - self.panel = panel - - parser = OptionParser (option_class=eng_option) - #parser.add_option("-S", "--subdev", type="subdev", default=(0, None), - # help="select USRP Rx side A or B (default=A)") - parser.add_option("-d", "--decim", type="int", default=128, - help="set fgpa decimation rate to DECIM [default=%default]") - parser.add_option("-f", "--freq", type="eng_float", default=146.585e6, - help="set frequency to FREQ [default=%default])", metavar="FREQ") - parser.add_option("-g", "--gain", type="eng_float", default=20, - help="set gain in dB [default=%default]") - parser.add_option("-F", "--filter", action="store_true", default=True, - help="Enable channel filter") - (options, args) = parser.parse_args() - - if len(args) != 0: - parser.print_help() - raise SystemExit - - nchan = 4 - - if options.filter: - sw_decim = 4 - else: - sw_decim = 1 - - self.u = usrp.source_c(0, options.decim, fpga_filename="std_4rx_0tx.rbf") - if self.u.nddcs() < nchan: - sys.stderr.write('This code requires an FPGA build with %d DDCs. This FPGA has only %d.\n' % ( - nchan, self.u.nddcs())) - raise SystemExit - - if not self.u.set_nchannels(nchan): - sys.stderr.write('set_nchannels(%d) failed\n' % (nchan,)) - raise SystemExit - - input_rate = self.u.adc_freq() / self.u.decim_rate() - print "USB data rate = %s" % (eng_notation.num_to_str(input_rate),) - print "Scope data rate = %s" % (eng_notation.num_to_str(input_rate/sw_decim),) - - self.subdev = self.u.db(0) + self.u.db(1) - - if (len(self.subdev) < 4 or - self.u.db(0, 0).dbid() != usrp_dbid.BASIC_RX or - self.u.db(0, 0).dbid() != usrp_dbid.BASIC_RX): - sys.stderr.write('This code requires a Basic Rx board on Sides A & B\n') - sys.exit(1) - - self.u.set_mux(gru.hexint(0xf3f2f1f0)) - - # deinterleave four channels from FPGA - di = gr.deinterleave(gr.sizeof_gr_complex) - - self.connect(self.u, di) - - # our destination (8 float inputs) - self.scope = scopesink2.scope_sink_f(panel, sample_rate=input_rate/sw_decim, - num_inputs=2*nchan) - - # taps for channel filter - chan_filt_coeffs = optfir.low_pass (1, # gain - input_rate, # sampling rate - 80e3, # passband cutoff - 115e3, # stopband cutoff - 0.1, # passband ripple - 60) # stopband attenuation - #print len(chan_filt_coeffs) - - # bust the deinterleaved complex channels into floats - for i in range(nchan): - - if options.filter: - chan_filt = gr.fir_filter_ccf(sw_decim, chan_filt_coeffs) - c2f = gr.complex_to_float() - self.connect((di, i), chan_filt, c2f) - else: - c2f = gr.complex_to_float() - self.connect((di, i), c2f) - - self.connect((c2f, 0), (self.scope, 2*i + 0)) - self.connect((c2f, 1), (self.scope, 2*i + 1)) - - - self._build_gui(vbox) - - self.set_gain(options.gain) - self.set_freq(options.freq) - - def set_gain(self, gain): - for i in range(len(self.subdev)): - self.subdev[i].set_gain(gain) - - def set_freq(self, target_freq): - ok = True - for i in range(len(self.subdev)): - r = usrp.tune(self.u, i, self.subdev[i], target_freq) - if not r: - ok = False - print "set_freq: failed to set subdev[%d] freq to %f" % ( - i, target_freq) - - return ok - - - def _build_gui(self, vbox): - vbox.Add(self.scope.win, 10, wx.EXPAND) - - - -def main (): - app = stdgui2.stdapp(my_top_block, "Multi Scope", nstatus=1) - app.MainLoop() - -if __name__ == '__main__': - main () diff --git a/gr-uhd/Makefile.am b/gr-uhd/Makefile.am index ea16c863c..c81a1a049 100644 --- a/gr-uhd/Makefile.am +++ b/gr-uhd/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common -SUBDIRS = include lib apps +SUBDIRS = include lib apps examples if PYTHON SUBDIRS += swig grc |