summaryrefslogtreecommitdiff
path: root/gr-uhd/examples
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-04-13 18:36:53 -0400
committerTom Rondeau <trondeau@vt.edu>2012-04-13 18:36:53 -0400
commitf919f9dcbb54a08e6e26d6c229ce92fb784fa1b2 (patch)
tree7e846386b9eb1676f9a93fc4a1e55916b9accc97 /gr-uhd/examples
parent6a1e9783fec6ed827f49db27c171591d30f32933 (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')
-rw-r--r--gr-uhd/examples/c++/tag_sink_demo.h8
-rw-r--r--gr-uhd/examples/c++/tag_source_demo.h8
-rw-r--r--gr-uhd/examples/c++/tags_demo.cc8
-rwxr-xr-xgr-uhd/examples/python/fm_tx4.py20
-rwxr-xr-xgr-uhd/examples/python/fm_tx_2_daughterboards.py16
-rwxr-xr-xgr-uhd/examples/python/max_power.py12
-rwxr-xr-xgr-uhd/examples/python/usrp_am_mw_rcv.py42
-rwxr-xr-xgr-uhd/examples/python/usrp_nbfm_ptt.py42
-rwxr-xr-xgr-uhd/examples/python/usrp_nbfm_rcv.py38
-rwxr-xr-xgr-uhd/examples/python/usrp_spectrum_sense.py26
-rwxr-xr-xgr-uhd/examples/python/usrp_tv_rcv.py48
-rwxr-xr-xgr-uhd/examples/python/usrp_tv_rcv_nogui.py22
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv.py34
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv2_nogui.py16
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv_fmdet.py34
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv_nogui.py20
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv_pll.py36
-rwxr-xr-xgr-uhd/examples/python/usrp_wfm_rcv_sca.py14
-rwxr-xr-xgr-uhd/examples/python/usrp_wxapt_rcv.py28
19 files changed, 236 insertions, 236 deletions
diff --git a/gr-uhd/examples/c++/tag_sink_demo.h b/gr-uhd/examples/c++/tag_sink_demo.h
index 7d49bd9713..207cc47e61 100644
--- a/gr-uhd/examples/c++/tag_sink_demo.h
+++ b/gr-uhd/examples/c++/tag_sink_demo.h
@@ -1,18 +1,18 @@
/*
* Copyright 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,
diff --git a/gr-uhd/examples/c++/tag_source_demo.h b/gr-uhd/examples/c++/tag_source_demo.h
index 9743c34075..7d48502b24 100644
--- a/gr-uhd/examples/c++/tag_source_demo.h
+++ b/gr-uhd/examples/c++/tag_source_demo.h
@@ -1,18 +1,18 @@
/*
* Copyright 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,
diff --git a/gr-uhd/examples/c++/tags_demo.cc b/gr-uhd/examples/c++/tags_demo.cc
index f7442f0989..cc4c932726 100644
--- a/gr-uhd/examples/c++/tags_demo.cc
+++ b/gr-uhd/examples/c++/tags_demo.cc
@@ -1,18 +1,18 @@
/*
* Copyright 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,
diff --git a/gr-uhd/examples/python/fm_tx4.py b/gr-uhd/examples/python/fm_tx4.py
index aecb35b542..f412ffb5dc 100755
--- a/gr-uhd/examples/python/fm_tx4.py
+++ b/gr-uhd/examples/python/fm_tx4.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,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.
-#
+#
"""
Transmit N simultaneous narrow band FM signals.
@@ -60,10 +60,10 @@ class pipeline(gr.hier_block2):
sys.stderr.write(("\nError: Could not open file '%s'\n\n" % \
filename))
sys.exit(1)
-
+
print audio_rate, if_rate
fmtx = blks2.nbfm_tx (audio_rate, if_rate, max_dev=5e3, tau=75e-6)
-
+
# Local oscillator
lo = gr.sig_source_c (if_rate, # sample rate
gr.GR_SIN_WAVE, # waveform type
@@ -71,7 +71,7 @@ class pipeline(gr.hier_block2):
1.0, # amplitude
0) # DC Offset
mixer = gr.multiply_cc ()
-
+
self.connect (src, fmtx, (mixer, 0))
self.connect (lo, (mixer, 1))
self.connect (mixer, self)
@@ -107,7 +107,7 @@ class fm_tx_block(stdgui2.std_top_block):
if options.nchannels < 1 or options.nchannels > MAX_CHANNELS:
sys.stderr.write ("fm_tx4: nchannels out of range. Must be in [1,%d]\n" % MAX_CHANNELS)
sys.exit(1)
-
+
if options.freq is None:
sys.stderr.write("fm_tx4: must specify frequency with -f FREQ\n")
parser.print_help()
@@ -168,7 +168,7 @@ class fm_tx_block(stdgui2.std_top_block):
ref_level=40)
self.connect (self.gain, post_mod)
vbox.Add (post_mod.win, 1, wx.EXPAND)
-
+
#if options.debug:
# self.debugger = tx_debug_gui.tx_debug_gui(self.subdev)
diff --git a/gr-uhd/examples/python/fm_tx_2_daughterboards.py b/gr-uhd/examples/python/fm_tx_2_daughterboards.py
index c0a7112dee..b5763e8e19 100755
--- a/gr-uhd/examples/python/fm_tx_2_daughterboards.py
+++ b/gr-uhd/examples/python/fm_tx_2_daughterboards.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,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.
-#
+#
"""
Transmit 2 signals, one out each daughterboard.
@@ -52,7 +52,7 @@ class example_signal_0(gr.hier_block2):
600, # frequency
1.0, # amplitude
0) # DC Offset
-
+
self.connect(src, self)
@@ -179,7 +179,7 @@ class my_top_block(gr.top_block):
if(options.antenna):
self.u.set_antenna(options.antenna, 0)
self.u.set_antenna(options.antenna, 1)
-
+
def set_freq(self, target_freq, chan):
"""
Set the center frequency we're interested in.
@@ -199,7 +199,7 @@ class my_top_block(gr.top_block):
else:
print " Set Frequency Failed!"
-
+
return False
def set_gain(self, gain, chan):
diff --git a/gr-uhd/examples/python/max_power.py b/gr-uhd/examples/python/max_power.py
index a849432ee6..5d23f16afc 100755
--- a/gr-uhd/examples/python/max_power.py
+++ b/gr-uhd/examples/python/max_power.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2004,2007,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.
-#
+#
"""
Setup USRP for maximum power consumption.
@@ -56,7 +56,7 @@ class build_block(gr.top_block):
else:
tx_nchan = 1
rx_nchan = 1
-
+
if tx_enable:
print "\nTRANSMIT CHAIN"
stream_args = uhd.stream_args('fc32', channels=range(tx_nchan))
diff --git a/gr-uhd/examples/python/usrp_am_mw_rcv.py b/gr-uhd/examples/python/usrp_am_mw_rcv.py
index 85ffd76329..28262f2bd5 100755
--- a/gr-uhd/examples/python/usrp_am_mw_rcv.py
+++ b/gr-uhd/examples/python/usrp_am_mw_rcv.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,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, eng_notation, optfir
from gnuradio import audio
@@ -60,15 +60,15 @@ 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.use_IF=options.use_if_freq
if self.use_IF:
- self.IF_freq=64000.0
+ self.IF_freq=64000.0
else:
self.IF_freq=0.0
-
+
self.vol = 0
self.state = "FREQ"
self.freq = 0
@@ -89,7 +89,7 @@ class wfm_rx_block (stdgui2.std_top_block):
audio_rate = 32e3
chanfilt_decim = int(usrp_rate // demod_rate)
audio_decim = int(demod_rate // audio_rate)
-
+
self.u.set_samp_rate(usrp_rate)
dev_rate = self.u.get_samp_rate()
@@ -97,7 +97,7 @@ class wfm_rx_block (stdgui2.std_top_block):
# FIXME: make one of the follow-on filters an arb resampler
rrate = usrp_rate / dev_rate
self.resamp = blks2.pfb_arb_resampler_ccf(rrate)
-
+
chan_filt_coeffs = gr.firdes.low_pass_2 (1, # gain
usrp_rate, # sampling rate
8e3, # passband cutoff
@@ -128,10 +128,10 @@ 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.resamp, self.chan_filt, self.agc,
- self.am_demod, self.audio_filt,
+ self.am_demod, self.audio_filt,
self.volume_control, self.audio_sink)
self._build_gui(vbox, usrp_rate, demod_rate, audio_rate)
@@ -146,7 +146,7 @@ class wfm_rx_block (stdgui2.std_top_block):
if options.volume is None:
v = self.volume_range()
options.volume = float(v[0]*3+v[1])/4.0
-
+
if abs(options.freq) < 1e3:
options.freq *= 1e3
@@ -181,7 +181,7 @@ class wfm_rx_block (stdgui2.std_top_block):
vbox.Add (self.post_filt_fft.win, 4, wx.EXPAND)
if 0:
- post_demod_fft = fftsink2.fft_sink_f(self.panel, title="Post Demod",
+ post_demod_fft = fftsink2.fft_sink_f(self.panel, title="Post Demod",
fft_size=1024, sample_rate=demod_rate,
y_per_div=10, ref_level=0)
self.connect (self.am_demod, post_demod_fft)
@@ -194,7 +194,7 @@ class wfm_rx_block (stdgui2.std_top_block):
self.connect (self.audio_filt, audio_fft)
vbox.Add (audio_fft.win, 4, wx.EXPAND)
-
+
# control area form at bottom
self.myform = myform = form.form()
@@ -255,7 +255,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
@@ -265,7 +265,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()
@@ -273,7 +273,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.
@@ -282,7 +282,7 @@ class wfm_rx_block (stdgui2.std_top_block):
@rypte: bool
"""
r = self.u.set_center_freq(target_freq + self.IF_freq, 0)
-
+
if r:
self.freq = target_freq
self.myform['freq'].set_value(target_freq) # update displayed value
@@ -305,10 +305,10 @@ class wfm_rx_block (stdgui2.std_top_block):
self.src_fft.set_baseband_freq(self.freq)
except:
None
-
+
def volume_range(self):
return (-40.0, 0.0, 0.5)
-
+
if __name__ == '__main__':
app = stdgui2.stdapp (wfm_rx_block, "USRP Broadcast AM MW RX")
diff --git a/gr-uhd/examples/python/usrp_nbfm_ptt.py b/gr-uhd/examples/python/usrp_nbfm_ptt.py
index 075604af32..8d26e656e1 100755
--- a/gr-uhd/examples/python/usrp_nbfm_ptt.py
+++ b/gr-uhd/examples/python/usrp_nbfm_ptt.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005,2007,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.
-#
+#
import math
import sys
@@ -45,7 +45,7 @@ class ptt_block(stdgui2.std_top_block):
self.frame = frame
self.space_bar_pressed = False
-
+
parser = OptionParser (option_class=eng_option)
parser.add_option("-a", "--args", type="string", default="",
help="UHD device address args [default=%default]")
@@ -72,7 +72,7 @@ class ptt_block(stdgui2.std_top_block):
if options.freq < 1e6:
options.freq *= 1e6
-
+
self.txpath = transmit_path(options.args, options.spec,
options.antenna, options.tx_gain,
options.audio_input)
@@ -103,7 +103,7 @@ class ptt_block(stdgui2.std_top_block):
def set_rx_gain(self, gain):
self.myform['rx_gain'].set_value(gain) # update displayed value
self.rxpath.set_gain(gain)
-
+
def set_tx_gain(self, gain):
self.txpath.set_gain(gain)
@@ -129,9 +129,9 @@ class ptt_block(stdgui2.std_top_block):
def _form_set_freq(kv):
return self.set_freq(kv['freq'])
-
+
self.panel = panel
-
+
# FIXME This REALLY needs to be replaced with a hand-crafted button
# that sends both button down and button up events
hbox = wx.BoxSizer(wx.HORIZONTAL)
@@ -203,7 +203,7 @@ class ptt_block(stdgui2.std_top_block):
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Squelch",
weight=3, range=self.rxpath.squelch_range(),
callback=self.set_squelch)
-
+
g = self.rxpath.u.get_gain_range()
hbox.Add((5,0), 0)
myform['rx_gain'] = \
@@ -221,7 +221,7 @@ class ptt_block(stdgui2.std_top_block):
# FIXME figure out how to have this be a subpanel that is always
# created, but has its visibility controlled by foo.Show(True/False)
-
+
#if not(self.show_debug_info):
# return
@@ -268,7 +268,7 @@ class ptt_block(stdgui2.std_top_block):
# if we lose the keyboard focus, turn off the transmitter
self.space_bar_pressed = False
self.set_transmit(False)
-
+
# ////////////////////////////////////////////////////////////////////////
# Transmit Path
@@ -279,7 +279,7 @@ class transmit_path(gr.hier_block2):
gr.hier_block2.__init__(self, "transmit_path",
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(0, 0, 0)) # Output signature
-
+
self.u = uhd.usrp_sink(device_addr=args, stream_args=uhd.stream_args('fc32'))
# Set the subdevice spec
@@ -306,13 +306,13 @@ class transmit_path(gr.hier_block2):
self.audio_rate, # sampling rate
3800, # low pass cutoff freq
300, # width of trans. band
- gr.firdes.WIN_HANN) # filter type
+ gr.firdes.WIN_HANN) # filter type
hpf = gr.firdes.high_pass (1, # gain
self.audio_rate, # sampling rate
325, # low pass cutoff freq
50, # width of trans. band
- gr.firdes.WIN_HANN) # filter type
+ gr.firdes.WIN_HANN) # filter type
audio_taps = convolve(array(lpf),array(hpf))
self.audio_filt = gr.fir_filter_fff(1,audio_taps)
@@ -391,7 +391,7 @@ class receive_path(gr.hier_block2):
nfilts*dev_rate, # sampling rate
13e3, # low pass cutoff freq
4e3, # width of trans. band
- gr.firdes.WIN_HANN) # filter type
+ gr.firdes.WIN_HANN) # filter type
rrate = self.quad_rate / dev_rate
self.resamp = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
@@ -407,7 +407,7 @@ class receive_path(gr.hier_block2):
# sound card as final sink
audio_sink = audio.sink (int(self.audio_rate), audio_output)
-
+
# now wire it all together
self.connect (self.u, self.resamp, self.fmrx, self.squelch,
self._audio_gain, audio_sink)
@@ -423,7 +423,7 @@ class receive_path(gr.hier_block2):
self.set_volume((v[0]+v[1])/2)
s = self.squelch_range()
self.set_squelch((s[0]+s[1])/2)
-
+
# Set the subdevice spec
if(spec):
self.u.set_subdev_spec(spec, 0)
@@ -452,14 +452,14 @@ class receive_path(gr.hier_block2):
def squelch_range(self):
return self.squelch.squelch_range()
-
+
def set_squelch(self, threshold):
print "SQL =", threshold
self.squelch.set_threshold(threshold)
def threshold(self):
return self.squelch.threshold()
-
+
def set_freq(self, target_freq):
"""
Set the center frequency we're interested in.
diff --git a/gr-uhd/examples/python/usrp_nbfm_rcv.py b/gr-uhd/examples/python/usrp_nbfm_rcv.py
index 6fdf95a30c..571abe8c90 100755
--- a/gr-uhd/examples/python/usrp_nbfm_rcv.py
+++ b/gr-uhd/examples/python/usrp_nbfm_rcv.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005,2007,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, audio, blks2, uhd
from gnuradio.eng_option import eng_option
@@ -58,13 +58,13 @@ class my_top_block (stdgui2.std_top_block):
if len(args) != 0:
parser.print_help()
sys.exit(1)
-
+
if options.freq < 1e6:
options.freq *= 1e6
-
+
self.frame = frame
self.panel = panel
-
+
self.state = "FREQ"
self.freq = 0
self.freq_step = 25e3
@@ -72,7 +72,7 @@ class my_top_block (stdgui2.std_top_block):
self.rxpath = receive_path(options.args, options.spec, options.antenna,
options.gain, options.audio_output)
self.connect(self.rxpath)
-
+
self._build_gui(vbox, options.no_gui)
# set initial values
@@ -119,7 +119,7 @@ class my_top_block (stdgui2.std_top_block):
y_per_div=20)
self.connect (self.rxpath.resamp, rx_fft)
vbox.Add (rx_fft.win, 4, wx.EXPAND)
-
+
if 1 and not(no_gui):
post_deemph_fft = fftsink2.fft_sink_f(self.panel,
title="Post Deemph",
@@ -132,7 +132,7 @@ class my_top_block (stdgui2.std_top_block):
if 0:
post_filt_fft = fftsink2.fft_sink_f(self.panel,
- title="Post Filter",
+ title="Post Filter",
fft_size=512,
sample_rate=audio_rate,
y_per_div=10,
@@ -206,7 +206,7 @@ class my_top_block (stdgui2.std_top_block):
elif self.rot <=-3:
self.set_volume(self.rxpath.volume - step)
self.rot += 3
-
+
def on_button (self, event):
if event.value == 0: # button up
return
@@ -216,7 +216,7 @@ class my_top_block (stdgui2.std_top_block):
else:
self.state = "FREQ"
self.update_status_bar ()
-
+
def set_squelch(self, threshold_in_db):
self.rxpath.set_squelch(threshold_in_db)
@@ -226,7 +226,7 @@ class my_top_block (stdgui2.std_top_block):
self.rxpath.set_volume(vol)
self.myform['volume'].set_value(self.rxpath.volume)
self.update_status_bar ()
-
+
def set_freq(self, target_freq):
r = self.rxpath.set_freq(target_freq)
if r:
@@ -252,7 +252,7 @@ class my_top_block (stdgui2.std_top_block):
def volume_range(self):
return (-20.0, 0.0, 0.5)
-
+
#////////////////////////////////////////////////////////////////////////
# Receive Path
@@ -289,7 +289,7 @@ class receive_path(gr.hier_block2):
nfilts*dev_rate, # sampling rate
8e3, # low pass cutoff freq
2e3, # width of trans. band
- gr.firdes.WIN_HANN) # filter type
+ gr.firdes.WIN_HANN) # filter type
rrate = self.quad_rate / dev_rate
self.resamp = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
@@ -306,7 +306,7 @@ class receive_path(gr.hier_block2):
# sound card as final sink
audio_sink = audio.sink (int(self.audio_rate), audio_output)
-
+
# now wire it all together
if USE_SIMPLE_SQUELCH:
self.connect (self.u, self.resamp, self.squelch, self.fmrx,
@@ -338,12 +338,12 @@ class receive_path(gr.hier_block2):
def _update_audio_gain(self):
self._audio_gain.set_k(10**(self.volume/10))
-
+
def squelch_range(self):
r = self.squelch.squelch_range()
#print "squelch_range: ", r
return r
-
+
def set_squelch(self, threshold):
#print "SQL =", threshold
self.squelch.set_threshold(threshold)
diff --git a/gr-uhd/examples/python/usrp_spectrum_sense.py b/gr-uhd/examples/python/usrp_spectrum_sense.py
index 355a55a985..32980adbfa 100755
--- a/gr-uhd/examples/python/usrp_spectrum_sense.py
+++ b/gr-uhd/examples/python/usrp_spectrum_sense.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005,2007,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, eng_notation, window
from gnuradio import audio
@@ -35,7 +35,7 @@ sys.stderr.write("Warning: this may have issues on some machines+Python version
class ThreadClass(threading.Thread):
def run(self):
return
-
+
class tune(gr.feval_dd):
"""
This class allows C++ code to callback into python.
@@ -158,13 +158,13 @@ class my_top_block(gr.top_block):
power = 0
for tap in mywindow:
power += tap*tap
-
+
c2mag = gr.complex_to_mag_squared(self.fft_size)
# FIXME the log10 primitive is dog slow
log = gr.nlog10_ff(10, self.fft_size,
-20*math.log10(self.fft_size)-10*math.log10(power/self.fft_size))
-
+
# Set the freq_step to 75% of the actual data throughput.
# This allows us to discard the bins on both ends of the spectrum.
@@ -174,7 +174,7 @@ class my_top_block(gr.top_block):
self.max_center_freq = self.min_center_freq + (nsteps * self.freq_step)
self.next_freq = self.min_center_freq
-
+
tune_delay = max(0, int(round(options.tune_delay * usrp_rate / self.fft_size))) # in fft_frames
dwell_delay = max(1, int(round(options.dwell_delay * usrp_rate / self.fft_size))) # in fft_frames
@@ -207,7 +207,7 @@ class my_top_block(gr.top_block):
sys.exit(1)
return target_freq
-
+
def set_freq(self, target_freq):
"""
@@ -237,14 +237,14 @@ def main_loop(tb):
print m.center_freq
# FIXME do something useful with the data...
-
+
# m.data are the mag_squared of the fft output (they are in the
# standard order. I.e., bin 0 == DC.)
# You'll probably want to do the equivalent of "fftshift" on them
# m.raw_data is a string that contains the binary floats.
# You could write this as binary to a file.
-
+
if __name__ == '__main__':
t = ThreadClass()
t.start()
@@ -253,6 +253,6 @@ if __name__ == '__main__':
try:
tb.start()
main_loop(tb)
-
+
except KeyboardInterrupt:
pass
diff --git a/gr-uhd/examples/python/usrp_tv_rcv.py b/gr-uhd/examples/python/usrp_tv_rcv.py
index 700915bf8b..b49a5ea71a 100755
--- a/gr-uhd/examples/python/usrp_tv_rcv.py
+++ b/gr-uhd/examples/python/usrp_tv_rcv.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,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.
-#
+#
"""
Realtime capture and display of analog Tv stations.
@@ -95,7 +95,7 @@ class tv_rx_block (stdgui2.std_top_block):
if not ((len(args) == 1) or (len(args) == 0)):
parser.print_help()
sys.exit(1)
-
+
if len(args) == 1:
filename = args[0]
else:
@@ -103,7 +103,7 @@ class tv_rx_block (stdgui2.std_top_block):
self.frame = frame
self.panel = panel
-
+
self.contrast = options.contrast
self.brightness = options.brightness
self.state = "FREQ"
@@ -136,7 +136,7 @@ class tv_rx_block (stdgui2.std_top_block):
# Set the subdevice spec
if(options.spec):
self.u.set_subdev_spec(options.spec, 0)
-
+
# Set the antenna
if(options.antenna):
self.u.set_antenna(options.antenna, 0)
@@ -151,7 +151,7 @@ class tv_rx_block (stdgui2.std_top_block):
self.src=self.u
- self.gain = options.gain
+ self.gain = options.gain
f2uc=gr.float_to_uchar()
@@ -189,10 +189,10 @@ class tv_rx_block (stdgui2.std_top_block):
print "use the following line to show the demodulated TV-signal:"
print "display -depth 8 -size " +str(width)+ "x" + str(height) \
+ " gray:" + options.out_filename
- print "(Use the spacebar to advance to next frames)"
+ print "(Use the spacebar to advance to next frames)"
options.repeat=False
file_sink=gr.file_sink(gr.sizeof_char, options.out_filename)
- self.dst =file_sink
+ self.dst =file_sink
self.agc=gr.agc_cc(1e-7,1.0,1.0) #1e-7
self.am_demod = gr.complex_to_mag ()
@@ -219,7 +219,7 @@ class tv_rx_block (stdgui2.std_top_block):
self.tv_sync_adv=gr.tv_sync_adv(usrp_rate, 0, False, False,
0.0, 255.0, 0.01, 1.0, 0.0, False)
self.connect (self.src, self.am_demod, self.invert_and_scale,
- self.tv_sync_adv, s2f, f2uc, self.dst)
+ self.tv_sync_adv, s2f, f2uc, self.dst)
elif process_type=='do_nullsink':
#self.connect (self.src, self.am_demod,self.invert_and_scale,f2uc,video_sink)
@@ -229,16 +229,16 @@ class tv_rx_block (stdgui2.std_top_block):
elif process_type=='do_tv_sync_corr':
frame_size=width*height #int(usrp_rate/25.0)
nframes=10# 32
- search_window=20*nframes
+ search_window=20*nframes
debug=False
video_alpha=0.3 #0.1
corr_alpha=0.3
-
+
#Note: this block is not yet in cvs
tv_corr=gr.tv_correlator_ff(frame_size,nframes, search_window,
- video_alpha, corr_alpha,debug)
+ video_alpha, corr_alpha,debug)
shift=gr.add_const_ff(-0.7)
-
+
self.connect (self.src, self.agc, self.am_demod, tv_corr,
self.invert_and_scale, self.set_blacklevel,
f2uc, self.dst)
@@ -248,7 +248,7 @@ class tv_rx_block (stdgui2.std_top_block):
self.connect(src_vertical_bars, f2uc, self.dst)
self._build_gui(vbox, usrp_rate, usrp_rate, usrp_rate)
-
+
frange = self.u.get_freq_range()
if(frange.start() > self.tv_freq_max or frange.stop() < self.tv_freq_min):
@@ -290,13 +290,13 @@ class tv_rx_block (stdgui2.std_top_block):
vbox.Add (post_demod_fft.win, 4, wx.EXPAND)
if 0:
- post_filt_fft = fftsink.fft_sink_f (self, self.panel, title="Post Filter",
+ post_filt_fft = fftsink.fft_sink_f (self, self.panel, title="Post Filter",
fft_size=512, sample_rate=audio_rate,
y_per_div=10, ref_level=-40)
self.connect (self.set_blacklevel, post_filt)
vbox.Add (fft_win4, 4, wx.EXPAND)
-
+
# control area form at bottom
self.myform = myform = form.form()
@@ -373,7 +373,7 @@ class tv_rx_block (stdgui2.std_top_block):
elif self.rot <=-3:
self.set_brightness(self.brightness - step)
self.rot += 3
-
+
def on_button (self, event):
if event.value == 0: # button up
return
@@ -385,7 +385,7 @@ class tv_rx_block (stdgui2.std_top_block):
else:
self.state = "FREQ"
self.update_status_bar ()
-
+
def set_contrast (self, contrast):
self.contrast = contrast
@@ -398,7 +398,7 @@ class tv_rx_block (stdgui2.std_top_block):
self.set_blacklevel.set_k(self.brightness +255.0)
self.myform['brightness'].set_value(self.brightness)
self.update_status_bar ()
-
+
def set_freq(self, target_freq):
"""
Set the center frequency we're interested in.
@@ -430,13 +430,13 @@ class tv_rx_block (stdgui2.std_top_block):
self.myform['gain'].set_value(gain) # update displayed value
self.u.set_gain(gain)
self.update_status_bar()
-
+
def update_status_bar (self):
msg = "Setting:%s Contrast:%r Brightness:%r Gain: %r" % \
(self.state, self.contrast,self.brightness,self.gain)
self._set_status_msg(msg, 1)
#self.src_fft.set_baseband_freq(self.freq)
-
+
if __name__ == '__main__':
app = stdgui2.stdapp (tv_rx_block, "USRP TV RX black-and-white")
diff --git a/gr-uhd/examples/python/usrp_tv_rcv_nogui.py b/gr-uhd/examples/python/usrp_tv_rcv_nogui.py
index 870e65b271..cfb36222cb 100755
--- a/gr-uhd/examples/python/usrp_tv_rcv_nogui.py
+++ b/gr-uhd/examples/python/usrp_tv_rcv_nogui.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,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.
-#
+#
"""
Reads from a file and generates PAL TV pictures in black and white
@@ -99,7 +99,7 @@ class my_top_block(gr.top_block):
parser.print_help()
sys.stderr.write('You must specify the output. FILENAME or sdl \n');
sys.exit(1)
-
+
filename = args[0]
self.tv_freq_min = options.freq_min
@@ -120,7 +120,7 @@ class my_top_block(gr.top_block):
# file is data source, capture with usr_rx_csfile.py
self.filesource = gr.file_source(gr.sizeof_short,
options.in_filename,
- options.repeat)
+ options.repeat)
self.istoc = gr.interleaved_short_to_complex()
self.connect(self.filesource,self.istoc)
self.src=self.istoc
@@ -140,7 +140,7 @@ class my_top_block(gr.top_block):
# Set the antenna
if(options.antenna):
self.u.set_antenna(options.antenna, 0)
-
+
self.u.set_samp_rate(input_rate)
dev_rate = self.u.get_samp_rate()
@@ -156,7 +156,7 @@ class my_top_block(gr.top_block):
if not r:
sys.stderr.write('Failed to set frequency\n')
raise SystemExit, 1
-
+
self.agc = gr.agc_cc(1e-7,1.0,1.0) #1e-7
self.am_demod = gr.complex_to_mag ()
@@ -194,9 +194,9 @@ class my_top_block(gr.top_block):
print "You can use the imagemagick display tool to show the resulting imagesequence"
print "use the following line to show the demodulated TV-signal:"
print "display -depth 8 -size " +str(width)+ "x" + str(height) + " gray:" +filename
- print "(Use the spacebar to advance to next frames)"
+ print "(Use the spacebar to advance to next frames)"
file_sink=gr.file_sink(gr.sizeof_char, filename)
- self.dst =file_sink
+ self.dst =file_sink
if options.nframes is None:
self.connect(self.src, self.agc)
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")
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py
index b70334f301..f7e72ae6f9 100755
--- a/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py
+++ b/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,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
@@ -55,13 +55,13 @@ class wfm_rx_block (gr.top_block):
if len(args) != 0:
parser.print_help()
sys.exit(1)
-
+
if abs(options.f1 - options.f2) > 5.5e6:
print "Sorry, two stations must be within 5.5MHz of each other"
raise SystemExit
f = (options.f1, options.f2)
-
+
self.vol = .1
self.state = "FREQ"
@@ -130,7 +130,7 @@ class wfm_rx_block (gr.top_block):
tr = uhd.tune_request(f[n], rf_freq=mid_freq,
rf_freq_policy=uhd.tune_request.POLICY_MANUAL)
self.u.set_center_freq(tr, n)
-
+
# Set gain for each channel
self.set_gain(options.gain, n)
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py
index 9649857c06..514bd4faf7 100755
--- a/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py
+++ b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,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
@@ -59,10 +59,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
@@ -112,7 +112,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.connect((self.guts, 0), self.lchan_filt,
@@ -206,7 +206,7 @@ class wfm_rx_block (stdgui2.std_top_block):
if 0:
- LmR_fft = fftsink2.fft_sink_f(self.panel, title="LmR",
+ LmR_fft = fftsink2.fft_sink_f(self.panel, title="LmR",
fft_size=512, sample_rate=audio_rate,
y_per_div=10, ref_level=-20)
self.connect (self.guts.LmR_real,LmR_fft)
@@ -216,7 +216,7 @@ class wfm_rx_block (stdgui2.std_top_block):
self.scope = scopesink2.scope_sink_f(self.panel, sample_rate=demod_rate)
self.connect (self.guts.fm_demod,self.scope)
vbox.Add (self.scope.win,4,wx.EXPAND)
-
+
# control area form at bottom
self.myform = myform = form.form()
@@ -243,7 +243,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()),
@@ -283,7 +283,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
@@ -293,7 +293,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()
@@ -308,7 +308,7 @@ class wfm_rx_block (stdgui2.std_top_block):
self.guts.stereo_carrier_pll_recovery.set_lock_threshold(squelch_threshold);
except:
print "FYI: This implementation of the stereo_carrier_pll_recovery has no squelch implementation yet"
-
+
def set_freq(self, target_freq):
"""
@@ -317,7 +317,7 @@ class wfm_rx_block (stdgui2.std_top_block):
@param target_freq: frequency in Hz
@rypte: bool
"""
-
+
r = self.u.set_center_freq(target_freq)
if r:
@@ -330,7 +330,7 @@ class wfm_rx_block (stdgui2.std_top_block):
self._set_status_msg("Failed", 0)
return False
-
+
def set_gain(self, gain):
self.myform['gain'].set_value(gain) # update displayed value
self.u.set_gain(gain)
@@ -342,7 +342,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")
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py
index f0195bcb53..7d042983ef 100755
--- a/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py
+++ b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,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 import eng_notation
@@ -55,7 +55,7 @@ class wfm_rx_block (gr.top_block):
if len(args) != 0:
parser.print_help()
sys.exit(1)
-
+
self.state = "FREQ"
self.freq = 0
@@ -99,7 +99,7 @@ class wfm_rx_block (gr.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)
@@ -140,7 +140,7 @@ class wfm_rx_block (gr.top_block):
@param target_freq: frequency in Hz
@rypte: bool
"""
-
+
r = self.u.set_center_freq(target_freq)
if r:
@@ -159,14 +159,14 @@ class wfm_rx_block (gr.top_block):
msg = "Freq: %s Volume:%f Setting:%s" % (
eng_notation.num_to_str(self.freq), self.vol, self.state)
self._set_status_msg(msg, 1)
-
+
def _set_status_msg(self, msg, which=0):
print msg
def volume_range(self):
return (-20.0, 0.0, 0.5)
-
+
if __name__ == '__main__':
tb = wfm_rx_block()
try:
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_pll.py b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py
index b0744b00b2..53b1e6feac 100755
--- a/gr-uhd/examples/python/usrp_wfm_rcv_pll.py
+++ b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,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 import eng_notation
@@ -59,10 +59,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
@@ -97,7 +97,7 @@ class wfm_rx_block (stdgui2.std_top_block):
70) # stopband attenuation
rrate = usrp_rate / dev_rate
self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
-
+
self.guts = blks2.wfm_rcv_pll (demod_rate, audio_decim)
@@ -113,7 +113,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.connect((self.guts, 0), self.lchan_filt,
@@ -204,7 +204,7 @@ class wfm_rx_block (stdgui2.std_top_block):
if 0:
- LmR_fft = fftsink2.fft_sink_f(self.panel, title="LmR",
+ LmR_fft = fftsink2.fft_sink_f(self.panel, title="LmR",
fft_size=512, sample_rate=audio_rate,
y_per_div=10, ref_level=-20)
self.connect (self.guts.LmR_real,LmR_fft)
@@ -214,7 +214,7 @@ class wfm_rx_block (stdgui2.std_top_block):
self.scope = scopesink2.scope_sink_f(self.panel, sample_rate=demod_rate)
self.connect (self.guts.fm_demod,self.scope)
vbox.Add (self.scope.win,4,wx.EXPAND)
-
+
# control area form at bottom
self.myform = myform = form.form()
@@ -241,7 +241,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()),
@@ -281,7 +281,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
@@ -291,7 +291,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()
@@ -306,7 +306,7 @@ class wfm_rx_block (stdgui2.std_top_block):
self.guts.stereo_carrier_pll_recovery.set_lock_threshold(squelch_threshold);
except:
print "FYI: This implementation of the stereo_carrier_pll_recovery has no squelch implementation yet"
-
+
def set_freq(self, target_freq):
"""
Set the center frequency we're interested in.
@@ -314,7 +314,7 @@ class wfm_rx_block (stdgui2.std_top_block):
@param target_freq: frequency in Hz
@rypte: bool
"""
-
+
r = self.u.set_center_freq(target_freq)
if r:
@@ -327,7 +327,7 @@ class wfm_rx_block (stdgui2.std_top_block):
self._set_status_msg("Failed", 0)
return False
-
+
def set_gain(self, gain):
self.myform['gain'].set_value(gain) # update displayed value
self.u.set_gain(gain)
@@ -339,7 +339,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")
diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_sca.py b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py
index 224f30cf8b..646fe85870 100755
--- a/gr-uhd/examples/python/usrp_wfm_rcv_sca.py
+++ b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py
@@ -1,19 +1,19 @@
#!/usr/bin/env python
#
# Copyright 2006,2007,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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -109,7 +109,7 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
# Set the antenna
if(options.antenna):
self.u.set_antenna(options.antenna, 0)
-
+
usrp_rate = 320e3
demod_rate = 320e3
audio_rate = 32e3
@@ -218,7 +218,7 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
self.set_sca_freq(67000) # A common SCA Frequency
-
+
def _set_status_msg(self, msg, which=0):
self.frame.GetStatusBar().SetStatusText(msg, which)
@@ -300,7 +300,7 @@ class wfm_rx_sca_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()),
diff --git a/gr-uhd/examples/python/usrp_wxapt_rcv.py b/gr-uhd/examples/python/usrp_wxapt_rcv.py
index d9b1a0188f..6b57de3bcf 100755
--- a/gr-uhd/examples/python/usrp_wxapt_rcv.py
+++ b/gr-uhd/examples/python/usrp_wxapt_rcv.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2005-2007,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, audio, blks2, uhd
from gnuradio.eng_option import eng_option
@@ -57,10 +57,10 @@ class wxapt_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
@@ -102,7 +102,7 @@ class wxapt_rx_block (stdgui2.std_top_block):
# sound card as final sink
self.audio_sink = audio.sink (int (audio_rate), options.audio_output)
-
+
# now wire it all together
self.connect (self.u, self.chan_filt, self.guts,
self.volume_control, self.audio_sink)
@@ -157,13 +157,13 @@ class wxapt_rx_block (stdgui2.std_top_block):
vbox.Add (post_deemph_fft.win, 4, wx.EXPAND)
if 1:
- post_filt_fft = fftsink2.fft_sink_f (self.panel, title="Post Filter",
+ post_filt_fft = fftsink2.fft_sink_f (self.panel, title="Post Filter",
fft_size=512, sample_rate=audio_rate,
y_per_div=10, ref_level=0)
self.connect (self.guts.audio_filter, post_filt_fft)
vbox.Add (post_filt_fft.win, 4, wx.EXPAND)
-
+
# control area form at bottom
self.myform = myform = form.form()
@@ -224,7 +224,7 @@ class wxapt_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
@@ -234,7 +234,7 @@ class wxapt_rx_block (stdgui2.std_top_block):
else:
self.state = "FREQ"
self.update_status_bar ()
-
+
def set_vol (self, vol):
g = self.volume_range()
@@ -242,7 +242,7 @@ class wxapt_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.
@@ -275,7 +275,7 @@ class wxapt_rx_block (stdgui2.std_top_block):
def volume_range(self):
return (-20.0, 0.0, 0.5)
-
+
if __name__ == '__main__':
app = stdgui2.stdapp (wxapt_rx_block, "USRP WXAPT RX")