diff options
Diffstat (limited to 'gr-pager/apps/usrp_flex')
-rwxr-xr-x | gr-pager/apps/usrp_flex | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gr-pager/apps/usrp_flex b/gr-pager/apps/usrp_flex index 7d0d66a95..33877ea4e 100755 --- a/gr-pager/apps/usrp_flex +++ b/gr-pager/apps/usrp_flex @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2006,2007,2009,2011 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. -# +# from gnuradio import gr, gru, uhd, optfir, eng_notation, pager from gnuradio.eng_option import eng_option @@ -32,7 +32,7 @@ class app_top_block(gr.top_block): self.offset = 0.0 self.adj_time = time.time() self.verbose = options.verbose - + if options.from_file is None: # Set up USRP source self.u = uhd.usrp_source(device_addr=options.address, stream_args=uhd.stream_args('fc32')) @@ -44,7 +44,7 @@ class app_top_block(gr.top_block): if rate != 250e3: print "Unable to set required sample rate of 250 Ksps (got %f)" % rate sys.exit(1) - + # Tune daughterboard r = self.u.set_center_freq(options.freq+options.calibration, 0) if not r: @@ -60,15 +60,15 @@ class app_top_block(gr.top_block): print "\nNo gain specified." print "Setting gain to %f (from [%f, %f])" % \ (options.rx_gain, grange.start(), grange.stop()) - + self.u.set_gain(options.rx_gain, 0) - + else: # Use supplied file as source of samples self.u = gr.file_source(gr.sizeof_gr_complex, options.from_file) if options.verbose: print "Reading samples from", options.from_file - + if options.log and not options.from_file: usrp_sink = gr.file_sink(gr.sizeof_gr_complex, 'usrp.dat') self.connect(self.u, usrp_sink) @@ -81,7 +81,7 @@ class app_top_block(gr.top_block): 12500, # One-sided channel bandwidth 0.1, # Passband ripple 60) # Stopband attenuation - + if options.verbose: print "Channel filter has", len(taps), "taps." @@ -109,7 +109,7 @@ class app_top_block(gr.top_block): self.chan.set_center_freq(self.offset) if self.verbose: print "Channel frequency offset (Hz):", int(self.offset) - + def get_options(): parser = OptionParser(option_class=eng_option) @@ -140,7 +140,7 @@ def get_options(): if (options.freq is None): sys.stderr.write("You must specify -f FREQ or --freq FREQ\n") sys.exit(1) - + return (options, args) if __name__ == "__main__": @@ -151,7 +151,7 @@ if __name__ == "__main__": queue = gr.msg_queue() tb = app_top_block(options, queue) runner = pager.queue_runner(queue) - + try: tb.run() except KeyboardInterrupt: |