summaryrefslogtreecommitdiff
path: root/gr-dtv/examples/atsc_ctrlport_monitor.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-dtv/examples/atsc_ctrlport_monitor.py')
-rw-r--r--[-rwxr-xr-x]gr-dtv/examples/atsc_ctrlport_monitor.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/gr-dtv/examples/atsc_ctrlport_monitor.py b/gr-dtv/examples/atsc_ctrlport_monitor.py
index 7c43aebb77..9e1a7778c2 100755..100644
--- a/gr-dtv/examples/atsc_ctrlport_monitor.py
+++ b/gr-dtv/examples/atsc_ctrlport_monitor.py
@@ -18,6 +18,10 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
+
import sys
import matplotlib
matplotlib.use("QT4Agg")
@@ -37,12 +41,12 @@ the link quality. This also gets the equalizer taps of the receiver
and displays the frequency response.
"""
-class atsc_ctrlport_monitor:
+class atsc_ctrlport_monitor(object):
def __init__(self, host, port):
argv = [None, host, port]
radiosys = GNURadioControlPortClient(argv=argv, rpcmethod='thrift')
self.radio = radiosys.client
- print self.radio
+ print(self.radio)
vt_init_key = 'dtv_atsc_viterbi_decoder0::decoder_metrics'
@@ -108,17 +112,17 @@ class atsc_ctrlport_monitor:
ntaps = len(eqdata.value)
taps.set_ydata(eqdata.value)
- taps.set_xdata(xrange(ntaps))
+ taps.set_xdata(list(range(ntaps)))
self._sp0.set_xlim(0, ntaps)
self._sp0.set_ylim(min(eqdata.value), max(eqdata.value))
fs = 6.25e6
- freq = scipy.linspace(-fs/2, fs/2, 10000)
+ freq = scipy.linspace(-fs / 2, fs / 2, 10000)
H = fftpack.fftshift(fftpack.fft(eqdata.value, 10000))
HdB = 20.0*scipy.log10(abs(H))
psd.set_ydata(HdB)
psd.set_xdata(freq)
- self._sp1.set_xlim(0, fs/2)
+ self._sp1.set_xlim(0, fs / 2)
self._sp1.set_ylim([min(HdB), max(HdB)])
self._sp1.set_yticks([min(HdB), max(HdB)])
self._sp1.set_yticklabels(["min", "max"])