diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-04-13 18:36:53 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-04-13 18:36:53 -0400 |
commit | f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2 (patch) | |
tree | 7e846386b9eb1676f9a93fc4a1e55916b9accc97 /gr-uhd/examples/python/usrp_wfm_rcv.py | |
parent | 6a1e9783fec6ed827f49db27c171591d30f32933 (diff) |
Removed whitespace and added dtools/bin/remove-whitespace as a tool to do this in the future.
The sed script was provided by Moritz Fischer.
Diffstat (limited to 'gr-uhd/examples/python/usrp_wfm_rcv.py')
-rwxr-xr-x | gr-uhd/examples/python/usrp_wfm_rcv.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv.py b/gr-uhd/examples/python/usrp_wfm_rcv.py index f6c5cf853a..bbb5990337 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2005-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, optfir, audio, blks2, uhd from gnuradio.eng_option import eng_option @@ -57,10 +57,10 @@ class wfm_rx_block (stdgui2.std_top_block): if len(args) != 0: parser.print_help() sys.exit(1) - + self.frame = frame self.panel = panel - + self.vol = 0 self.state = "FREQ" self.freq = 0 @@ -105,7 +105,7 @@ class wfm_rx_block (stdgui2.std_top_block): self.audio_sink = audio.sink (int (audio_rate), options.audio_output, False) # ok_to_block - + # now wire it all together self.connect (self.u, self.chan_filt, self.guts, self.volume_control, self.audio_sink) @@ -120,7 +120,7 @@ class wfm_rx_block (stdgui2.std_top_block): if options.volume is None: g = self.volume_range() options.volume = float(g[0]+g[1])/2 - + frange = self.u.get_freq_range() if(frange.start() > self.fm_freq_max or frange.stop() < self.fm_freq_min): sys.stderr.write("Radio does not support required frequency range.\n") @@ -128,7 +128,7 @@ class wfm_rx_block (stdgui2.std_top_block): if(options.freq < self.fm_freq_min or options.freq > self.fm_freq_max): sys.stderr.write("Requested frequency is outside of required frequency range.\n") sys.exit(1) - + # set initial values @@ -155,7 +155,7 @@ class wfm_rx_block (stdgui2.std_top_block): vbox.Add (self.src_fft.win, 4, wx.EXPAND) if 1: - post_filt_fft = fftsink2.fft_sink_f(self.panel, title="Post Demod", + post_filt_fft = fftsink2.fft_sink_f(self.panel, title="Post Demod", fft_size=1024, sample_rate=usrp_rate, y_per_div=10, ref_level=0) self.connect (self.guts.fm_demod, post_filt_fft) @@ -168,7 +168,7 @@ class wfm_rx_block (stdgui2.std_top_block): self.connect (self.guts.deemph, post_deemph_fft) vbox.Add (post_deemph_fft.win, 4, wx.EXPAND) - + # control area form at bottom self.myform = myform = form.form() @@ -195,7 +195,7 @@ class wfm_rx_block (stdgui2.std_top_block): callback=self.set_vol) hbox.Add((5,0), 1) - g = self.u.get_gain_range() + g = self.u.get_gain_range() myform['gain'] = \ form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Gain", weight=3, range=(g.start(), g.stop(), g.step()), @@ -229,7 +229,7 @@ class wfm_rx_block (stdgui2.std_top_block): elif self.rot <=-3: self.set_vol(self.vol - step) self.rot += 3 - + def on_button (self, event): if event.value == 0: # button up return @@ -239,7 +239,7 @@ class wfm_rx_block (stdgui2.std_top_block): else: self.state = "FREQ" self.update_status_bar () - + def set_vol (self, vol): g = self.volume_range() @@ -247,7 +247,7 @@ class wfm_rx_block (stdgui2.std_top_block): self.volume_control.set_k(10**(self.vol/10)) self.myform['volume'].set_value(self.vol) self.update_status_bar () - + def set_freq(self, target_freq): """ Set the center frequency we're interested in. @@ -279,7 +279,7 @@ class wfm_rx_block (stdgui2.std_top_block): def volume_range(self): return (-20.0, 0.0, 0.5) - + if __name__ == '__main__': app = stdgui2.stdapp (wfm_rx_block, "USRP WFM RX") |