diff options
Diffstat (limited to 'gr-utils/python/utils')
-rw-r--r-- | gr-utils/python/utils/CMakeLists.txt | 32 | ||||
-rw-r--r-- | gr-utils/python/utils/README.plot | 60 | ||||
-rwxr-xr-x | gr-utils/python/utils/gr_plot | 26 | ||||
-rwxr-xr-x | gr-utils/python/utils/gr_plot_const | 230 | ||||
-rwxr-xr-x | gr-utils/python/utils/gr_plot_fft | 26 | ||||
-rwxr-xr-x | gr-utils/python/utils/gr_plot_iq | 159 | ||||
-rwxr-xr-x | gr-utils/python/utils/gr_plot_psd | 26 | ||||
-rwxr-xr-x | gr-utils/python/utils/gr_plot_qt | 724 | ||||
-rw-r--r-- | gr-utils/python/utils/plot_data.py | 188 | ||||
-rw-r--r-- | gr-utils/python/utils/plot_fft_base.py | 237 | ||||
-rw-r--r-- | gr-utils/python/utils/plot_psd_base.py | 276 | ||||
-rw-r--r-- | gr-utils/python/utils/pyqt_filter.py | 436 | ||||
-rw-r--r-- | gr-utils/python/utils/pyqt_filter.ui | 687 | ||||
-rw-r--r-- | gr-utils/python/utils/pyqt_plot.py | 271 | ||||
-rw-r--r-- | gr-utils/python/utils/pyqt_plot.ui | 514 |
15 files changed, 0 insertions, 3892 deletions
diff --git a/gr-utils/python/utils/CMakeLists.txt b/gr-utils/python/utils/CMakeLists.txt deleted file mode 100644 index 87362cf604..0000000000 --- a/gr-utils/python/utils/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2011,2020 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# - -######################################################################## -# Install python files and apps -######################################################################## -include(GrPython) - -GR_PYTHON_INSTALL( - FILES - plot_data.py - plot_fft_base.py - plot_psd_base.py - pyqt_plot.py - pyqt_filter.py - DESTINATION ${GR_PYTHON_DIR}/gnuradio -) - -GR_PYTHON_INSTALL( - PROGRAMS - gr_plot - gr_plot_const - gr_plot_fft - gr_plot_psd - gr_plot_iq - gr_plot_qt - DESTINATION ${GR_RUNTIME_DIR} -) diff --git a/gr-utils/python/utils/README.plot b/gr-utils/python/utils/README.plot deleted file mode 100644 index 1b1cdf1fcb..0000000000 --- a/gr-utils/python/utils/README.plot +++ /dev/null @@ -1,60 +0,0 @@ -* gr_plot_*: -These are a collection of Python scripts to enable viewing and -analysis of files produced by GNU Radio flow graphs. Most of them work -off complex data produced by digital waveforms. - - -** gr_plot: -Takes a GNU Radio binary file and displays the samples versus time. -You can set the block size to specify how many points to read in at a -time and the start position in the file. - -By default, the system assumes a sample rate of 1, so in time, each -sample is plotted versus the sample number. To set a true time axis, -set the sample rate (-R or --sample-rate) to the sample rate used when -capturing the samples. - - - -** gr_plot_iq: -Takes a GNU Radio complex binary file and displays the I&Q data versus -time. You can set the block size to specify how many points to read in -at a time and the start position in the file. - -By default, the system assumes a sample rate of 1, so in time, each -sample is plotted versus the sample number. To set a true time axis, -set the sample rate (-R or --sample-rate) to the sample rate used when -capturing the samples. - - - -** gr_plot_const: -Takes a GNU Radio complex binary file and displays the I&Q data versus -time and the constellation plot (I vs. Q). You can set the block size -to specify how many points to read in at a time and the start position -in the file. - -By default, the system assumes a sample rate of 1, so in time, each -sample is plotted versus the sample number. To set a true time axis, -set the sample rate (-R or --sample-rate) to the sample rate used when -capturing the samples. - - - -** gr_plot_fft: -Takes a GNU Radio binary file (the datatype is specified using the -d -option and defaults to complex64) and displays the samples versus time -as well as the frequency domain (FFT) plot. The y-axis values are -plotted assuming volts as the amplitude of the I&Q streams and -converted into dBm in the frequency domain (the 1/N power adjustment -out of the FFT is performed internally). - -The script plots a certain block of data at a time, specified on the -command line as -B or --block. This value defaults to 1000. The start -position in the file can be set by specifying -s or --start and -defaults to 0 (the start of the file). - -By default, the system assumes a sample rate of 1, so in time, each -sample is plotted versus the sample number. To set a true time and -frequency axis, set the sample rate (-R or --sample-rate) to the -sample rate used when capturing the samples. diff --git a/gr-utils/python/utils/gr_plot b/gr-utils/python/utils/gr_plot deleted file mode 100755 index 82fe846dc2..0000000000 --- a/gr-utils/python/utils/gr_plot +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2007,2008 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# - -from __future__ import print_function - -from gnuradio.plot_data import plot_data - - -def main(): - parser = plot_data.setup_options() - args = parser.parse_args() - plot_data(None, args.files, args) - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - pass - diff --git a/gr-utils/python/utils/gr_plot_const b/gr-utils/python/utils/gr_plot_const deleted file mode 100755 index 808fb7d1ad..0000000000 --- a/gr-utils/python/utils/gr_plot_const +++ /dev/null @@ -1,230 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2007,2008,2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# - -from __future__ import print_function - -import numpy - -try: - from pylab import * - from matplotlib.font_manager import fontManager, FontProperties -except ImportError: - print("Please install Python Matplotlib (http://matplotlib.sourceforge.net/) and \ - Python TkInter https://wiki.python.org/moin/TkInter to run this script") - raise SystemExit(1) - -from argparse import ArgumentParser - -class draw_constellation: - def __init__(self, filename, options): - self.hfile = open(filename, "r") - self.block_length = options.block - self.start = options.start - self.sample_rate = options.sample_rate - - self.datatype = numpy.complex64 - self.sizeof_data = self.datatype().nbytes # number of bytes per sample in file - - self.axis_font_size = 16 - self.label_font_size = 18 - self.title_font_size = 20 - - # Setup PLOT - self.fig = figure(1, figsize=(16, 9), facecolor='w') - rcParams['xtick.labelsize'] = self.axis_font_size - rcParams['ytick.labelsize'] = self.axis_font_size - - self.text_file = figtext(0.10, 0.95, ("File: %s" % filename), weight="heavy", size=16) - self.text_file_pos = figtext(0.10, 0.90, "File Position: ", weight="heavy", size=16) - self.text_block = figtext(0.40, 0.90, ("Block Size: %d" % self.block_length), - weight="heavy", size=16) - self.text_sr = figtext(0.60, 0.90, ("Sample Rate: %.2f" % self.sample_rate), - weight="heavy", size=16) - self.make_plots() - - self.button_left_axes = self.fig.add_axes([0.45, 0.01, 0.05, 0.05], frameon=True) - self.button_left = Button(self.button_left_axes, "<") - self.button_left_callback = self.button_left.on_clicked(self.button_left_click) - - self.button_right_axes = self.fig.add_axes([0.50, 0.01, 0.05, 0.05], frameon=True) - self.button_right = Button(self.button_right_axes, ">") - self.button_right_callback = self.button_right.on_clicked(self.button_right_click) - - self.xlim = self.sp_iq.get_xlim() - - self.manager = get_current_fig_manager() - connect('draw_event', self.zoom) - connect('key_press_event', self.click) - connect('button_press_event', self.mouse_button_callback) - show() - - def get_data(self): - self.text_file_pos.set_text("File Position: %d" % (self.hfile.tell()//self.sizeof_data)) - try: - iq = numpy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length) - except MemoryError: - print("End of File") - else: - # retesting length here as newer version of numpy does not throw a MemoryError, just - # returns a zero-length array - if(len(iq) > 0): - self.reals = numpy.array([r.real for r in iq]) - self.imags = numpy.array([i.imag for i in iq]) - - self.time = numpy.array([i*(1/self.sample_rate) for i in range(len(self.reals))]) - return True - else: - print("End of File") - return False - - def make_plots(self): - # if specified on the command-line, set file pointer - self.hfile.seek(self.sizeof_data*self.start, 1) - - r = self.get_data() - - # Subplot for real and imaginary parts of signal - self.sp_iq = self.fig.add_subplot(2,1,1, position=[0.075, 0.2, 0.4, 0.6]) - self.sp_iq.set_title(("I&Q"), fontsize=self.title_font_size, fontweight="bold") - self.sp_iq.set_xlabel("Time (s)", fontsize=self.label_font_size, fontweight="bold") - self.sp_iq.set_ylabel("Amplitude (V)", fontsize=self.label_font_size, fontweight="bold") - self.plot_iq = self.sp_iq.plot(self.time, self.reals, 'bo-', self.time, self.imags, 'ro-') - - # Subplot for constellation plot - self.sp_const = self.fig.add_subplot(2,2,1, position=[0.575, 0.2, 0.4, 0.6]) - self.sp_const.set_title(("Constellation"), fontsize=self.title_font_size, fontweight="bold") - self.sp_const.set_xlabel("Inphase", fontsize=self.label_font_size, fontweight="bold") - self.sp_const.set_ylabel("Quadrature", fontsize=self.label_font_size, fontweight="bold") - self.plot_const = self.sp_const.plot(self.reals, self.imags, 'bo') - - # Add plots to mark current location of point between time and constellation plots - self.indx = 0 - self.plot_iq += self.sp_iq.plot([self.time[self.indx],], [self.reals[self.indx],], 'mo', ms=8) - self.plot_iq += self.sp_iq.plot([self.time[self.indx],], [self.imags[self.indx],], 'mo', ms=8) - self.plot_const += self.sp_const.plot([self.reals[self.indx],], [self.imags[self.indx],], 'mo', ms=12) - - # Adjust axis - self.sp_iq.axis([self.time.min(), self.time.max(), - 1.5*min([self.reals.min(), self.imags.min()]), - 1.5*max([self.reals.max(), self.imags.max()])]) - self.sp_const.axis([-2, 2, -2, 2]) - - draw() - - def update_plots(self): - self.plot_iq[0].set_data([self.time, self.reals]) - self.plot_iq[1].set_data([self.time, self.imags]) - self.sp_iq.axis([self.time.min(), self.time.max(), - 1.5*min([self.reals.min(), self.imags.min()]), - 1.5*max([self.reals.max(), self.imags.max()])]) - - self.plot_const[0].set_data([self.reals, self.imags]) - self.sp_const.axis([-2, 2, -2, 2]) - draw() - - def zoom(self, event): - newxlim = numpy.array(self.sp_iq.get_xlim()) - curxlim = numpy.array(self.xlim) - if(newxlim[0] != curxlim[0] or newxlim[1] != curxlim[1]): - self.xlim = newxlim - r = self.reals[int(ceil(self.xlim[0])) : int(ceil(self.xlim[1]))] - i = self.imags[int(ceil(self.xlim[0])) : int(ceil(self.xlim[1]))] - - self.plot_const[0].set_data(r, i) - self.sp_const.axis([-2, 2, -2, 2]) - self.manager.canvas.draw() - draw() - - def click(self, event): - forward_valid_keys = [" ", "down", "right"] - backward_valid_keys = ["up", "left"] - trace_forward_valid_keys = [">",] - trace_backward_valid_keys = ["<",] - - if(find(event.key, forward_valid_keys)): - self.step_forward() - - elif(find(event.key, backward_valid_keys)): - self.step_backward() - - elif(find(event.key, trace_forward_valid_keys)): - self.indx = min(self.indx+1, len(self.time)-1) - self.set_trace(self.indx) - - elif(find(event.key, trace_backward_valid_keys)): - self.indx = max(0, self.indx-1) - self.set_trace(self.indx) - - def button_left_click(self, event): - self.step_backward() - - def button_right_click(self, event): - self.step_forward() - - def step_forward(self): - r = self.get_data() - if(r): - self.update_plots() - - def step_backward(self): - # Step back in file position - if(self.hfile.tell() >= 2*self.sizeof_data*self.block_length ): - self.hfile.seek(-2*self.sizeof_data*self.block_length, 1) - else: - self.hfile.seek(-self.hfile.tell(),1) - r = self.get_data() - if(r): - self.update_plots() - - - def mouse_button_callback(self, event): - x, y = event.xdata, event.ydata - - if x is not None and y is not None: - if(event.inaxes == self.sp_iq): - self.indx = searchsorted(self.time, [x]) - self.set_trace(self.indx) - - - def set_trace(self, indx): - self.plot_iq[2].set_data(self.time[indx], self.reals[indx]) - self.plot_iq[3].set_data(self.time[indx], self.imags[indx]) - self.plot_const[1].set_data(self.reals[indx], self.imags[indx]) - draw() - - -def find(item_in, list_search): - try: - return list_search.index(item_in) != None - except ValueError: - return False - - -def main(): - description = "Takes a GNU Radio complex binary file and displays the I&Q data versus time and the constellation plot (I vs. Q). You can set the block size to specify how many points to read in at a time and the start position in the file. By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples." - - parser = ArgumentParser(conflict_handler="resolve", description=description) - parser.add_argument("-B", "--block", type=int, default=1000, - help="Specify the block size [default=%(default)r]") - parser.add_argument("-s", "--start", type=int, default=0, - help="Specify where to start in the file [default=%(default)r]") - parser.add_argument("-R", "--sample-rate", type=float, default=1.0, - help="Set the sampler rate of the data [default=%(default)r]") - parser.add_argument("file", metavar="FILE", - help="Input file with complex samples") - args = parser.parse_args() - - dc = draw_constellation(args.file, args) - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - pass diff --git a/gr-utils/python/utils/gr_plot_fft b/gr-utils/python/utils/gr_plot_fft deleted file mode 100755 index 9851c08007..0000000000 --- a/gr-utils/python/utils/gr_plot_fft +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# - -from gnuradio.plot_fft_base import plot_fft_base - -# This is a wrapper program for plot_fft_base. It handles any data -# type and defaults to complex64. - -def main(): - parser = plot_fft_base.setup_options() - args = parser.parse_args() - - plot_fft_base(None, args.file, args) - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - pass diff --git a/gr-utils/python/utils/gr_plot_iq b/gr-utils/python/utils/gr_plot_iq deleted file mode 100755 index 2b86159d7e..0000000000 --- a/gr-utils/python/utils/gr_plot_iq +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2007,2008,2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# - -from __future__ import print_function - -import numpy - -try: - from pylab import * -except ImportError: - print("Please install Python Matplotlib (http://matplotlib.sourceforge.net/) and \ - Python TkInter https://wiki.python.org/moin/TkInter to run this script") - raise SystemExit(1) - -from argparse import ArgumentParser - -class draw_iq: - def __init__(self, filename, options): - self.hfile = open(filename, "r") - self.block_length = options.block - self.start = options.start - self.sample_rate = options.sample_rate - - self.datatype = numpy.complex64 - self.sizeof_data = self.datatype().nbytes # number of bytes per sample in file - - self.axis_font_size = 16 - self.label_font_size = 18 - self.title_font_size = 20 - self.text_size = 22 - - # Setup PLOT - self.fig = figure(1, figsize=(16, 9), facecolor='w') - rcParams['xtick.labelsize'] = self.axis_font_size - rcParams['ytick.labelsize'] = self.axis_font_size - - self.text_file = figtext(0.10, 0.94, ("File: %s" % filename), weight="heavy", size=self.text_size) - self.text_file_pos = figtext(0.10, 0.88, "File Position: ", weight="heavy", size=self.text_size) - self.text_block = figtext(0.40, 0.88, ("Block Size: %d" % self.block_length), - weight="heavy", size=self.text_size) - self.text_sr = figtext(0.60, 0.88, ("Sample Rate: %.2f" % self.sample_rate), - weight="heavy", size=self.text_size) - self.make_plots() - - self.button_left_axes = self.fig.add_axes([0.45, 0.01, 0.05, 0.05], frameon=True) - self.button_left = Button(self.button_left_axes, "<") - self.button_left_callback = self.button_left.on_clicked(self.button_left_click) - - self.button_right_axes = self.fig.add_axes([0.50, 0.01, 0.05, 0.05], frameon=True) - self.button_right = Button(self.button_right_axes, ">") - self.button_right_callback = self.button_right.on_clicked(self.button_right_click) - - self.xlim = self.sp_iq.get_xlim() - - self.manager = get_current_fig_manager() - connect('key_press_event', self.click) - show() - - def get_data(self): - self.text_file_pos.set_text("File Position: %d" % (self.hfile.tell()//self.sizeof_data)) - try: - self.iq = numpy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length) - except MemoryError: - print("End of File") - else: - self.reals = numpy.array([r.real for r in self.iq]) - self.imags = numpy.array([i.imag for i in self.iq]) - self.time = numpy.array([i*(1/self.sample_rate) for i in range(len(self.reals))]) - - def make_plots(self): - # if specified on the command-line, set file pointer - self.hfile.seek(self.sizeof_data*self.start, 1) - - self.get_data() - - # Subplot for real and imaginary parts of signal - self.sp_iq = self.fig.add_subplot(2,1,1, position=[0.075, 0.14, 0.85, 0.67]) - self.sp_iq.set_title(("I&Q"), fontsize=self.title_font_size, fontweight="bold") - self.sp_iq.set_xlabel("Time (s)", fontsize=self.label_font_size, fontweight="bold") - self.sp_iq.set_ylabel("Amplitude (V)", fontsize=self.label_font_size, fontweight="bold") - self.plot_iq = plot(self.time, self.reals, 'bo-', self.time, self.imags, 'ro-') - self.sp_iq.set_ylim([1.5*min([self.reals.min(), self.imags.min()]), - 1.5*max([self.reals.max(), self.imags.max()])]) - self.sp_iq.set_xlim(self.time.min(), self.time.max()) - draw() - - def update_plots(self): - self.plot_iq[0].set_data([self.time, self.reals]) - self.plot_iq[1].set_data([self.time, self.imags]) - self.sp_iq.set_ylim([1.5*min([self.reals.min(), self.imags.min()]), - 1.5*max([self.reals.max(), self.imags.max()])]) - self.sp_iq.set_xlim(self.time.min(), self.time.max()) - draw() - - def click(self, event): - forward_valid_keys = [" ", "down", "right"] - backward_valid_keys = ["up", "left"] - - if(find(event.key, forward_valid_keys)): - self.step_forward() - - elif(find(event.key, backward_valid_keys)): - self.step_backward() - - def button_left_click(self, event): - self.step_backward() - - def button_right_click(self, event): - self.step_forward() - - def step_forward(self): - self.get_data() - self.update_plots() - - def step_backward(self): - # Step back in file position - if(self.hfile.tell() >= 2*self.sizeof_data*self.block_length ): - self.hfile.seek(-2*self.sizeof_data*self.block_length, 1) - else: - self.hfile.seek(-self.hfile.tell(),1) - self.get_data() - self.update_plots() - - -def find(item_in, list_search): - try: - return list_search.index(item_in) != None - except ValueError: - return False - -def main(): - description = "Takes a GNU Radio complex binary file and displays the I&Q data versus time. You can set the block size to specify how many points to read in at a time and the start position in the file. By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples." - - parser = ArgumentParser(conflict_handler="resolve", description=description) - parser.add_argument("-B", "--block", type=int, default=1000, - help="Specify the block size [default=%(default)r]") - parser.add_argument("-s", "--start", type=int, default=0, - help="Specify where to start in the file [default=%(default)r]") - parser.add_argument("-R", "--sample-rate", type=float, default=1.0, - help="Set the sampler rate of the data [default=%(default)r]") - parser.add_argument("file", metavar="FILE", - help="Input file with complex samples") - - args = parser.parse_args() - - dc = draw_iq(args.file, args) - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - pass diff --git a/gr-utils/python/utils/gr_plot_psd b/gr-utils/python/utils/gr_plot_psd deleted file mode 100755 index 9576eeac9b..0000000000 --- a/gr-utils/python/utils/gr_plot_psd +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# - -from gnuradio.plot_psd_base import plot_psd_base - -# This is a wrapper program for plot_psd_base. It handles any data -# type and defaults to complex64. - -def main(): - parser = plot_psd_base.setup_options() - args = parser.parse_args() - - plot_psd_base(None, args.file, args) - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - pass diff --git a/gr-utils/python/utils/gr_plot_qt b/gr-utils/python/utils/gr_plot_qt deleted file mode 100755 index 5b9f9cf90a..0000000000 --- a/gr-utils/python/utils/gr_plot_qt +++ /dev/null @@ -1,724 +0,0 @@ -#!/usr/bin/env python -import numpy - -try: - from matplotlib import mlab -except ImportError: - print("Please install Python Matplotlib (http://matplotlib.sourceforge.net/) and \ - Python TkInter https://wiki.python.org/moin/TkInter to run this script") - raise SystemExit(1) - -try: - from PyQt4 import Qt, QtCore, QtGui -except ImportError: - print("Please install PyQt4 to run this script (http://www.riverbankcomputing.co.uk/software/pyqt/download)") - raise SystemExit(1) - -try: - import PyQt4.Qwt5 as Qwt -except ImportError: - print("Please install PyQwt5 to run this script (http://pyqwt.sourceforge.net/)") - raise SystemExit(1) - -try: - # FIXME: re-enable this before committing - #from gnuradio.pyqt_plot import Ui_MainWindow - from gnuradio.pyqt_plot import Ui_MainWindow -except ImportError: - print("Could not import from pyqt_plot. Please build with \"pyuic4 pyqt_plot.ui -o pyqt_plot.py\"") - raise SystemExit(1) - -import sys, os -from optparse import OptionParser -from gnuradio import eng_notation - - -class SpectrogramData(Qwt.QwtRasterData): - - def __init__(self, f, t): - Qwt.QwtArrayData.__init__(self, Qt.QRectF(0, 0, 0, 0)) - self.sp = numpy.array([[0], [0]]) - - def set_data(self, xfreq, ytime, data): - self.sp = data - self.freq = xfreq - self.time = ytime - boundingBox = Qt.QRectF(self.freq.min(), self.time.min(), - self.freq.max() - self.freq.min(), - self.time.max() - self.time.min()) - self.setBoundingRect(boundingBox) - - def rasterHint(self, rect): - return Qt.QSize(self.sp.shape[0], self.sp.shape[1]) - - def copy(self): - return self - - def range(self): - - return Qwt.QwtDoubleInterval(self.sp.min(), self.sp.max()) - - def value(self, x, y): - try: - f = int(self.freq.searchsorted(x)) - t = int(self.time.searchsorted(y)) - return self.sp[f][t-1] - except AttributeError: # if no file loaded yet - return 0 - - -class gr_plot_qt(QtGui.QMainWindow): - def __init__(self, qapp, filename, options, parent=None): - QtGui.QWidget.__init__(self, parent) - self.gui = Ui_MainWindow() - self.gui.setupUi(self) - - self.filename = None - self.block_length = options.block_length - self.start = options.start - self.sample_rate = options.sample_rate - self.psdfftsize = options.psd_size - self.specfftsize = options.spec_size - self.winfunc = numpy.blackman - self.sizeof_data = 8 - self.datatype = numpy.complex64 - self.pen_width = 1 - self.iq = list() - self.time = list() - - # Set up basic plot attributes - self.gui.timePlot.setAxisTitle(self.gui.timePlot.xBottom, "Time (sec)") - self.gui.timePlot.setAxisTitle(self.gui.timePlot.yLeft, "Amplitude (V)") - self.gui.freqPlot.setAxisTitle(self.gui.freqPlot.xBottom, "Frequency (Hz)") - self.gui.freqPlot.setAxisTitle(self.gui.freqPlot.yLeft, "Magnitude (dB)") - self.gui.specPlot.setAxisTitle(self.gui.specPlot.xBottom, "Frequency (Hz)") - self.gui.specPlot.setAxisTitle(self.gui.specPlot.yLeft, "Time (sec)") - - # Set up FFT size combo box - self.fftsizes = ["128", "256", "512", "1024", "2048", - "4096", "8192", "16384", "32768"] - self.gui.psdFFTComboBox.addItems(self.fftsizes) - self.gui.specFFTComboBox.addItems(self.fftsizes) - pos = self.gui.psdFFTComboBox.findText(Qt.QString("%1").arg(self.psdfftsize)) - self.gui.psdFFTComboBox.setCurrentIndex(pos) - pos = self.gui.specFFTComboBox.findText(Qt.QString("%1").arg(self.specfftsize)) - self.gui.specFFTComboBox.setCurrentIndex(pos) - - self.connect(self.gui.psdFFTComboBox, - Qt.SIGNAL("activated (const QString&)"), - self.psdFFTComboBoxEdit) - self.connect(self.gui.specFFTComboBox, - Qt.SIGNAL("activated (const QString&)"), - self.specFFTComboBoxEdit) - - # Set up color scheme box - self.color_modes = {"Black on White" : self.color_black_on_white, - "White on Black" : self.color_white_on_black, - "Blue on Black" : self.color_blue_on_black, - "Green on Black" : self.color_green_on_black} - self.gui.colorComboBox.addItems(self.color_modes.keys()) - pos = self.gui.colorComboBox.findText("Blue on Black") - self.gui.colorComboBox.setCurrentIndex(pos) - self.connect(self.gui.colorComboBox, - Qt.SIGNAL("activated (const QString&)"), - self.colorComboBoxEdit) - - - # Set up line style combo box - self.line_styles = {"None" : Qwt.QwtSymbol.NoSymbol, - "Circle" : Qwt.QwtSymbol.Ellipse, - "Diamond" : Qwt.QwtSymbol.Rect, - "Triangle" : Qwt.QwtSymbol.Triangle} - self.gui.lineStyleComboBox.addItems(self.line_styles.keys()) - pos = self.gui.lineStyleComboBox.findText("None") - self.gui.lineStyleComboBox.setCurrentIndex(pos) - self.connect(self.gui.lineStyleComboBox, - Qt.SIGNAL("activated (const QString&)"), - self.lineStyleComboBoxEdit) - - # Create zoom functionality for the plots - self.timeZoomer = Qwt.QwtPlotZoomer(self.gui.timePlot.xBottom, - self.gui.timePlot.yLeft, - Qwt.QwtPicker.PointSelection, - Qwt.QwtPicker.AlwaysOn, - self.gui.timePlot.canvas()) - - self.freqZoomer = Qwt.QwtPlotZoomer(self.gui.freqPlot.xBottom, - self.gui.freqPlot.yLeft, - Qwt.QwtPicker.PointSelection, - Qwt.QwtPicker.AlwaysOn, - self.gui.freqPlot.canvas()) - - self.specZoomer = Qwt.QwtPlotZoomer(self.gui.specPlot.xBottom, - self.gui.specPlot.yLeft, - Qwt.QwtPicker.PointSelection, - Qwt.QwtPicker.AlwaysOn, - self.gui.specPlot.canvas()) - - # Set up action when tab is changed - self.connect(self.gui.tabGroup, - Qt.SIGNAL("currentChanged (int)"), - self.tabChanged) - - # Add a legend to the Time plot - legend_real = Qwt.QwtLegend() - self.gui.timePlot.insertLegend(legend_real) - - # Set up slider - self.gui.plotHBar.setSingleStep(1) - self.gui.plotHBar.setPageStep(self.block_length) - self.gui.plotHBar.setMinimum(0) - self.gui.plotHBar.setMaximum(self.block_length) - self.connect(self.gui.plotHBar, - Qt.SIGNAL("valueChanged(int)"), - self.sliderMoved) - - # Connect Open action to Open Dialog box - self.connect(self.gui.action_open, - Qt.SIGNAL("activated()"), - self.open_file) - - # Connect Reload action to reload the file - self.connect(self.gui.action_reload, - Qt.SIGNAL("activated()"), - self.reload_file) - self.gui.action_reload.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+R", - None, QtGui.QApplication.UnicodeUTF8)) - - # Set up file position boxes to update current figure - self.connect(self.gui.filePosStartLineEdit, - Qt.SIGNAL("editingFinished()"), - self.file_position_changed) - self.connect(self.gui.filePosStopLineEdit, - Qt.SIGNAL("editingFinished()"), - self.file_position_changed) - self.connect(self.gui.filePosLengthLineEdit, - Qt.SIGNAL("editingFinished()"), - self.file_length_changed) - - self.connect(self.gui.fileTimeStartLineEdit, - Qt.SIGNAL("editingFinished()"), - self.file_time_changed) - self.connect(self.gui.fileTimeStopLineEdit, - Qt.SIGNAL("editingFinished()"), - self.file_time_changed) - self.connect(self.gui.fileTimeLengthLineEdit, - Qt.SIGNAL("editingFinished()"), - self.file_time_length_changed) - - stylestr = str(self.gui.lineStyleComboBox.currentText().toAscii()) - style = self.line_styles[stylestr] - - self.rcurve = Qwt.QwtPlotCurve("Real") - self.icurve = Qwt.QwtPlotCurve("Imaginary") - self.rsym = Qwt.QwtSymbol() - self.rsym.setStyle(style) - self.rsym.setSize(10) - self.isym = Qwt.QwtSymbol() - self.isym.setStyle(style) - self.isym.setSize(10) - self.rcurve.setSymbol(self.rsym) - self.icurve.setSymbol(self.isym) - - - self.icurve.attach(self.gui.timePlot) - self.rcurve.attach(self.gui.timePlot) - - self.psdcurve = Qwt.QwtPlotCurve("PSD") - self.psdcurve.attach(self.gui.freqPlot) - - # Set up specTab plot as a spectrogram - self.specdata = SpectrogramData(range(0, 10), range(0, 10)) - - colorMap = Qwt.QwtLinearColorMap(Qt.Qt.darkCyan, Qt.Qt.red) - colorMap.addColorStop(0.1, Qt.Qt.cyan) - colorMap.addColorStop(0.6, Qt.Qt.green) - colorMap.addColorStop(0.95, Qt.Qt.yellow) - - self.spec = Qwt.QwtPlotSpectrogram() - self.spec.setColorMap(colorMap) - self.spec.attach(self.gui.specPlot) - self.spec.setDisplayMode(Qwt.QwtPlotSpectrogram.ImageMode, True) - self.spec.setData(self.specdata) - - self.rightAxis = self.gui.specPlot.axisWidget(Qwt.QwtPlot.yRight) - self.rightAxis.setTitle("Magnitude (dBm)") - self.rightAxis.setColorBarEnabled(True) - self.rightAxis.setColorMap(self.spec.data().range(), - self.spec.colorMap()) - self.gui.specPlot.enableAxis(Qwt.QwtPlot.yRight) - - # Set up initial color scheme - self.color_modes["Blue on Black"]() - - # When line width spin box changes, update the pen size - self.connect(self.gui.lineWidthSpinBox, - Qt.SIGNAL("valueChanged(int)"), - self.change_pen_width) - self.gui.lineWidthSpinBox.setRange(1, 10) - - # When style size spin box changes, update the pen size - self.connect(self.gui.styleSizeSpinBox, - Qt.SIGNAL("valueChanged(int)"), - self.change_style_size) - self.gui.styleSizeSpinBox.setRange(1, 20) - self.gui.styleSizeSpinBox.setValue(5) - - - # Connect a signal for when the sample rate changes - self.set_sample_rate(self.sample_rate) - self.connect(self.gui.sampleRateLineEdit, - Qt.SIGNAL("editingFinished()"), - self.sample_rate_changed) - - if(filename is not None): - self.initialize(filename) - - self.show() - - def open_file(self): - filename = Qt.QFileDialog.getOpenFileName(self, "Open", ".") - if(filename != ""): - #print(filename) - self.initialize(filename) - - def reload_file(self): - if(self.filename): - self.initialize(self.filename) - - def initialize(self, filename): - self.filename = filename - self.hfile = open(filename, "r") - - self.setWindowTitle(("GNU Radio File Plot Utility: %s" % filename)) - - self.gui.filePosStartLineEdit.setText("0") - self.gui.filePosStopLineEdit.setText("0") - self.gui.fileTimeStartLineEdit.setText("0") - self.gui.fileTimeStopLineEdit.setText("0") - - self.cur_start = 0 - self.cur_stop = self.block_length - - self.init_data_input() - self.get_data(self.cur_start, self.cur_stop) - self.get_psd() - self.get_specgram() - self.gui.plotHBar.setSliderPosition(0) - self.gui.plotHBar.setMaximum(self.signal_size-self.block_length) - - - self.update_time_curves() - self.update_psd_curves() - self.update_specgram_curves() - - def init_data_input(self): - self.hfile.seek(0, os.SEEK_END) - self.signal_size = self.hfile.tell()/self.sizeof_data - #print("Sizeof File: ", self.signal_size) - self.hfile.seek(0, os.SEEK_SET) - - def get_data(self, start, end): - if(end > start): - self.hfile.seek(start*self.sizeof_data, os.SEEK_SET) - self.position = start - try: - iq = numpy.fromfile(self.hfile, dtype=self.datatype, - count=end-start) - - if(len(iq) < (end-start)): - end = start + len(iq) - self.gui.filePosLengthLineEdit.setText(Qt.QString("%1").arg(len(iq))) - self.file_length_changed() - - tstep = 1.0 / self.sample_rate - self.iq = iq - self.time = [tstep*(self.position + i) for i in range(len(self.iq))] - - self.set_file_pos_box(start, end) - except MemoryError: - pass - else: - # Do we want to do anything about this? - pass - - def get_psd(self): - winpoints = self.winfunc(self.psdfftsize) - iq_psd, freq = mlab.psd(self.iq, Fs=self.sample_rate, - NFFT=self.psdfftsize, - noverlap=self.psdfftsize/4.0, - window=winpoints, - scale_by_freq=False) - - self.iq_psd = 10.0*numpy.log10(abs(numpy.fft.fftshift(iq_psd))) - self.freq = freq - self.sample_rate/2.0 - - def get_specgram(self): - winpoints = self.winfunc(self.specfftsize) - iq_spec, f, t = mlab.specgram(self.iq, Fs=self.sample_rate, - NFFT=self.specfftsize, - noverlap=self.specfftsize/4.0, - window=winpoints, - scale_by_freq=False) - - self.iq_spec = 10.0*numpy.log10(abs(iq_spec)) - self.spec_f = f - self.spec_t = t - - def psdFFTComboBoxEdit(self, fftSize): - self.psdfftsize = fftSize.toInt()[0] - self.get_psd() - self.update_psd_curves() - - def specFFTComboBoxEdit(self, fftSize): - self.specfftsize = fftSize.toInt()[0] - self.get_specgram() - self.update_specgram_curves() - - def colorComboBoxEdit(self, colorSelection): - colorstr = str(colorSelection.toAscii()) - color_func = self.color_modes[colorstr] - color_func() - - def lineStyleComboBoxEdit(self, styleSelection): - stylestr = str(styleSelection.toAscii()) - self.rsym.setStyle(self.line_styles[stylestr]) - self.isym.setStyle(self.line_styles[stylestr]) - self.rcurve.setSymbol(self.rsym) - self.icurve.setSymbol(self.isym) - self.gui.timePlot.replot() - - def sliderMoved(self, value): - pos_start = value - pos_end = value + self.gui.plotHBar.pageStep() - - self.get_data(pos_start, pos_end) - self.get_psd() - self.get_specgram() - self.update_time_curves() - self.update_psd_curves() - self.update_specgram_curves() - - def set_sample_rate(self, sr): - self.sample_rate = sr - srstr = eng_notation.num_to_str(self.sample_rate) - self.gui.sampleRateLineEdit.setText(Qt.QString("%1").arg(srstr)) - - def sample_rate_changed(self): - srstr = self.gui.sampleRateLineEdit.text().toAscii() - self.sample_rate = eng_notation.str_to_num(srstr) - self.set_file_pos_box(self.cur_start, self.cur_stop) - self.get_data(self.cur_start, self.cur_stop) - self.get_psd() - self.get_specgram() - self.update_time_curves() - self.update_psd_curves() - self.update_specgram_curves() - - def set_file_pos_box(self, start, end): - tstart = start / self.sample_rate - tend = end / self.sample_rate - - self.gui.filePosStartLineEdit.setText(Qt.QString("%1").arg(start)) - self.gui.filePosStopLineEdit.setText(Qt.QString("%1").arg(end)) - self.gui.filePosLengthLineEdit.setText(Qt.QString("%1").arg(end-start)) - - self.gui.fileTimeStartLineEdit.setText(Qt.QString("%1").arg(tstart)) - self.gui.fileTimeStopLineEdit.setText(Qt.QString("%1").arg(tend)) - self.gui.fileTimeLengthLineEdit.setText(Qt.QString("%1").arg(tend-tstart)) - - def file_position_changed(self): - start = self.gui.filePosStartLineEdit.text().toInt() - end = self.gui.filePosStopLineEdit.text().toInt() - if((start[1] == True) and (end[1] == True)): - self.cur_start = start[0] - self.cur_stop = end[0] - - tstart = self.cur_start / self.sample_rate - tend = self.cur_stop / self.sample_rate - self.gui.fileTimeStartLineEdit.setText(Qt.QString("%1").arg(tstart)) - self.gui.fileTimeStopLineEdit.setText(Qt.QString("%1").arg(tend)) - - self.get_data(self.cur_start, self.cur_stop) - - self.update_time_curves() - self.update_psd_curves() - self.update_specgram_curves() - - # If there's a non-digit character, reset box - else: - try: - self.set_file_pos_box(self.cur_start, self.cur_stop) - except AttributeError: - pass - - - def file_time_changed(self): - tstart = self.gui.fileTimeStartLineEdit.text().toDouble() - tstop = self.gui.fileTimeStopLineEdit.text().toDouble() - if((tstart[1] == True) and (tstop[1] == True)): - self.cur_start = int(tstart[0] * self.sample_rate) - self.cur_stop = int(tstop[0] * self.sample_rate) - self.get_data(self.cur_start, self.cur_stop) - - self.gui.filePosStartLineEdit.setText(Qt.QString("%1").arg(self.cur_start)) - self.gui.filePosStopLineEdit.setText(Qt.QString("%1").arg(self.cur_stop)) - - self.update_time_curves() - self.update_psd_curves() - self.update_specgram_curves() - # If there's a non-digit character, reset box - else: - self.set_file_pos_box(self.cur_start, self.cur_stop) - - def file_length_changed(self): - start = self.gui.filePosStartLineEdit.text().toInt() - length = self.gui.filePosLengthLineEdit.text().toInt() - - if((start[1] == True) and (length[1] == True)): - self.cur_start = start[0] - self.block_length = length[0] - self.cur_stop = self.cur_start + self.block_length - - tstart = self.cur_start / self.sample_rate - tend = self.cur_stop / self.sample_rate - tlen = self.block_length / self.sample_rate - self.gui.fileTimeStartLineEdit.setText(Qt.QString("%1").arg(tstart)) - self.gui.fileTimeStopLineEdit.setText(Qt.QString("%1").arg(tend)) - self.gui.fileTimeLengthLineEdit.setText(Qt.QString("%1").arg(tlen)) - - self.gui.plotHBar.setPageStep(self.block_length) - - self.get_data(self.cur_start, self.cur_stop) - self.get_psd() - self.get_specgram() - - self.update_time_curves() - self.update_psd_curves() - self.update_specgram_curves() - # If there's a non-digit character, reset box - else: - self.set_file_pos_box(self.cur_start, self.cur_stop) - - def file_time_length_changed(self): - tstart = self.gui.fileTimeStartLineEdit.text().toDouble() - tlength = self.gui.fileTimeLengthLineEdit.text().toDouble() - if((tstart[1] == True) and (tlength[1] == True)): - self.cur_start = int(tstart[0] * self.sample_rate) - self.block_length = int(tlength[0] * self.sample_rate) - self.cur_stop = self.cur_start + self.block_length - - tstart = self.cur_start / self.sample_rate - tend = self.cur_stop / self.sample_rate - tlen = self.block_length / self.sample_rate - self.gui.fileTimeStartLineEdit.setText(Qt.QString("%1").arg(tstart)) - self.gui.fileTimeStopLineEdit.setText(Qt.QString("%1").arg(tend)) - self.gui.fileTimeLengthLineEdit.setText(Qt.QString("%1").arg(tlen)) - - self.get_data(self.cur_start, self.cur_stop) - self.get_psd() - self.get_specgram() - - self.update_time_curves() - self.update_psd_curves() - self.update_specgram_curves() - # If there's a non-digit character, reset box - else: - self.set_file_pos_box(self.cur_start, self.cur_stop) - - - def update_time_curves(self): - self.icurve.setData(self.time, self.iq.imag) - self.rcurve.setData(self.time, self.iq.real) - - # Reset the x-axis to the new time scale - iqmax = 1.5 * max(max(self.iq.real), max(self.iq.imag)) - iqmin = 1.5 * min(min(self.iq.real), min(self.iq.imag)) - self.gui.timePlot.setAxisScale(self.gui.timePlot.xBottom, - min(self.time), - max(self.time)) - self.gui.timePlot.setAxisScale(self.gui.timePlot.yLeft, - iqmin, - iqmax) - - # Set the zoomer base to unzoom to the new axis - self.timeZoomer.setZoomBase() - - self.gui.timePlot.replot() - - def update_psd_curves(self): - self.psdcurve.setData(self.freq, self.iq_psd) - - self.gui.freqPlot.setAxisScale(self.gui.freqPlot.xBottom, - min(self.freq), - max(self.freq)) - - # Set the zoomer base to unzoom to the new axis - self.freqZoomer.setZoomBase() - - self.gui.freqPlot.replot() - - def update_specgram_curves(self): - # We don't have to reset the data for the speccurve here - # since this is taken care of in the SpectrogramData class - self.specdata.set_data(self.spec_f, self.spec_t, self.iq_spec) - - # Set the color map based on the new data - self.rightAxis.setColorMap(self.spec.data().range(), - self.spec.colorMap()) - - # Set the new axis base; include right axis for the intenisty color bar - self.gui.specPlot.setAxisScale(self.gui.specPlot.xBottom, - min(self.spec_f), - max(self.spec_f)) - self.gui.specPlot.setAxisScale(self.gui.specPlot.yLeft, - min(self.spec_t), - max(self.spec_t)) - self.gui.specPlot.setAxisScale(self.gui.specPlot.yRight, - self.iq_spec.min(), - self.iq_spec.max()) - - # Set the zoomer base to unzoom to the new axis - self.specZoomer.setZoomBase() - - self.gui.specPlot.replot() - - def tabChanged(self, index): - self.gui.timePlot.replot() - self.gui.freqPlot.replot() - self.gui.specPlot.replot() - - def change_pen_width(self, width): - self.pen_width = width - colormode = str(self.gui.colorComboBox.currentText().toAscii()) - color_func = self.color_modes[colormode]() - - def change_style_size(self, size): - self.rsym.setSize(size) - self.isym.setSize(size) - self.rcurve.setSymbol(self.rsym) - self.icurve.setSymbol(self.isym) - self.gui.timePlot.replot() - - def color_black_on_white(self): - blue = QtGui.qRgb(0x00, 0x00, 0xFF) - red = QtGui.qRgb(0xFF, 0x00, 0x00) - - blackPen = Qt.QPen(Qt.QBrush(Qt.QColor("black")), self.pen_width) - bluePen = Qt.QPen(Qt.QBrush(Qt.QColor(blue)), self.pen_width) - redPen = Qt.QPen(Qt.QBrush(Qt.QColor(red)), self.pen_width) - - self.gui.timePlot.setCanvasBackground(Qt.QColor("white")) - self.gui.freqPlot.setCanvasBackground(Qt.QColor("white")) - self.timeZoomer.setTrackerPen(blackPen) - self.timeZoomer.setRubberBandPen(blackPen) - self.freqZoomer.setTrackerPen(blackPen) - self.freqZoomer.setRubberBandPen(blackPen) - self.psdcurve.setPen(bluePen) - self.rcurve.setPen(bluePen) - self.icurve.setPen(redPen) - - self.rsym.setPen(bluePen) - self.isym.setPen(redPen) - - self.gui.timePlot.replot() - self.gui.freqPlot.replot() - - def color_white_on_black(self): - white = QtGui.qRgb(0xFF, 0xFF, 0xFF) - red = QtGui.qRgb(0xFF, 0x00, 0x00) - - whiteBrush = Qt.QBrush(Qt.QColor("white")) - whiteBrush = Qt.QBrush(Qt.QColor(white)) - redBrush = Qt.QBrush(Qt.QColor(red)) - - self.gui.timePlot.setCanvasBackground(QtGui.QColor("black")) - self.gui.freqPlot.setCanvasBackground(QtGui.QColor("black")) - self.timeZoomer.setTrackerPen(Qt.QPen(whiteBrush, self.pen_width)) - self.timeZoomer.setRubberBandPen(Qt.QPen(whiteBrush, self.pen_width)) - self.freqZoomer.setTrackerPen(Qt.QPen(whiteBrush, self.pen_width)) - self.freqZoomer.setRubberBandPen(Qt.QPen(whiteBrush, self.pen_width)) - self.psdcurve.setPen(Qt.QPen(whiteBrush, self.pen_width)) - self.rcurve.setPen(Qt.QPen(whiteBrush, self.pen_width)) - self.icurve.setPen(Qt.QPen(redBrush, self.pen_width)) - - self.gui.timePlot.replot() - self.gui.freqPlot.replot() - - - def color_green_on_black(self): - green = QtGui.qRgb(0x00, 0xFF, 0x00) - red = QtGui.qRgb(0xFF, 0x00, 0x50) - - whiteBrush = Qt.QBrush(Qt.QColor("white")) - greenBrush = Qt.QBrush(Qt.QColor(green)) - redBrush = Qt.QBrush(Qt.QColor(red)) - - self.gui.timePlot.setCanvasBackground(QtGui.QColor("black")) - self.gui.freqPlot.setCanvasBackground(QtGui.QColor("black")) - self.timeZoomer.setTrackerPen(Qt.QPen(whiteBrush, self.pen_width)) - self.timeZoomer.setRubberBandPen(Qt.QPen(whiteBrush, self.pen_width)) - self.freqZoomer.setTrackerPen(Qt.QPen(whiteBrush, self.pen_width)) - self.freqZoomer.setRubberBandPen(Qt.QPen(whiteBrush, self.pen_width)) - self.psdcurve.setPen(Qt.QPen(greenBrush, self.pen_width)) - self.rcurve.setPen(Qt.QPen(greenBrush, self.pen_width)) - self.icurve.setPen(Qt.QPen(redBrush, self.pen_width)) - - self.gui.timePlot.replot() - self.gui.freqPlot.replot() - - def color_blue_on_black(self): - blue = QtGui.qRgb(0x00, 0x00, 0xFF) - red = QtGui.qRgb(0xFF, 0x00, 0x00) - - whiteBrush = Qt.QBrush(Qt.QColor("white")) - blueBrush = Qt.QBrush(Qt.QColor(blue)) - redBrush = Qt.QBrush(Qt.QColor(red)) - - self.gui.timePlot.setCanvasBackground(QtGui.QColor("black")) - self.gui.freqPlot.setCanvasBackground(QtGui.QColor("black")) - self.timeZoomer.setTrackerPen(Qt.QPen(whiteBrush, self.pen_width)) - self.timeZoomer.setRubberBandPen(Qt.QPen(whiteBrush, self.pen_width)) - self.freqZoomer.setTrackerPen(Qt.QPen(whiteBrush, self.pen_width)) - self.freqZoomer.setRubberBandPen(Qt.QPen(whiteBrush, self.pen_width)) - self.psdcurve.setPen(Qt.QPen(blueBrush, self.pen_width)) - self.rcurve.setPen(Qt.QPen(blueBrush, self.pen_width)) - self.icurve.setPen(Qt.QPen(redBrush, self.pen_width)) - - self.gui.timePlot.replot() - self.gui.freqPlot.replot() - -def setup_options(): - usage="%prog: [options] (input_filename)" - description = "" - - parser = OptionParser(conflict_handler="resolve", usage=usage, description=description) - parser.add_option("-B", "--block-length", type="int", default=8192, - help="Specify the block size [default=%default]") - parser.add_option("-s", "--start", type="int", default=0, - help="Specify where to start in the file [default=%default]") - parser.add_option("-R", "--sample-rate", type="float", default=1.0, - help="Set the sampler rate of the data [default=%default]") - parser.add_option("", "--psd-size", type="int", default=2048, - help="Set the size of the PSD FFT [default=%default]") - parser.add_option("", "--spec-size", type="int", default=2048, - help="Set the size of the spectrogram FFT [default=%default]") - - return parser - -def main(args): - parser = setup_options() - (options, args) = parser.parse_args () - - if(len(args) == 1): - filename = args[0] - else: - filename = None - - app = Qt.QApplication(args) - gplt = gr_plot_qt(app, filename, options) - app.exec_() - -if __name__ == '__main__': - main(sys.argv) - diff --git a/gr-utils/python/utils/plot_data.py b/gr-utils/python/utils/plot_data.py deleted file mode 100644 index a311f8711d..0000000000 --- a/gr-utils/python/utils/plot_data.py +++ /dev/null @@ -1,188 +0,0 @@ -# -# Copyright 2007,2008,2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# -""" -Utility to help plotting data from files. -""" - -from __future__ import print_function -from __future__ import division -from __future__ import unicode_literals - -from argparse import ArgumentParser - -import numpy - -try: - from pylab import Button, connect, draw, figure, figtext, get_current_fig_manager, show, plot, rcParams -except ImportError: - print("Please install Python Matplotlib (http://matplotlib.sourceforge.net/) and Python TkInter https://wiki.python.org/moin/TkInter to run this script") - raise SystemExit(1) - - -datatype_lookup = { - "complex64": numpy.complex64, - "float32": numpy.float32, - "uint32": numpy.uint32, - "int32": numpy.int32, - "uint16": numpy.uint16, - "int16": numpy.int16, - "uint8": numpy.uint8, - "int8": numpy.int8, -} - -class plot_data(object): - def __init__(self, datatype, filenames, options): - self.hfile = list() - self.legend_text = list() - for f in filenames: - self.hfile.append(open(f, "r")) - self.legend_text.append(f) - - self.block_length = options.block - self.start = options.start - self.sample_rate = options.sample_rate - - self.datatype = datatype - if self.datatype is None: - self.datatype = datatype_lookup[options.data_type] - self.sizeof_data = self.datatype().nbytes # number of bytes per sample in file - - self.axis_font_size = 16 - self.label_font_size = 18 - self.title_font_size = 20 - self.text_size = 22 - - # Setup PLOT - self.fig = figure(1, figsize=(16, 9), facecolor='w') - rcParams['xtick.labelsize'] = self.axis_font_size - rcParams['ytick.labelsize'] = self.axis_font_size - - self.text_file_pos = figtext(0.10, 0.88, "File Position: ", weight="heavy", size=self.text_size) - self.text_block = figtext(0.40, 0.88, ("Block Size: %d" % self.block_length), - weight="heavy", size=self.text_size) - self.text_sr = figtext(0.60, 0.88, ("Sample Rate: %.2f" % self.sample_rate), - weight="heavy", size=self.text_size) - self.make_plots() - - self.button_left_axes = self.fig.add_axes([0.45, 0.01, 0.05, 0.05], frameon=True) - self.button_left = Button(self.button_left_axes, "<") - self.button_left_callback = self.button_left.on_clicked(self.button_left_click) - - self.button_right_axes = self.fig.add_axes([0.50, 0.01, 0.05, 0.05], frameon=True) - self.button_right = Button(self.button_right_axes, ">") - self.button_right_callback = self.button_right.on_clicked(self.button_right_click) - - self.xlim = self.sp_f.get_xlim() - - self.manager = get_current_fig_manager() - connect('key_press_event', self.click) - show() - - def get_data(self, hfile): - self.text_file_pos.set_text("File Position: %d" % (hfile.tell()//self.sizeof_data)) - try: - f = numpy.fromfile(hfile, dtype=self.datatype, count=self.block_length) - except MemoryError: - print("End of File") - else: - self.f = numpy.array(f) - self.time = numpy.array([i*(1 / self.sample_rate) for i in range(len(self.f))]) - - def make_plots(self): - self.sp_f = self.fig.add_subplot(2,1,1, position=[0.075, 0.2, 0.875, 0.6]) - self.sp_f.set_title(("Amplitude"), fontsize=self.title_font_size, fontweight="bold") - self.sp_f.set_xlabel("Time (s)", fontsize=self.label_font_size, fontweight="bold") - self.sp_f.set_ylabel("Amplitude (V)", fontsize=self.label_font_size, fontweight="bold") - self.plot_f = list() - - maxval = -1e12 - minval = 1e12 - - for hf in self.hfile: - # if specified on the command-line, set file pointer - hf.seek(self.sizeof_data*self.start, 1) - - self.get_data(hf) - - # Subplot for real and imaginary parts of signal - self.plot_f += plot(self.time, self.f, 'o-') - maxval = max(maxval, self.f.max()) - minval = min(minval, self.f.min()) - - self.sp_f.set_ylim([1.5*minval, 1.5*maxval]) - - self.leg = self.sp_f.legend(self.plot_f, self.legend_text) - - draw() - - def update_plots(self): - maxval = -1e12 - minval = 1e12 - for hf,p in zip(self.hfile,self.plot_f): - self.get_data(hf) - p.set_data([self.time, self.f]) - maxval = max(maxval, self.f.max()) - minval = min(minval, self.f.min()) - - self.sp_f.set_ylim([1.5*minval, 1.5*maxval]) - - draw() - - def click(self, event): - forward_valid_keys = [" ", "down", "right"] - backward_valid_keys = ["up", "left"] - - if(find(event.key, forward_valid_keys)): - self.step_forward() - - elif(find(event.key, backward_valid_keys)): - self.step_backward() - - def button_left_click(self, event): - self.step_backward() - - def button_right_click(self, event): - self.step_forward() - - def step_forward(self): - self.update_plots() - - def step_backward(self): - for hf in self.hfile: - # Step back in file position - if(hf.tell() >= 2*self.sizeof_data*self.block_length ): - hf.seek(-2*self.sizeof_data*self.block_length, 1) - else: - hf.seek(-hf.tell(),1) - self.update_plots() - - @staticmethod - def setup_options(): - description = "Takes a GNU Radio binary file and displays the samples versus time. You can set the block size to specify how many points to read in at a time and the start position in the file. By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples." - - parser = ArgumentParser(conflict_handler="resolve", description=description) - parser.add_argument("-d", "--data-type", default="complex64", - choices=("complex64", "float32", "uint32", "int32", "uint16", - "int16", "uint8", "int8"), - help="Specify the data type [default=%(default)r]") - parser.add_argument("-B", "--block", type=int, default=1000, - help="Specify the block size [default=%(default)r]") - parser.add_argument("-s", "--start", type=int, default=0, - help="Specify where to start in the file [default=%(default)r]") - parser.add_argument("-R", "--sample-rate", type=float, default=1.0, - help="Set the sampler rate of the data [default=%(default)r]") - parser.add_argument("files", metavar="FILE", nargs='+', - help="Input file with samples") - return parser - -def find(item_in, list_search): - try: - return list_search.index(item_in) != None - except ValueError: - return False diff --git a/gr-utils/python/utils/plot_fft_base.py b/gr-utils/python/utils/plot_fft_base.py deleted file mode 100644 index f9fa8b5069..0000000000 --- a/gr-utils/python/utils/plot_fft_base.py +++ /dev/null @@ -1,237 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2007,2008,2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# - -from __future__ import print_function -from __future__ import division -from __future__ import unicode_literals - -import numpy -from numpy.fft import fftpack - -try: - from pylab import Button, connect, draw, figure, figtext, get_current_fig_manager, show, rcParams, ceil -except ImportError: - print("Please install Python Matplotlib (http://matplotlib.sourceforge.net/) and Python TkInter https://wiki.python.org/moin/TkInter to run this script") - raise SystemExit(1) - -from argparse import ArgumentParser -from gnuradio.plot_data import datatype_lookup - - -class plot_fft_base(object): - def __init__(self, datatype, filename, options): - self.hfile = open(filename, "r") - self.block_length = options.block - self.start = options.start - self.sample_rate = options.sample_rate - - self.datatype = datatype - if self.datatype is None: - self.datatype = datatype_lookup[options.data_type] - self.sizeof_data = self.datatype().nbytes # number of bytes per sample in file - - self.axis_font_size = 16 - self.label_font_size = 18 - self.title_font_size = 20 - self.text_size = 22 - - # Setup PLOT - self.fig = figure(1, figsize=(16, 12), facecolor='w') - rcParams['xtick.labelsize'] = self.axis_font_size - rcParams['ytick.labelsize'] = self.axis_font_size - - self.text_file = figtext(0.10, 0.94, ("File: %s" % filename), weight="heavy", size=self.text_size) - self.text_file_pos = figtext(0.10, 0.88, "File Position: ", weight="heavy", size=self.text_size) - self.text_block = figtext(0.35, 0.88, ("Block Size: %d" % self.block_length), - weight="heavy", size=self.text_size) - self.text_sr = figtext(0.60, 0.88, ("Sample Rate: %.2f" % self.sample_rate), - weight="heavy", size=self.text_size) - self.make_plots() - - self.button_left_axes = self.fig.add_axes([0.45, 0.01, 0.05, 0.05], frameon=True) - self.button_left = Button(self.button_left_axes, "<") - self.button_left_callback = self.button_left.on_clicked(self.button_left_click) - - self.button_right_axes = self.fig.add_axes([0.50, 0.01, 0.05, 0.05], frameon=True) - self.button_right = Button(self.button_right_axes, ">") - self.button_right_callback = self.button_right.on_clicked(self.button_right_click) - - self.xlim = self.sp_iq.get_xlim() - - self.manager = get_current_fig_manager() - connect('draw_event', self.zoom) - connect('key_press_event', self.click) - show() - - def get_data(self): - self.position = self.hfile.tell() / self.sizeof_data - self.text_file_pos.set_text("File Position: %d" % (self.position)) - try: - self.iq = numpy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length) - except MemoryError: - print("End of File") - else: - self.iq_fft = self.dofft(self.iq) - - tstep = 1.0 / self.sample_rate - #self.time = numpy.array([tstep*(self.position + i) for i in range(len(self.iq))]) - self.time = numpy.array([tstep*(i) for i in range(len(self.iq))]) - - self.freq = self.calc_freq(self.time, self.sample_rate) - - def dofft(self, iq): - N = len(iq) - iq_fft = numpy.fft.fftshift(fftpack.fft(iq)) # fft and shift axis - iq_fft = 20*numpy.log10(abs((iq_fft+1e-15) / N)) # convert to decibels, adjust power - # adding 1e-15 (-300 dB) to protect against value errors if an item in iq_fft is 0 - return iq_fft - - def calc_freq(self, time, sample_rate): - N = len(time) - Fs = 1.0 / (max(time) - min(time)) - Fn = 0.5 * sample_rate - freq = numpy.array([-Fn + i*Fs for i in range(N)]) - return freq - - def make_plots(self): - # if specified on the command-line, set file pointer - self.hfile.seek(self.sizeof_data*self.start, 1) - - # Subplot for real and imaginary parts of signal - self.sp_iq = self.fig.add_subplot(2,2,1, position=[0.075, 0.2, 0.4, 0.6]) - self.sp_iq.set_title(("I&Q"), fontsize=self.title_font_size, fontweight="bold") - self.sp_iq.set_xlabel("Time (s)", fontsize=self.label_font_size, fontweight="bold") - self.sp_iq.set_ylabel("Amplitude (V)", fontsize=self.label_font_size, fontweight="bold") - - # Subplot for FFT plot - self.sp_fft = self.fig.add_subplot(2,2,2, position=[0.575, 0.2, 0.4, 0.6]) - self.sp_fft.set_title(("FFT"), fontsize=self.title_font_size, fontweight="bold") - self.sp_fft.set_xlabel("Frequency (Hz)", fontsize=self.label_font_size, fontweight="bold") - self.sp_fft.set_ylabel("Power Spectrum (dBm)", fontsize=self.label_font_size, fontweight="bold") - - self.get_data() - - self.plot_iq = self.sp_iq.plot([], 'bo-') # make plot for reals - self.plot_iq += self.sp_iq.plot([], 'ro-') # make plot for imags - self.draw_time() # draw the plot - - self.plot_fft = self.sp_fft.plot([], 'bo-') # make plot for FFT - self.draw_fft() # draw the plot - - draw() - - def draw_time(self): - reals = self.iq.real - imags = self.iq.imag - self.plot_iq[0].set_data([self.time, reals]) - self.plot_iq[1].set_data([self.time, imags]) - self.sp_iq.set_xlim(self.time.min(), self.time.max()) - self.sp_iq.set_ylim([1.5*min([reals.min(), imags.min()]), - 1.5*max([reals.max(), imags.max()])]) - - def draw_fft(self): - self.plot_fft[0].set_data([self.freq, self.iq_fft]) - self.sp_fft.set_xlim(self.freq.min(), self.freq.max()) - self.sp_fft.set_ylim([self.iq_fft.min()-10, self.iq_fft.max()+10]) - - def update_plots(self): - self.draw_time() - self.draw_fft() - - self.xlim = self.sp_iq.get_xlim() - draw() - - def zoom(self, event): - newxlim = numpy.array(self.sp_iq.get_xlim()) - curxlim = numpy.array(self.xlim) - if(newxlim[0] != curxlim[0] or newxlim[1] != curxlim[1]): - self.xlim = newxlim - #xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0] - self.position)))) - #xmax = min(int(ceil(self.sample_rate*(self.xlim[1] - self.position))), len(self.iq)) - xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0])))) - xmax = min(int(ceil(self.sample_rate*(self.xlim[1]))), len(self.iq)) - - iq = self.iq[xmin : xmax] - time = self.time[xmin : xmax] - - iq_fft = self.dofft(iq) - freq = self.calc_freq(time, self.sample_rate) - - self.plot_fft[0].set_data(freq, iq_fft) - self.sp_fft.axis([freq.min(), freq.max(), - iq_fft.min()-10, iq_fft.max()+10]) - - draw() - - def click(self, event): - forward_valid_keys = [" ", "down", "right"] - backward_valid_keys = ["up", "left"] - - if(find(event.key, forward_valid_keys)): - self.step_forward() - - elif(find(event.key, backward_valid_keys)): - self.step_backward() - - def button_left_click(self, event): - self.step_backward() - - def button_right_click(self, event): - self.step_forward() - - def step_forward(self): - self.get_data() - self.update_plots() - - def step_backward(self): - # Step back in file position - if(self.hfile.tell() >= 2*self.sizeof_data*self.block_length ): - self.hfile.seek(-2*self.sizeof_data*self.block_length, 1) - else: - self.hfile.seek(-self.hfile.tell(),1) - self.get_data() - self.update_plots() - - @staticmethod - def setup_options(): - description = "Takes a GNU Radio complex binary file and displays the I&Q data versus time as well as the frequency domain (FFT) plot. The y-axis values are plotted assuming volts as the amplitude of the I&Q streams and converted into dBm in the frequency domain (the 1/N power adjustment out of the FFT is performed internally). The script plots a certain block of data at a time, specified on the command line as -B or --block. This value defaults to 1000. The start position in the file can be set by specifying -s or --start and defaults to 0 (the start of the file). By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time and frequency axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples." - - parser = ArgumentParser(conflict_handler="resolve", description=description) - parser.add_argument("-d", "--data-type", default="complex64", - choices=("complex64", "float32", "uint32", "int32", "uint16", - "int16", "uint8", "int8"), - help="Specify the data type [default=%(default)r]") - parser.add_argument("-B", "--block", type=int, default=1000, - help="Specify the block size [default=%(default)r]") - parser.add_argument("-s", "--start", type=int, default=0, - help="Specify where to start in the file [default=%(default)r]") - parser.add_argument("-R", "--sample-rate", type=float, default=1.0, - help="Set the sampler rate of the data [default=%(default)r]") - parser.add_argument("file", metavar="FILE", - help="Input file with samples") - return parser - -def find(item_in, list_search): - try: - return list_search.index(item_in) != None - except ValueError: - return False - -def main(): - parser = plot_fft_base.setup_options() - args = parser.parse_args() - - plot_fft_base(None, args.file, args) - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - pass diff --git a/gr-utils/python/utils/plot_psd_base.py b/gr-utils/python/utils/plot_psd_base.py deleted file mode 100644 index 812ec3a292..0000000000 --- a/gr-utils/python/utils/plot_psd_base.py +++ /dev/null @@ -1,276 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2007,2008,2010,2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# - -from __future__ import print_function -from __future__ import division -from __future__ import unicode_literals -import numpy - -try: - from pylab import Button, connect, draw, figure, figtext, get_current_fig_manager, mlab, show, rcParams, ceil -except ImportError: - print("Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)") - raise SystemExit(1) - -from argparse import ArgumentParser -from gnuradio.eng_arg import eng_float, intx -from gnuradio.plot_data import datatype_lookup - - -class plot_psd_base(object): - def __init__(self, datatype, filename, options): - self.hfile = open(filename, "r") - self.block_length = options.block - self.start = options.start - self.sample_rate = options.sample_rate - self.psdfftsize = options.psd_size - self.specfftsize = options.spec_size - - self.dospec = options.enable_spec # if we want to plot the spectrogram - - self.datatype = datatype - if self.datatype is None: - self.datatype = datatype_lookup[options.data_type] - self.sizeof_data = self.datatype().nbytes # number of bytes per sample in file - - self.axis_font_size = 16 - self.label_font_size = 18 - self.title_font_size = 20 - self.text_size = 22 - - # Setup PLOT - self.fig = figure(1, figsize=(16, 12), facecolor='w') - rcParams['xtick.labelsize'] = self.axis_font_size - rcParams['ytick.labelsize'] = self.axis_font_size - - self.text_file = figtext(0.10, 0.95, ("File: %s" % filename), - weight="heavy", size=self.text_size) - self.text_file_pos = figtext(0.10, 0.92, "File Position: ", - weight="heavy", size=self.text_size) - self.text_block = figtext(0.35, 0.92, ("Block Size: %d" % self.block_length), - weight="heavy", size=self.text_size) - self.text_sr = figtext(0.60, 0.915, ("Sample Rate: %.2f" % self.sample_rate), - weight="heavy", size=self.text_size) - self.make_plots() - - self.button_left_axes = self.fig.add_axes([0.45, 0.01, 0.05, 0.05], frameon=True) - self.button_left = Button(self.button_left_axes, "<") - self.button_left_callback = self.button_left.on_clicked(self.button_left_click) - - self.button_right_axes = self.fig.add_axes([0.50, 0.01, 0.05, 0.05], frameon=True) - self.button_right = Button(self.button_right_axes, ">") - self.button_right_callback = self.button_right.on_clicked(self.button_right_click) - - self.xlim = numpy.array(self.sp_iq.get_xlim()) - - self.manager = get_current_fig_manager() - connect('draw_event', self.zoom) - connect('key_press_event', self.click) - show() - - def get_data(self): - self.position = self.hfile.tell() / self.sizeof_data - self.text_file_pos.set_text("File Position: %d" % self.position) - try: - self.iq = numpy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length) - except MemoryError: - print("End of File") - return False - else: - # retesting length here as newer version of numpy does not throw a MemoryError, just - # returns a zero-length array - if(len(self.iq) > 0): - tstep = 1.0 / self.sample_rate - #self.time = numpy.array([tstep*(self.position + i) for i in range(len(self.iq))]) - self.time = numpy.array([tstep*(i) for i in range(len(self.iq))]) - - self.iq_psd, self.freq = self.dopsd(self.iq) - return True - else: - print("End of File") - return False - - def dopsd(self, iq): - ''' Need to do this here and plot later so we can do the fftshift ''' - overlap = self.psdfftsize / 4 - winfunc = numpy.blackman - psd,freq = mlab.psd(iq, self.psdfftsize, self.sample_rate, - window = lambda d: d*winfunc(self.psdfftsize), - noverlap = overlap) - psd = 10.0*numpy.log10(abs(psd)) - return (psd, freq) - - def make_plots(self): - # if specified on the command-line, set file pointer - self.hfile.seek(self.sizeof_data*self.start, 1) - - iqdims = [[0.075, 0.2, 0.4, 0.6], [0.075, 0.55, 0.4, 0.3]] - psddims = [[0.575, 0.2, 0.4, 0.6], [0.575, 0.55, 0.4, 0.3]] - specdims = [0.2, 0.125, 0.6, 0.3] - - # Subplot for real and imaginary parts of signal - self.sp_iq = self.fig.add_subplot(2,2,1, position=iqdims[self.dospec]) - self.sp_iq.set_title(("I&Q"), fontsize=self.title_font_size, fontweight="bold") - self.sp_iq.set_xlabel("Time (s)", fontsize=self.label_font_size, fontweight="bold") - self.sp_iq.set_ylabel("Amplitude (V)", fontsize=self.label_font_size, fontweight="bold") - - # Subplot for PSD plot - self.sp_psd = self.fig.add_subplot(2,2,2, position=psddims[self.dospec]) - self.sp_psd.set_title(("PSD"), fontsize=self.title_font_size, fontweight="bold") - self.sp_psd.set_xlabel("Frequency (Hz)", fontsize=self.label_font_size, fontweight="bold") - self.sp_psd.set_ylabel("Power Spectrum (dBm)", fontsize=self.label_font_size, fontweight="bold") - - r = self.get_data() - - self.plot_iq = self.sp_iq.plot([], 'bo-') # make plot for reals - self.plot_iq += self.sp_iq.plot([], 'ro-') # make plot for imags - self.draw_time(self.time, self.iq) # draw the plot - - self.plot_psd = self.sp_psd.plot([], 'b') # make plot for PSD - self.draw_psd(self.freq, self.iq_psd) # draw the plot - - - if self.dospec: - # Subplot for spectrogram plot - self.sp_spec = self.fig.add_subplot(2,2,3, position=specdims) - self.sp_spec.set_title(("Spectrogram"), fontsize=self.title_font_size, fontweight="bold") - self.sp_spec.set_xlabel("Time (s)", fontsize=self.label_font_size, fontweight="bold") - self.sp_spec.set_ylabel("Frequency (Hz)", fontsize=self.label_font_size, fontweight="bold") - - self.draw_spec(self.time, self.iq) - - draw() - - def draw_time(self, t, iq): - reals = iq.real - imags = iq.imag - self.plot_iq[0].set_data([t, reals]) - self.plot_iq[1].set_data([t, imags]) - self.sp_iq.set_xlim(t.min(), t.max()) - self.sp_iq.set_ylim([1.5*min([reals.min(), imags.min()]), - 1.5*max([reals.max(), imags.max()])]) - - def draw_psd(self, f, p): - self.plot_psd[0].set_data([f, p]) - self.sp_psd.set_ylim([p.min()-10, p.max()+10]) - self.sp_psd.set_xlim([f.min(), f.max()]) - - def draw_spec(self, t, s): - overlap = self.specfftsize / 4 - winfunc = numpy.blackman - self.sp_spec.clear() - self.sp_spec.specgram(s, self.specfftsize, self.sample_rate, - window = lambda d: d*winfunc(self.specfftsize), - noverlap = overlap, xextent=[t.min(), t.max()]) - - def update_plots(self): - self.draw_time(self.time, self.iq) - self.draw_psd(self.freq, self.iq_psd) - - if self.dospec: - self.draw_spec(self.time, self.iq) - - self.xlim = numpy.array(self.sp_iq.get_xlim()) # so zoom doesn't get called - - draw() - - def zoom(self, event): - newxlim = numpy.array(self.sp_iq.get_xlim()) - curxlim = numpy.array(self.xlim) - if(newxlim[0] != curxlim[0] or newxlim[1] != curxlim[1]): - #xmin = max(0, int(ceil(self.sample_rate*(newxlim[0] - self.position)))) - #xmax = min(int(ceil(self.sample_rate*(newxlim[1] - self.position))), len(self.iq)) - xmin = max(0, int(ceil(self.sample_rate*(newxlim[0])))) - xmax = min(int(ceil(self.sample_rate*(newxlim[1]))), len(self.iq)) - - iq = numpy.array(self.iq[xmin : xmax]) - time = numpy.array(self.time[xmin : xmax]) - - iq_psd, freq = self.dopsd(iq) - - self.draw_psd(freq, iq_psd) - self.xlim = numpy.array(self.sp_iq.get_xlim()) - - draw() - - def click(self, event): - forward_valid_keys = [" ", "down", "right"] - backward_valid_keys = ["up", "left"] - - if(find(event.key, forward_valid_keys)): - self.step_forward() - - elif(find(event.key, backward_valid_keys)): - self.step_backward() - - def button_left_click(self, event): - self.step_backward() - - def button_right_click(self, event): - self.step_forward() - - def step_forward(self): - r = self.get_data() - if(r): - self.update_plots() - - def step_backward(self): - # Step back in file position - if(self.hfile.tell() >= 2*self.sizeof_data*self.block_length ): - self.hfile.seek(-2*self.sizeof_data*self.block_length, 1) - else: - self.hfile.seek(-self.hfile.tell(),1) - r = self.get_data() - if(r): - self.update_plots() - - @staticmethod - def setup_options(): - description = "Takes a GNU Radio binary file (with specified data type using --data-type) and displays the I&Q data versus time as well as the power spectral density (PSD) plot. The y-axis values are plotted assuming volts as the amplitude of the I&Q streams and converted into dBm in the frequency domain (the 1/N power adjustment out of the FFT is performed internally). The script plots a certain block of data at a time, specified on the command line as -B or --block. The start position in the file can be set by specifying -s or --start and defaults to 0 (the start of the file). By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time and frequency axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples. Finally, the size of the FFT to use for the PSD and spectrogram plots can be set independently with --psd-size and --spec-size, respectively. The spectrogram plot does not display by default and is turned on with -S or --enable-spec." - - parser = ArgumentParser(conflict_handler="resolve", description=description) - parser.add_argument("-d", "--data-type", default="complex64", - choices=("complex64", "float32", "int32", "uint32", "int16", - "uint16", "int8", "uint8" ), - help="Specify the data type [default=%(default)r]") - parser.add_argument("-B", "--block", type=int, default=8192, - help="Specify the block size [default=%(default)r]") - parser.add_argument("-s", "--start", type=int, default=0, - help="Specify where to start in the file [default=%(default)r]") - parser.add_argument("-R", "--sample-rate", type=eng_float, default=1.0, - help="Set the sampler rate of the data [default=%(default)r]") - parser.add_argument("--psd-size", type=int, default=1024, - help="Set the size of the PSD FFT [default=%(default)r]") - parser.add_argument("--spec-size", type=int, default=256, - help="Set the size of the spectrogram FFT [default=%(default)r]") - parser.add_argument("-S", "--enable-spec", action="store_true", - help="Turn on plotting the spectrogram [default=%(default)r]") - parser.add_argument("file", metavar="FILE", - help="Input file with samples") - - return parser - -def find(item_in, list_search): - try: - return list_search.index(item_in) != None - except ValueError: - return False - -def main(): - parser = plot_psd_base.setup_options() - args = parser.parse_args() - - plot_psd_base(None, args.file, args) - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - pass diff --git a/gr-utils/python/utils/pyqt_filter.py b/gr-utils/python/utils/pyqt_filter.py deleted file mode 100644 index fac17644d3..0000000000 --- a/gr-utils/python/utils/pyqt_filter.py +++ /dev/null @@ -1,436 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'pyqt_filter.ui' -# -# Created: Thu Mar 17 10:51:17 2011 -# by: PyQt4 UI code generator 4.7.4 -# -# WARNING! All changes made in this file will be lost! - -from __future__ import unicode_literals -from PyQt4 import QtCore, QtGui - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.resize(1124, 696) - self.centralwidget = QtGui.QWidget(MainWindow) - self.centralwidget.setObjectName("centralwidget") - self.gridLayout = QtGui.QGridLayout(self.centralwidget) - self.gridLayout.setObjectName("gridLayout") - self.filterFrame = QtGui.QFrame(self.centralwidget) - self.filterFrame.setMinimumSize(QtCore.QSize(300, 0)) - self.filterFrame.setMaximumSize(QtCore.QSize(300, 16777215)) - self.filterFrame.setFrameShape(QtGui.QFrame.StyledPanel) - self.filterFrame.setFrameShadow(QtGui.QFrame.Raised) - self.filterFrame.setObjectName("filterFrame") - self.verticalLayout = QtGui.QVBoxLayout(self.filterFrame) - self.verticalLayout.setObjectName("verticalLayout") - self.filterTypeComboBox = QtGui.QComboBox(self.filterFrame) - self.filterTypeComboBox.setObjectName("filterTypeComboBox") - self.filterTypeComboBox.addItem("") - self.filterTypeComboBox.addItem("") - self.filterTypeComboBox.addItem("") - self.filterTypeComboBox.addItem("") - self.filterTypeComboBox.addItem("") - self.filterTypeComboBox.addItem("") - self.filterTypeComboBox.addItem("") - self.verticalLayout.addWidget(self.filterTypeComboBox) - self.filterDesignTypeComboBox = QtGui.QComboBox(self.filterFrame) - self.filterDesignTypeComboBox.setObjectName("filterDesignTypeComboBox") - self.filterDesignTypeComboBox.addItem("") - self.filterDesignTypeComboBox.addItem("") - self.filterDesignTypeComboBox.addItem("") - self.filterDesignTypeComboBox.addItem("") - self.filterDesignTypeComboBox.addItem("") - self.filterDesignTypeComboBox.addItem("") - self.filterDesignTypeComboBox.addItem("") - self.verticalLayout.addWidget(self.filterDesignTypeComboBox) - self.globalParamsLayout = QtGui.QFormLayout() - self.globalParamsLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) - self.globalParamsLayout.setObjectName("globalParamsLayout") - self.sampleRateLabel = QtGui.QLabel(self.filterFrame) - self.sampleRateLabel.setMaximumSize(QtCore.QSize(16777215, 30)) - self.sampleRateLabel.setObjectName("sampleRateLabel") - self.globalParamsLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.sampleRateLabel) - self.sampleRateEdit = QtGui.QLineEdit(self.filterFrame) - self.sampleRateEdit.setMaximumSize(QtCore.QSize(16777215, 30)) - self.sampleRateEdit.setObjectName("sampleRateEdit") - self.globalParamsLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.sampleRateEdit) - self.filterGainLabel = QtGui.QLabel(self.filterFrame) - self.filterGainLabel.setObjectName("filterGainLabel") - self.globalParamsLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.filterGainLabel) - self.filterGainEdit = QtGui.QLineEdit(self.filterFrame) - self.filterGainEdit.setObjectName("filterGainEdit") - self.globalParamsLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.filterGainEdit) - self.verticalLayout.addLayout(self.globalParamsLayout) - self.filterTypeWidget = QtGui.QStackedWidget(self.filterFrame) - self.filterTypeWidget.setObjectName("filterTypeWidget") - self.firlpfPage = QtGui.QWidget() - self.firlpfPage.setObjectName("firlpfPage") - self.formLayout = QtGui.QFormLayout(self.firlpfPage) - self.formLayout.setObjectName("formLayout") - self.endofLpfPassBandLabel = QtGui.QLabel(self.firlpfPage) - self.endofLpfPassBandLabel.setObjectName("endofLpfPassBandLabel") - self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.endofLpfPassBandLabel) - self.endofLpfPassBandEdit = QtGui.QLineEdit(self.firlpfPage) - self.endofLpfPassBandEdit.setObjectName("endofLpfPassBandEdit") - self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.endofLpfPassBandEdit) - self.startofLpfStopBandLabel = QtGui.QLabel(self.firlpfPage) - self.startofLpfStopBandLabel.setObjectName("startofLpfStopBandLabel") - self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.startofLpfStopBandLabel) - self.startofLpfStopBandEdit = QtGui.QLineEdit(self.firlpfPage) - self.startofLpfStopBandEdit.setObjectName("startofLpfStopBandEdit") - self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.startofLpfStopBandEdit) - self.lpfStopBandAttenLabel = QtGui.QLabel(self.firlpfPage) - self.lpfStopBandAttenLabel.setObjectName("lpfStopBandAttenLabel") - self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.lpfStopBandAttenLabel) - self.lpfStopBandAttenEdit = QtGui.QLineEdit(self.firlpfPage) - self.lpfStopBandAttenEdit.setObjectName("lpfStopBandAttenEdit") - self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.lpfStopBandAttenEdit) - self.lpfPassBandRippleEdit = QtGui.QLineEdit(self.firlpfPage) - self.lpfPassBandRippleEdit.setObjectName("lpfPassBandRippleEdit") - self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.lpfPassBandRippleEdit) - self.lpfPassBandRippleLabel = QtGui.QLabel(self.firlpfPage) - self.lpfPassBandRippleLabel.setObjectName("lpfPassBandRippleLabel") - self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.lpfPassBandRippleLabel) - self.filterTypeWidget.addWidget(self.firlpfPage) - self.firbpfPage = QtGui.QWidget() - self.firbpfPage.setObjectName("firbpfPage") - self.formLayout_2 = QtGui.QFormLayout(self.firbpfPage) - self.formLayout_2.setObjectName("formLayout_2") - self.startofBpfPassBandLabel = QtGui.QLabel(self.firbpfPage) - self.startofBpfPassBandLabel.setObjectName("startofBpfPassBandLabel") - self.formLayout_2.setWidget(0, QtGui.QFormLayout.LabelRole, self.startofBpfPassBandLabel) - self.startofBpfPassBandEdit = QtGui.QLineEdit(self.firbpfPage) - self.startofBpfPassBandEdit.setObjectName("startofBpfPassBandEdit") - self.formLayout_2.setWidget(0, QtGui.QFormLayout.FieldRole, self.startofBpfPassBandEdit) - self.endofBpfPassBandLabel = QtGui.QLabel(self.firbpfPage) - self.endofBpfPassBandLabel.setObjectName("endofBpfPassBandLabel") - self.formLayout_2.setWidget(1, QtGui.QFormLayout.LabelRole, self.endofBpfPassBandLabel) - self.endofBpfPassBandEdit = QtGui.QLineEdit(self.firbpfPage) - self.endofBpfPassBandEdit.setObjectName("endofBpfPassBandEdit") - self.formLayout_2.setWidget(1, QtGui.QFormLayout.FieldRole, self.endofBpfPassBandEdit) - self.bpfStopBandAttenEdit = QtGui.QLineEdit(self.firbpfPage) - self.bpfStopBandAttenEdit.setObjectName("bpfStopBandAttenEdit") - self.formLayout_2.setWidget(3, QtGui.QFormLayout.FieldRole, self.bpfStopBandAttenEdit) - self.bpfStopBandAttenLabel = QtGui.QLabel(self.firbpfPage) - self.bpfStopBandAttenLabel.setObjectName("bpfStopBandAttenLabel") - self.formLayout_2.setWidget(3, QtGui.QFormLayout.LabelRole, self.bpfStopBandAttenLabel) - self.bpfTransitionLabel = QtGui.QLabel(self.firbpfPage) - self.bpfTransitionLabel.setObjectName("bpfTransitionLabel") - self.formLayout_2.setWidget(2, QtGui.QFormLayout.LabelRole, self.bpfTransitionLabel) - self.bpfTransitionEdit = QtGui.QLineEdit(self.firbpfPage) - self.bpfTransitionEdit.setObjectName("bpfTransitionEdit") - self.formLayout_2.setWidget(2, QtGui.QFormLayout.FieldRole, self.bpfTransitionEdit) - self.bpfPassBandRippleEdit = QtGui.QLineEdit(self.firbpfPage) - self.bpfPassBandRippleEdit.setObjectName("bpfPassBandRippleEdit") - self.formLayout_2.setWidget(4, QtGui.QFormLayout.FieldRole, self.bpfPassBandRippleEdit) - self.bpfPassBandRippleLabel = QtGui.QLabel(self.firbpfPage) - self.bpfPassBandRippleLabel.setObjectName("bpfPassBandRippleLabel") - self.formLayout_2.setWidget(4, QtGui.QFormLayout.LabelRole, self.bpfPassBandRippleLabel) - self.filterTypeWidget.addWidget(self.firbpfPage) - self.firbnfPage = QtGui.QWidget() - self.firbnfPage.setObjectName("firbnfPage") - self.formLayout_5 = QtGui.QFormLayout(self.firbnfPage) - self.formLayout_5.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) - self.formLayout_5.setObjectName("formLayout_5") - self.startofBnfStopBandLabel = QtGui.QLabel(self.firbnfPage) - self.startofBnfStopBandLabel.setObjectName("startofBnfStopBandLabel") - self.formLayout_5.setWidget(0, QtGui.QFormLayout.LabelRole, self.startofBnfStopBandLabel) - self.startofBnfStopBandEdit = QtGui.QLineEdit(self.firbnfPage) - self.startofBnfStopBandEdit.setObjectName("startofBnfStopBandEdit") - self.formLayout_5.setWidget(0, QtGui.QFormLayout.FieldRole, self.startofBnfStopBandEdit) - self.endofBnfStopBandLabel = QtGui.QLabel(self.firbnfPage) - self.endofBnfStopBandLabel.setObjectName("endofBnfStopBandLabel") - self.formLayout_5.setWidget(1, QtGui.QFormLayout.LabelRole, self.endofBnfStopBandLabel) - self.endofBnfStopBandEdit = QtGui.QLineEdit(self.firbnfPage) - self.endofBnfStopBandEdit.setObjectName("endofBnfStopBandEdit") - self.formLayout_5.setWidget(1, QtGui.QFormLayout.FieldRole, self.endofBnfStopBandEdit) - self.bnfTransitionLabel = QtGui.QLabel(self.firbnfPage) - self.bnfTransitionLabel.setObjectName("bnfTransitionLabel") - self.formLayout_5.setWidget(2, QtGui.QFormLayout.LabelRole, self.bnfTransitionLabel) - self.bnfTransitionEdit = QtGui.QLineEdit(self.firbnfPage) - self.bnfTransitionEdit.setObjectName("bnfTransitionEdit") - self.formLayout_5.setWidget(2, QtGui.QFormLayout.FieldRole, self.bnfTransitionEdit) - self.bnfStopBandAttenLabel = QtGui.QLabel(self.firbnfPage) - self.bnfStopBandAttenLabel.setObjectName("bnfStopBandAttenLabel") - self.formLayout_5.setWidget(3, QtGui.QFormLayout.LabelRole, self.bnfStopBandAttenLabel) - self.bnfStopBandAttenEdit = QtGui.QLineEdit(self.firbnfPage) - self.bnfStopBandAttenEdit.setObjectName("bnfStopBandAttenEdit") - self.formLayout_5.setWidget(3, QtGui.QFormLayout.FieldRole, self.bnfStopBandAttenEdit) - self.bnfPassBandRippleLabel = QtGui.QLabel(self.firbnfPage) - self.bnfPassBandRippleLabel.setObjectName("bnfPassBandRippleLabel") - self.formLayout_5.setWidget(4, QtGui.QFormLayout.LabelRole, self.bnfPassBandRippleLabel) - self.bnfPassBandRippleEdit = QtGui.QLineEdit(self.firbnfPage) - self.bnfPassBandRippleEdit.setObjectName("bnfPassBandRippleEdit") - self.formLayout_5.setWidget(4, QtGui.QFormLayout.FieldRole, self.bnfPassBandRippleEdit) - self.filterTypeWidget.addWidget(self.firbnfPage) - self.firhpfPage = QtGui.QWidget() - self.firhpfPage.setObjectName("firhpfPage") - self.formLayout_3 = QtGui.QFormLayout(self.firhpfPage) - self.formLayout_3.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) - self.formLayout_3.setObjectName("formLayout_3") - self.endofHpfStopBandLabel = QtGui.QLabel(self.firhpfPage) - self.endofHpfStopBandLabel.setObjectName("endofHpfStopBandLabel") - self.formLayout_3.setWidget(0, QtGui.QFormLayout.LabelRole, self.endofHpfStopBandLabel) - self.endofHpfStopBandEdit = QtGui.QLineEdit(self.firhpfPage) - self.endofHpfStopBandEdit.setObjectName("endofHpfStopBandEdit") - self.formLayout_3.setWidget(0, QtGui.QFormLayout.FieldRole, self.endofHpfStopBandEdit) - self.startofHpfPassBandLabel = QtGui.QLabel(self.firhpfPage) - self.startofHpfPassBandLabel.setObjectName("startofHpfPassBandLabel") - self.formLayout_3.setWidget(1, QtGui.QFormLayout.LabelRole, self.startofHpfPassBandLabel) - self.startofHpfPassBandEdit = QtGui.QLineEdit(self.firhpfPage) - self.startofHpfPassBandEdit.setObjectName("startofHpfPassBandEdit") - self.formLayout_3.setWidget(1, QtGui.QFormLayout.FieldRole, self.startofHpfPassBandEdit) - self.hpfStopBandAttenLabel = QtGui.QLabel(self.firhpfPage) - self.hpfStopBandAttenLabel.setObjectName("hpfStopBandAttenLabel") - self.formLayout_3.setWidget(2, QtGui.QFormLayout.LabelRole, self.hpfStopBandAttenLabel) - self.hpfStopBandAttenEdit = QtGui.QLineEdit(self.firhpfPage) - self.hpfStopBandAttenEdit.setObjectName("hpfStopBandAttenEdit") - self.formLayout_3.setWidget(2, QtGui.QFormLayout.FieldRole, self.hpfStopBandAttenEdit) - self.hpfPassBandRippleLabel = QtGui.QLabel(self.firhpfPage) - self.hpfPassBandRippleLabel.setObjectName("hpfPassBandRippleLabel") - self.formLayout_3.setWidget(3, QtGui.QFormLayout.LabelRole, self.hpfPassBandRippleLabel) - self.hpfPassBandRippleEdit = QtGui.QLineEdit(self.firhpfPage) - self.hpfPassBandRippleEdit.setObjectName("hpfPassBandRippleEdit") - self.formLayout_3.setWidget(3, QtGui.QFormLayout.FieldRole, self.hpfPassBandRippleEdit) - self.filterTypeWidget.addWidget(self.firhpfPage) - self.rrcPage = QtGui.QWidget() - self.rrcPage.setObjectName("rrcPage") - self.formLayout_6 = QtGui.QFormLayout(self.rrcPage) - self.formLayout_6.setObjectName("formLayout_6") - self.rrcSymbolRateLabel = QtGui.QLabel(self.rrcPage) - self.rrcSymbolRateLabel.setObjectName("rrcSymbolRateLabel") - self.formLayout_6.setWidget(0, QtGui.QFormLayout.LabelRole, self.rrcSymbolRateLabel) - self.rrcAlphaLabel = QtGui.QLabel(self.rrcPage) - self.rrcAlphaLabel.setObjectName("rrcAlphaLabel") - self.formLayout_6.setWidget(1, QtGui.QFormLayout.LabelRole, self.rrcAlphaLabel) - self.rrcNumTapsLabel = QtGui.QLabel(self.rrcPage) - self.rrcNumTapsLabel.setObjectName("rrcNumTapsLabel") - self.formLayout_6.setWidget(2, QtGui.QFormLayout.LabelRole, self.rrcNumTapsLabel) - self.rrcSymbolRateEdit = QtGui.QLineEdit(self.rrcPage) - self.rrcSymbolRateEdit.setObjectName("rrcSymbolRateEdit") - self.formLayout_6.setWidget(0, QtGui.QFormLayout.FieldRole, self.rrcSymbolRateEdit) - self.rrcAlphaEdit = QtGui.QLineEdit(self.rrcPage) - self.rrcAlphaEdit.setObjectName("rrcAlphaEdit") - self.formLayout_6.setWidget(1, QtGui.QFormLayout.FieldRole, self.rrcAlphaEdit) - self.rrcNumTapsEdit = QtGui.QLineEdit(self.rrcPage) - self.rrcNumTapsEdit.setObjectName("rrcNumTapsEdit") - self.formLayout_6.setWidget(2, QtGui.QFormLayout.FieldRole, self.rrcNumTapsEdit) - self.filterTypeWidget.addWidget(self.rrcPage) - self.gausPage = QtGui.QWidget() - self.gausPage.setObjectName("gausPage") - self.formLayout_7 = QtGui.QFormLayout(self.gausPage) - self.formLayout_7.setObjectName("formLayout_7") - self.gausSymbolRateLabel = QtGui.QLabel(self.gausPage) - self.gausSymbolRateLabel.setObjectName("gausSymbolRateLabel") - self.formLayout_7.setWidget(0, QtGui.QFormLayout.LabelRole, self.gausSymbolRateLabel) - self.gausSymbolRateEdit = QtGui.QLineEdit(self.gausPage) - self.gausSymbolRateEdit.setObjectName("gausSymbolRateEdit") - self.formLayout_7.setWidget(0, QtGui.QFormLayout.FieldRole, self.gausSymbolRateEdit) - self.gausBTLabel = QtGui.QLabel(self.gausPage) - self.gausBTLabel.setObjectName("gausBTLabel") - self.formLayout_7.setWidget(1, QtGui.QFormLayout.LabelRole, self.gausBTLabel) - self.gausBTEdit = QtGui.QLineEdit(self.gausPage) - self.gausBTEdit.setObjectName("gausBTEdit") - self.formLayout_7.setWidget(1, QtGui.QFormLayout.FieldRole, self.gausBTEdit) - self.gausNumTapsLabel = QtGui.QLabel(self.gausPage) - self.gausNumTapsLabel.setObjectName("gausNumTapsLabel") - self.formLayout_7.setWidget(2, QtGui.QFormLayout.LabelRole, self.gausNumTapsLabel) - self.gausNumTapsEdit = QtGui.QLineEdit(self.gausPage) - self.gausNumTapsEdit.setObjectName("gausNumTapsEdit") - self.formLayout_7.setWidget(2, QtGui.QFormLayout.FieldRole, self.gausNumTapsEdit) - self.filterTypeWidget.addWidget(self.gausPage) - self.verticalLayout.addWidget(self.filterTypeWidget) - self.filterPropsBox = QtGui.QGroupBox(self.filterFrame) - self.filterPropsBox.setObjectName("filterPropsBox") - self.formLayout_8 = QtGui.QFormLayout(self.filterPropsBox) - self.formLayout_8.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) - self.formLayout_8.setObjectName("formLayout_8") - self.nTapsLabel = QtGui.QLabel(self.filterPropsBox) - self.nTapsLabel.setMinimumSize(QtCore.QSize(150, 0)) - self.nTapsLabel.setObjectName("nTapsLabel") - self.formLayout_8.setWidget(1, QtGui.QFormLayout.LabelRole, self.nTapsLabel) - self.nTapsEdit = QtGui.QLabel(self.filterPropsBox) - self.nTapsEdit.setMaximumSize(QtCore.QSize(100, 16777215)) - self.nTapsEdit.setFrameShape(QtGui.QFrame.Box) - self.nTapsEdit.setFrameShadow(QtGui.QFrame.Raised) - self.nTapsEdit.setText("") - self.nTapsEdit.setObjectName("nTapsEdit") - self.formLayout_8.setWidget(1, QtGui.QFormLayout.FieldRole, self.nTapsEdit) - self.verticalLayout.addWidget(self.filterPropsBox) - self.sysParamsBox = QtGui.QGroupBox(self.filterFrame) - self.sysParamsBox.setObjectName("sysParamsBox") - self.formLayout_4 = QtGui.QFormLayout(self.sysParamsBox) - self.formLayout_4.setObjectName("formLayout_4") - self.nfftEdit = QtGui.QLineEdit(self.sysParamsBox) - self.nfftEdit.setObjectName("nfftEdit") - self.formLayout_4.setWidget(1, QtGui.QFormLayout.FieldRole, self.nfftEdit) - self.nfftLabel = QtGui.QLabel(self.sysParamsBox) - self.nfftLabel.setMinimumSize(QtCore.QSize(150, 0)) - self.nfftLabel.setObjectName("nfftLabel") - self.formLayout_4.setWidget(1, QtGui.QFormLayout.LabelRole, self.nfftLabel) - self.verticalLayout.addWidget(self.sysParamsBox) - self.designButton = QtGui.QPushButton(self.filterFrame) - self.designButton.setMinimumSize(QtCore.QSize(0, 0)) - self.designButton.setMaximumSize(QtCore.QSize(200, 16777215)) - self.designButton.setAutoDefault(True) - self.designButton.setDefault(True) - self.designButton.setObjectName("designButton") - self.verticalLayout.addWidget(self.designButton) - self.gridLayout.addWidget(self.filterFrame, 1, 0, 1, 1) - self.tabGroup = QtGui.QTabWidget(self.centralwidget) - self.tabGroup.setMinimumSize(QtCore.QSize(800, 0)) - self.tabGroup.setObjectName("tabGroup") - self.freqTab = QtGui.QWidget() - self.freqTab.setObjectName("freqTab") - self.horizontalLayout_2 = QtGui.QHBoxLayout(self.freqTab) - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - self.freqPlot = QwtPlot(self.freqTab) - self.freqPlot.setObjectName("freqPlot") - self.horizontalLayout_2.addWidget(self.freqPlot) - self.tabGroup.addTab(self.freqTab, "") - self.timeTab = QtGui.QWidget() - self.timeTab.setObjectName("timeTab") - self.horizontalLayout = QtGui.QHBoxLayout(self.timeTab) - self.horizontalLayout.setObjectName("horizontalLayout") - self.timePlot = QwtPlot(self.timeTab) - self.timePlot.setObjectName("timePlot") - self.horizontalLayout.addWidget(self.timePlot) - self.tabGroup.addTab(self.timeTab, "") - self.phaseTab = QtGui.QWidget() - self.phaseTab.setObjectName("phaseTab") - self.horizontalLayout_3 = QtGui.QHBoxLayout(self.phaseTab) - self.horizontalLayout_3.setObjectName("horizontalLayout_3") - self.phasePlot = QwtPlot(self.phaseTab) - self.phasePlot.setObjectName("phasePlot") - self.horizontalLayout_3.addWidget(self.phasePlot) - self.tabGroup.addTab(self.phaseTab, "") - self.groupTab = QtGui.QWidget() - self.groupTab.setObjectName("groupTab") - self.horizontalLayout_4 = QtGui.QHBoxLayout(self.groupTab) - self.horizontalLayout_4.setObjectName("horizontalLayout_4") - self.groupPlot = QwtPlot(self.groupTab) - self.groupPlot.setObjectName("groupPlot") - self.horizontalLayout_4.addWidget(self.groupPlot) - self.tabGroup.addTab(self.groupTab, "") - self.gridLayout.addWidget(self.tabGroup, 1, 1, 1, 1) - MainWindow.setCentralWidget(self.centralwidget) - self.menubar = QtGui.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 1124, 27)) - self.menubar.setObjectName("menubar") - self.menu_File = QtGui.QMenu(self.menubar) - self.menu_File.setObjectName("menu_File") - MainWindow.setMenuBar(self.menubar) - self.statusbar = QtGui.QStatusBar(MainWindow) - self.statusbar.setObjectName("statusbar") - MainWindow.setStatusBar(self.statusbar) - self.action_exit = QtGui.QAction(MainWindow) - self.action_exit.setObjectName("action_exit") - self.action_save = QtGui.QAction(MainWindow) - self.action_save.setObjectName("action_save") - self.action_open = QtGui.QAction(MainWindow) - self.action_open.setObjectName("action_open") - self.menu_File.addAction(self.action_open) - self.menu_File.addAction(self.action_save) - self.menu_File.addAction(self.action_exit) - self.menubar.addAction(self.menu_File.menuAction()) - - self.retranslateUi(MainWindow) - self.filterTypeWidget.setCurrentIndex(5) - self.tabGroup.setCurrentIndex(0) - QtCore.QObject.connect(self.action_exit, QtCore.SIGNAL("activated()"), MainWindow.close) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - MainWindow.setTabOrder(self.filterTypeComboBox, self.filterDesignTypeComboBox) - MainWindow.setTabOrder(self.filterDesignTypeComboBox, self.sampleRateEdit) - MainWindow.setTabOrder(self.sampleRateEdit, self.filterGainEdit) - MainWindow.setTabOrder(self.filterGainEdit, self.endofLpfPassBandEdit) - MainWindow.setTabOrder(self.endofLpfPassBandEdit, self.startofLpfStopBandEdit) - MainWindow.setTabOrder(self.startofLpfStopBandEdit, self.lpfStopBandAttenEdit) - MainWindow.setTabOrder(self.lpfStopBandAttenEdit, self.lpfPassBandRippleEdit) - MainWindow.setTabOrder(self.lpfPassBandRippleEdit, self.startofBpfPassBandEdit) - MainWindow.setTabOrder(self.startofBpfPassBandEdit, self.endofBpfPassBandEdit) - MainWindow.setTabOrder(self.endofBpfPassBandEdit, self.bpfTransitionEdit) - MainWindow.setTabOrder(self.bpfTransitionEdit, self.bpfStopBandAttenEdit) - MainWindow.setTabOrder(self.bpfStopBandAttenEdit, self.bpfPassBandRippleEdit) - MainWindow.setTabOrder(self.bpfPassBandRippleEdit, self.startofBnfStopBandEdit) - MainWindow.setTabOrder(self.startofBnfStopBandEdit, self.endofBnfStopBandEdit) - MainWindow.setTabOrder(self.endofBnfStopBandEdit, self.bnfTransitionEdit) - MainWindow.setTabOrder(self.bnfTransitionEdit, self.bnfStopBandAttenEdit) - MainWindow.setTabOrder(self.bnfStopBandAttenEdit, self.bnfPassBandRippleEdit) - MainWindow.setTabOrder(self.bnfPassBandRippleEdit, self.endofHpfStopBandEdit) - MainWindow.setTabOrder(self.endofHpfStopBandEdit, self.startofHpfPassBandEdit) - MainWindow.setTabOrder(self.startofHpfPassBandEdit, self.hpfStopBandAttenEdit) - MainWindow.setTabOrder(self.hpfStopBandAttenEdit, self.hpfPassBandRippleEdit) - MainWindow.setTabOrder(self.hpfPassBandRippleEdit, self.rrcSymbolRateEdit) - MainWindow.setTabOrder(self.rrcSymbolRateEdit, self.rrcAlphaEdit) - MainWindow.setTabOrder(self.rrcAlphaEdit, self.rrcNumTapsEdit) - MainWindow.setTabOrder(self.rrcNumTapsEdit, self.gausSymbolRateEdit) - MainWindow.setTabOrder(self.gausSymbolRateEdit, self.gausBTEdit) - MainWindow.setTabOrder(self.gausBTEdit, self.gausNumTapsEdit) - MainWindow.setTabOrder(self.gausNumTapsEdit, self.nfftEdit) - MainWindow.setTabOrder(self.nfftEdit, self.designButton) - MainWindow.setTabOrder(self.designButton, self.tabGroup) - - def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "GNU Radio Filter Design Tool", None, QtGui.QApplication.UnicodeUTF8)) - self.filterTypeComboBox.setItemText(0, QtGui.QApplication.translate("MainWindow", "Low Pass", None, QtGui.QApplication.UnicodeUTF8)) - self.filterTypeComboBox.setItemText(1, QtGui.QApplication.translate("MainWindow", "Band Pass", None, QtGui.QApplication.UnicodeUTF8)) - self.filterTypeComboBox.setItemText(2, QtGui.QApplication.translate("MainWindow", "Complex Band Pass", None, QtGui.QApplication.UnicodeUTF8)) - self.filterTypeComboBox.setItemText(3, QtGui.QApplication.translate("MainWindow", "Band Notch", None, QtGui.QApplication.UnicodeUTF8)) - self.filterTypeComboBox.setItemText(4, QtGui.QApplication.translate("MainWindow", "High Pass", None, QtGui.QApplication.UnicodeUTF8)) - self.filterTypeComboBox.setItemText(5, QtGui.QApplication.translate("MainWindow", "Root Raised Cosine", None, QtGui.QApplication.UnicodeUTF8)) - self.filterTypeComboBox.setItemText(6, QtGui.QApplication.translate("MainWindow", "Gaussian", None, QtGui.QApplication.UnicodeUTF8)) - self.filterDesignTypeComboBox.setItemText(0, QtGui.QApplication.translate("MainWindow", "Hamming Window", None, QtGui.QApplication.UnicodeUTF8)) - self.filterDesignTypeComboBox.setItemText(1, QtGui.QApplication.translate("MainWindow", "Hann Window", None, QtGui.QApplication.UnicodeUTF8)) - self.filterDesignTypeComboBox.setItemText(2, QtGui.QApplication.translate("MainWindow", "Blackman Window", None, QtGui.QApplication.UnicodeUTF8)) - self.filterDesignTypeComboBox.setItemText(3, QtGui.QApplication.translate("MainWindow", "Rectangular Window", None, QtGui.QApplication.UnicodeUTF8)) - self.filterDesignTypeComboBox.setItemText(4, QtGui.QApplication.translate("MainWindow", "Kaiser Window", None, QtGui.QApplication.UnicodeUTF8)) - self.filterDesignTypeComboBox.setItemText(5, QtGui.QApplication.translate("MainWindow", "Blackman-harris Window", None, QtGui.QApplication.UnicodeUTF8)) - self.filterDesignTypeComboBox.setItemText(6, QtGui.QApplication.translate("MainWindow", "Equiripple", None, QtGui.QApplication.UnicodeUTF8)) - self.sampleRateLabel.setText(QtGui.QApplication.translate("MainWindow", "Sample Rate (sps)", None, QtGui.QApplication.UnicodeUTF8)) - self.filterGainLabel.setText(QtGui.QApplication.translate("MainWindow", "Filter Gain", None, QtGui.QApplication.UnicodeUTF8)) - self.endofLpfPassBandLabel.setText(QtGui.QApplication.translate("MainWindow", "End of Pass Band (Hz)", None, QtGui.QApplication.UnicodeUTF8)) - self.startofLpfStopBandLabel.setText(QtGui.QApplication.translate("MainWindow", "Start of Stop Band (Hz)", None, QtGui.QApplication.UnicodeUTF8)) - self.lpfStopBandAttenLabel.setText(QtGui.QApplication.translate("MainWindow", "Stop Band Attenuation (dB)", None, QtGui.QApplication.UnicodeUTF8)) - self.lpfPassBandRippleLabel.setText(QtGui.QApplication.translate("MainWindow", "Pass Band Ripple (dB)", None, QtGui.QApplication.UnicodeUTF8)) - self.startofBpfPassBandLabel.setText(QtGui.QApplication.translate("MainWindow", "Start of Pass Band (Hz)", None, QtGui.QApplication.UnicodeUTF8)) - self.endofBpfPassBandLabel.setText(QtGui.QApplication.translate("MainWindow", "End of Pass Band (Hz)", None, QtGui.QApplication.UnicodeUTF8)) - self.bpfStopBandAttenLabel.setText(QtGui.QApplication.translate("MainWindow", "Stop Band Attenuation (dB)", None, QtGui.QApplication.UnicodeUTF8)) - self.bpfTransitionLabel.setText(QtGui.QApplication.translate("MainWindow", "Transition Width (Hz)", None, QtGui.QApplication.UnicodeUTF8)) - self.bpfPassBandRippleLabel.setText(QtGui.QApplication.translate("MainWindow", "Pass Band Ripple (dB)", None, QtGui.QApplication.UnicodeUTF8)) - self.startofBnfStopBandLabel.setText(QtGui.QApplication.translate("MainWindow", "Start of Stop Band (Hz)", None, QtGui.QApplication.UnicodeUTF8)) - self.endofBnfStopBandLabel.setText(QtGui.QApplication.translate("MainWindow", "End of Stop Band (Hz)", None, QtGui.QApplication.UnicodeUTF8)) - self.bnfTransitionLabel.setText(QtGui.QApplication.translate("MainWindow", "Transition Width (Hz)", None, QtGui.QApplication.UnicodeUTF8)) - self.bnfStopBandAttenLabel.setText(QtGui.QApplication.translate("MainWindow", "Stop Band Attenuation (dB)", None, QtGui.QApplication.UnicodeUTF8)) - self.bnfPassBandRippleLabel.setText(QtGui.QApplication.translate("MainWindow", "Pass Band Ripple (dB)", None, QtGui.QApplication.UnicodeUTF8)) - self.endofHpfStopBandLabel.setText(QtGui.QApplication.translate("MainWindow", "End of Stop Band (Hz)", None, QtGui.QApplication.UnicodeUTF8)) - self.startofHpfPassBandLabel.setText(QtGui.QApplication.translate("MainWindow", "Start of Pass Band (Hz)", None, QtGui.QApplication.UnicodeUTF8)) - self.hpfStopBandAttenLabel.setText(QtGui.QApplication.translate("MainWindow", "Stop Band Attenuation (dB)", None, QtGui.QApplication.UnicodeUTF8)) - self.hpfPassBandRippleLabel.setText(QtGui.QApplication.translate("MainWindow", "Pass Band Ripple (dB)", None, QtGui.QApplication.UnicodeUTF8)) - self.rrcSymbolRateLabel.setText(QtGui.QApplication.translate("MainWindow", "Symbol Rate (sps)", None, QtGui.QApplication.UnicodeUTF8)) - self.rrcAlphaLabel.setText(QtGui.QApplication.translate("MainWindow", "Roll-off Factor", None, QtGui.QApplication.UnicodeUTF8)) - self.rrcNumTapsLabel.setText(QtGui.QApplication.translate("MainWindow", "Number of Taps", None, QtGui.QApplication.UnicodeUTF8)) - self.gausSymbolRateLabel.setText(QtGui.QApplication.translate("MainWindow", "Symbol Rate (sps)", None, QtGui.QApplication.UnicodeUTF8)) - self.gausBTLabel.setText(QtGui.QApplication.translate("MainWindow", "Roll-off Factor", None, QtGui.QApplication.UnicodeUTF8)) - self.gausNumTapsLabel.setText(QtGui.QApplication.translate("MainWindow", "Number of Taps", None, QtGui.QApplication.UnicodeUTF8)) - self.filterPropsBox.setTitle(QtGui.QApplication.translate("MainWindow", "Filter Properties", None, QtGui.QApplication.UnicodeUTF8)) - self.nTapsLabel.setText(QtGui.QApplication.translate("MainWindow", "Number of Taps:", None, QtGui.QApplication.UnicodeUTF8)) - self.sysParamsBox.setTitle(QtGui.QApplication.translate("MainWindow", "System Parameters", None, QtGui.QApplication.UnicodeUTF8)) - self.nfftLabel.setText(QtGui.QApplication.translate("MainWindow", "Num FFT points", None, QtGui.QApplication.UnicodeUTF8)) - self.designButton.setText(QtGui.QApplication.translate("MainWindow", "Design", None, QtGui.QApplication.UnicodeUTF8)) - self.tabGroup.setTabText(self.tabGroup.indexOf(self.freqTab), QtGui.QApplication.translate("MainWindow", "Frequency Domain", None, QtGui.QApplication.UnicodeUTF8)) - self.tabGroup.setTabText(self.tabGroup.indexOf(self.timeTab), QtGui.QApplication.translate("MainWindow", "Time Domain", None, QtGui.QApplication.UnicodeUTF8)) - self.tabGroup.setTabText(self.tabGroup.indexOf(self.phaseTab), QtGui.QApplication.translate("MainWindow", "Phase", None, QtGui.QApplication.UnicodeUTF8)) - self.tabGroup.setTabText(self.tabGroup.indexOf(self.groupTab), QtGui.QApplication.translate("MainWindow", "Group Delay", None, QtGui.QApplication.UnicodeUTF8)) - self.menu_File.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8)) - self.action_exit.setText(QtGui.QApplication.translate("MainWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8)) - self.action_save.setText(QtGui.QApplication.translate("MainWindow", "&Save", None, QtGui.QApplication.UnicodeUTF8)) - self.action_save.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+S", None, QtGui.QApplication.UnicodeUTF8)) - self.action_open.setText(QtGui.QApplication.translate("MainWindow", "&Open", None, QtGui.QApplication.UnicodeUTF8)) - self.action_open.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8)) - -#from qwt_plot import QwtPlot -from PyQt4.Qwt5 import QwtPlot - diff --git a/gr-utils/python/utils/pyqt_filter.ui b/gr-utils/python/utils/pyqt_filter.ui deleted file mode 100644 index 9853352e2e..0000000000 --- a/gr-utils/python/utils/pyqt_filter.ui +++ /dev/null @@ -1,687 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>1124</width> - <height>696</height> - </rect> - </property> - <property name="windowTitle"> - <string>GNU Radio Filter Design Tool</string> - </property> - <widget class="QWidget" name="centralwidget"> - <layout class="QGridLayout" name="gridLayout"> - <item row="1" column="0"> - <widget class="QFrame" name="filterFrame"> - <property name="minimumSize"> - <size> - <width>300</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>300</width> - <height>16777215</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QComboBox" name="filterTypeComboBox"> - <item> - <property name="text"> - <string>Low Pass</string> - </property> - </item> - <item> - <property name="text"> - <string>Band Pass</string> - </property> - </item> - <item> - <property name="text"> - <string>Complex Band Pass</string> - </property> - </item> - <item> - <property name="text"> - <string>Band Notch</string> - </property> - </item> - <item> - <property name="text"> - <string>High Pass</string> - </property> - </item> - <item> - <property name="text"> - <string>Root Raised Cosine</string> - </property> - </item> - <item> - <property name="text"> - <string>Gaussian</string> - </property> - </item> - </widget> - </item> - <item> - <widget class="QComboBox" name="filterDesignTypeComboBox"> - <item> - <property name="text"> - <string>Hamming Window</string> - </property> - </item> - <item> - <property name="text"> - <string>Hann Window</string> - </property> - </item> - <item> - <property name="text"> - <string>Blackman Window</string> - </property> - </item> - <item> - <property name="text"> - <string>Rectangular Window</string> - </property> - </item> - <item> - <property name="text"> - <string>Kaiser Window</string> - </property> - </item> - <item> - <property name="text"> - <string>Blackman-harris Window</string> - </property> - </item> - <item> - <property name="text"> - <string>Equiripple</string> - </property> - </item> - </widget> - </item> - <item> - <layout class="QFormLayout" name="globalParamsLayout"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="sampleRateLabel"> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - <property name="text"> - <string>Sample Rate (sps)</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="sampleRateEdit"> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="filterGainLabel"> - <property name="text"> - <string>Filter Gain</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="filterGainEdit"/> - </item> - </layout> - </item> - <item> - <widget class="QStackedWidget" name="filterTypeWidget"> - <property name="currentIndex"> - <number>5</number> - </property> - <widget class="QWidget" name="firlpfPage"> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="endofLpfPassBandLabel"> - <property name="text"> - <string>End of Pass Band (Hz)</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="endofLpfPassBandEdit"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="startofLpfStopBandLabel"> - <property name="text"> - <string>Start of Stop Band (Hz)</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="startofLpfStopBandEdit"/> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="lpfStopBandAttenLabel"> - <property name="text"> - <string>Stop Band Attenuation (dB)</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="lpfStopBandAttenEdit"/> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="lpfPassBandRippleEdit"/> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="lpfPassBandRippleLabel"> - <property name="text"> - <string>Pass Band Ripple (dB)</string> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="firbpfPage"> - <layout class="QFormLayout" name="formLayout_2"> - <item row="0" column="0"> - <widget class="QLabel" name="startofBpfPassBandLabel"> - <property name="text"> - <string>Start of Pass Band (Hz)</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="startofBpfPassBandEdit"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="endofBpfPassBandLabel"> - <property name="text"> - <string>End of Pass Band (Hz)</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="endofBpfPassBandEdit"/> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="bpfStopBandAttenEdit"/> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="bpfStopBandAttenLabel"> - <property name="text"> - <string>Stop Band Attenuation (dB)</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="bpfTransitionLabel"> - <property name="text"> - <string>Transition Width (Hz)</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="bpfTransitionEdit"/> - </item> - <item row="4" column="1"> - <widget class="QLineEdit" name="bpfPassBandRippleEdit"/> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="bpfPassBandRippleLabel"> - <property name="text"> - <string>Pass Band Ripple (dB)</string> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="firbnfPage"> - <layout class="QFormLayout" name="formLayout_5"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="startofBnfStopBandLabel"> - <property name="text"> - <string>Start of Stop Band (Hz)</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="startofBnfStopBandEdit"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="endofBnfStopBandLabel"> - <property name="text"> - <string>End of Stop Band (Hz)</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="endofBnfStopBandEdit"/> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="bnfTransitionLabel"> - <property name="text"> - <string>Transition Width (Hz)</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="bnfTransitionEdit"/> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="bnfStopBandAttenLabel"> - <property name="text"> - <string>Stop Band Attenuation (dB)</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="bnfStopBandAttenEdit"/> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="bnfPassBandRippleLabel"> - <property name="text"> - <string>Pass Band Ripple (dB)</string> - </property> - </widget> - </item> - <item row="4" column="1"> - <widget class="QLineEdit" name="bnfPassBandRippleEdit"/> - </item> - </layout> - </widget> - <widget class="QWidget" name="firhpfPage"> - <layout class="QFormLayout" name="formLayout_3"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="endofHpfStopBandLabel"> - <property name="text"> - <string>End of Stop Band (Hz)</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="endofHpfStopBandEdit"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="startofHpfPassBandLabel"> - <property name="text"> - <string>Start of Pass Band (Hz)</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="startofHpfPassBandEdit"/> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="hpfStopBandAttenLabel"> - <property name="text"> - <string>Stop Band Attenuation (dB)</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="hpfStopBandAttenEdit"/> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="hpfPassBandRippleLabel"> - <property name="text"> - <string>Pass Band Ripple (dB)</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="hpfPassBandRippleEdit"/> - </item> - </layout> - </widget> - <widget class="QWidget" name="rrcPage"> - <layout class="QFormLayout" name="formLayout_6"> - <item row="0" column="0"> - <widget class="QLabel" name="rrcSymbolRateLabel"> - <property name="text"> - <string>Symbol Rate (sps)</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="rrcAlphaLabel"> - <property name="text"> - <string>Roll-off Factor</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="rrcNumTapsLabel"> - <property name="text"> - <string>Number of Taps</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="rrcSymbolRateEdit"/> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="rrcAlphaEdit"/> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="rrcNumTapsEdit"/> - </item> - </layout> - </widget> - <widget class="QWidget" name="gausPage"> - <layout class="QFormLayout" name="formLayout_7"> - <item row="0" column="0"> - <widget class="QLabel" name="gausSymbolRateLabel"> - <property name="text"> - <string>Symbol Rate (sps)</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="gausSymbolRateEdit"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="gausBTLabel"> - <property name="text"> - <string>Roll-off Factor</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="gausBTEdit"/> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="gausNumTapsLabel"> - <property name="text"> - <string>Number of Taps</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="gausNumTapsEdit"/> - </item> - </layout> - </widget> - </widget> - </item> - <item> - <widget class="QGroupBox" name="filterPropsBox"> - <property name="title"> - <string>Filter Properties</string> - </property> - <layout class="QFormLayout" name="formLayout_8"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="1" column="0"> - <widget class="QLabel" name="nTapsLabel"> - <property name="minimumSize"> - <size> - <width>150</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Number of Taps:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLabel" name="nTapsEdit"> - <property name="maximumSize"> - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::Box</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="sysParamsBox"> - <property name="title"> - <string>System Parameters</string> - </property> - <layout class="QFormLayout" name="formLayout_4"> - <item row="1" column="1"> - <widget class="QLineEdit" name="nfftEdit"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="nfftLabel"> - <property name="minimumSize"> - <size> - <width>150</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Num FFT points</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QPushButton" name="designButton"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>200</width> - <height>16777215</height> - </size> - </property> - <property name="text"> - <string>Design</string> - </property> - <property name="autoDefault"> - <bool>true</bool> - </property> - <property name="default"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="1" column="1"> - <widget class="QTabWidget" name="tabGroup"> - <property name="minimumSize"> - <size> - <width>800</width> - <height>0</height> - </size> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="freqTab"> - <attribute name="title"> - <string>Frequency Domain</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QwtPlot" name="freqPlot"/> - </item> - </layout> - </widget> - <widget class="QWidget" name="timeTab"> - <attribute name="title"> - <string>Time Domain</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QwtPlot" name="timePlot"/> - </item> - </layout> - </widget> - <widget class="QWidget" name="phaseTab"> - <attribute name="title"> - <string>Phase</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QwtPlot" name="phasePlot"/> - </item> - </layout> - </widget> - <widget class="QWidget" name="groupTab"> - <attribute name="title"> - <string>Group Delay</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QwtPlot" name="groupPlot"/> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </widget> - <widget class="QMenuBar" name="menubar"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>1124</width> - <height>27</height> - </rect> - </property> - <widget class="QMenu" name="menu_File"> - <property name="title"> - <string>&File</string> - </property> - <addaction name="action_open"/> - <addaction name="action_save"/> - <addaction name="action_exit"/> - </widget> - <addaction name="menu_File"/> - </widget> - <widget class="QStatusBar" name="statusbar"/> - <action name="action_exit"> - <property name="text"> - <string>E&xit</string> - </property> - </action> - <action name="action_save"> - <property name="text"> - <string>&Save</string> - </property> - <property name="shortcut"> - <string>Ctrl+S</string> - </property> - </action> - <action name="action_open"> - <property name="text"> - <string>&Open</string> - </property> - <property name="shortcut"> - <string>Ctrl+O</string> - </property> - </action> - </widget> - <customwidgets> - <customwidget> - <class>QwtPlot</class> - <extends>QFrame</extends> - <header>qwt_plot.h</header> - </customwidget> - </customwidgets> - <tabstops> - <tabstop>filterTypeComboBox</tabstop> - <tabstop>filterDesignTypeComboBox</tabstop> - <tabstop>sampleRateEdit</tabstop> - <tabstop>filterGainEdit</tabstop> - <tabstop>endofLpfPassBandEdit</tabstop> - <tabstop>startofLpfStopBandEdit</tabstop> - <tabstop>lpfStopBandAttenEdit</tabstop> - <tabstop>lpfPassBandRippleEdit</tabstop> - <tabstop>startofBpfPassBandEdit</tabstop> - <tabstop>endofBpfPassBandEdit</tabstop> - <tabstop>bpfTransitionEdit</tabstop> - <tabstop>bpfStopBandAttenEdit</tabstop> - <tabstop>bpfPassBandRippleEdit</tabstop> - <tabstop>startofBnfStopBandEdit</tabstop> - <tabstop>endofBnfStopBandEdit</tabstop> - <tabstop>bnfTransitionEdit</tabstop> - <tabstop>bnfStopBandAttenEdit</tabstop> - <tabstop>bnfPassBandRippleEdit</tabstop> - <tabstop>endofHpfStopBandEdit</tabstop> - <tabstop>startofHpfPassBandEdit</tabstop> - <tabstop>hpfStopBandAttenEdit</tabstop> - <tabstop>hpfPassBandRippleEdit</tabstop> - <tabstop>rrcSymbolRateEdit</tabstop> - <tabstop>rrcAlphaEdit</tabstop> - <tabstop>rrcNumTapsEdit</tabstop> - <tabstop>gausSymbolRateEdit</tabstop> - <tabstop>gausBTEdit</tabstop> - <tabstop>gausNumTapsEdit</tabstop> - <tabstop>nfftEdit</tabstop> - <tabstop>designButton</tabstop> - <tabstop>tabGroup</tabstop> - </tabstops> - <resources/> - <connections> - <connection> - <sender>action_exit</sender> - <signal>activated()</signal> - <receiver>MainWindow</receiver> - <slot>close()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>399</x> - <y>347</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/gr-utils/python/utils/pyqt_plot.py b/gr-utils/python/utils/pyqt_plot.py deleted file mode 100644 index bec30c32ad..0000000000 --- a/gr-utils/python/utils/pyqt_plot.py +++ /dev/null @@ -1,271 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'pyqt_plot.ui' -# -# Created by: PyQt4 UI code generator 4.12.1 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) -except AttributeError: - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName(_fromUtf8("MainWindow")) - MainWindow.resize(927, 718) - self.centralwidget = QtGui.QWidget(MainWindow) - self.centralwidget.setObjectName(_fromUtf8("centralwidget")) - self.gridLayout = QtGui.QGridLayout(self.centralwidget) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.plotHBar = QtGui.QScrollBar(self.centralwidget) - self.plotHBar.setOrientation(QtCore.Qt.Horizontal) - self.plotHBar.setObjectName(_fromUtf8("plotHBar")) - self.gridLayout.addWidget(self.plotHBar, 1, 0, 1, 3) - self.filePosBox = QtGui.QGroupBox(self.centralwidget) - self.filePosBox.setMinimumSize(QtCore.QSize(0, 120)) - self.filePosBox.setObjectName(_fromUtf8("filePosBox")) - self.gridLayout_4 = QtGui.QGridLayout(self.filePosBox) - self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) - self.filePosLayout = QtGui.QFormLayout() - self.filePosLayout.setObjectName(_fromUtf8("filePosLayout")) - self.filePosStartLineEdit = QtGui.QLineEdit(self.filePosBox) - self.filePosStartLineEdit.setMinimumSize(QtCore.QSize(50, 0)) - self.filePosStartLineEdit.setMaximumSize(QtCore.QSize(100, 16777215)) - self.filePosStartLineEdit.setObjectName(_fromUtf8("filePosStartLineEdit")) - self.filePosLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.filePosStartLineEdit) - self.filePosStopLabel = QtGui.QLabel(self.filePosBox) - self.filePosStopLabel.setObjectName(_fromUtf8("filePosStopLabel")) - self.filePosLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.filePosStopLabel) - self.filePosStopLineEdit = QtGui.QLineEdit(self.filePosBox) - self.filePosStopLineEdit.setMinimumSize(QtCore.QSize(50, 0)) - self.filePosStopLineEdit.setMaximumSize(QtCore.QSize(100, 16777215)) - self.filePosStopLineEdit.setObjectName(_fromUtf8("filePosStopLineEdit")) - self.filePosLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.filePosStopLineEdit) - self.filePosLengthLabel = QtGui.QLabel(self.filePosBox) - self.filePosLengthLabel.setObjectName(_fromUtf8("filePosLengthLabel")) - self.filePosLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.filePosLengthLabel) - self.filePosLengthLineEdit = QtGui.QLineEdit(self.filePosBox) - self.filePosLengthLineEdit.setMinimumSize(QtCore.QSize(50, 0)) - self.filePosLengthLineEdit.setMaximumSize(QtCore.QSize(100, 16777215)) - self.filePosLengthLineEdit.setObjectName(_fromUtf8("filePosLengthLineEdit")) - self.filePosLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.filePosLengthLineEdit) - self.filePosStartLabel = QtGui.QLabel(self.filePosBox) - self.filePosStartLabel.setObjectName(_fromUtf8("filePosStartLabel")) - self.filePosLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.filePosStartLabel) - self.gridLayout_4.addLayout(self.filePosLayout, 0, 0, 1, 1) - self.fileTimeLayout = QtGui.QFormLayout() - self.fileTimeLayout.setObjectName(_fromUtf8("fileTimeLayout")) - self.fileTimeStartLabel = QtGui.QLabel(self.filePosBox) - self.fileTimeStartLabel.setObjectName(_fromUtf8("fileTimeStartLabel")) - self.fileTimeLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.fileTimeStartLabel) - self.fileTimeStartLineEdit = QtGui.QLineEdit(self.filePosBox) - self.fileTimeStartLineEdit.setMinimumSize(QtCore.QSize(50, 0)) - self.fileTimeStartLineEdit.setMaximumSize(QtCore.QSize(100, 16777215)) - self.fileTimeStartLineEdit.setObjectName(_fromUtf8("fileTimeStartLineEdit")) - self.fileTimeLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.fileTimeStartLineEdit) - self.fileTimeStopLabel = QtGui.QLabel(self.filePosBox) - self.fileTimeStopLabel.setObjectName(_fromUtf8("fileTimeStopLabel")) - self.fileTimeLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.fileTimeStopLabel) - self.fileTimeStopLineEdit = QtGui.QLineEdit(self.filePosBox) - self.fileTimeStopLineEdit.setMinimumSize(QtCore.QSize(50, 0)) - self.fileTimeStopLineEdit.setMaximumSize(QtCore.QSize(100, 16777215)) - self.fileTimeStopLineEdit.setObjectName(_fromUtf8("fileTimeStopLineEdit")) - self.fileTimeLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.fileTimeStopLineEdit) - self.fileTimeLengthLabel = QtGui.QLabel(self.filePosBox) - self.fileTimeLengthLabel.setObjectName(_fromUtf8("fileTimeLengthLabel")) - self.fileTimeLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.fileTimeLengthLabel) - self.fileTimeLengthLineEdit = QtGui.QLineEdit(self.filePosBox) - self.fileTimeLengthLineEdit.setMinimumSize(QtCore.QSize(50, 0)) - self.fileTimeLengthLineEdit.setMaximumSize(QtCore.QSize(100, 16777215)) - self.fileTimeLengthLineEdit.setObjectName(_fromUtf8("fileTimeLengthLineEdit")) - self.fileTimeLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.fileTimeLengthLineEdit) - self.gridLayout_4.addLayout(self.fileTimeLayout, 0, 1, 1, 1) - self.gridLayout.addWidget(self.filePosBox, 2, 0, 1, 1) - self.displayGroupBox = QtGui.QGroupBox(self.centralwidget) - self.displayGroupBox.setMinimumSize(QtCore.QSize(170, 0)) - self.displayGroupBox.setObjectName(_fromUtf8("displayGroupBox")) - self.gridLayout_2 = QtGui.QGridLayout(self.displayGroupBox) - self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) - self.colorComboBox = QtGui.QComboBox(self.displayGroupBox) - self.colorComboBox.setObjectName(_fromUtf8("colorComboBox")) - self.gridLayout_2.addWidget(self.colorComboBox, 0, 0, 1, 2) - self.lineWidthSpinBox = QtGui.QSpinBox(self.displayGroupBox) - self.lineWidthSpinBox.setMinimumSize(QtCore.QSize(100, 0)) - self.lineWidthSpinBox.setMaximumSize(QtCore.QSize(100, 16777215)) - self.lineWidthSpinBox.setObjectName(_fromUtf8("lineWidthSpinBox")) - self.gridLayout_2.addWidget(self.lineWidthSpinBox, 1, 1, 1, 1) - self.lineWidthLabel = QtGui.QLabel(self.displayGroupBox) - self.lineWidthLabel.setObjectName(_fromUtf8("lineWidthLabel")) - self.gridLayout_2.addWidget(self.lineWidthLabel, 1, 0, 1, 1) - self.lineStyleLabel = QtGui.QLabel(self.displayGroupBox) - self.lineStyleLabel.setObjectName(_fromUtf8("lineStyleLabel")) - self.gridLayout_2.addWidget(self.lineStyleLabel, 2, 0, 1, 1) - self.lineStyleComboBox = QtGui.QComboBox(self.displayGroupBox) - self.lineStyleComboBox.setMinimumSize(QtCore.QSize(100, 0)) - self.lineStyleComboBox.setMaximumSize(QtCore.QSize(100, 16777215)) - self.lineStyleComboBox.setObjectName(_fromUtf8("lineStyleComboBox")) - self.gridLayout_2.addWidget(self.lineStyleComboBox, 2, 1, 1, 1) - self.styleSizeLabel = QtGui.QLabel(self.displayGroupBox) - self.styleSizeLabel.setObjectName(_fromUtf8("styleSizeLabel")) - self.gridLayout_2.addWidget(self.styleSizeLabel, 3, 0, 1, 1) - self.styleSizeSpinBox = QtGui.QSpinBox(self.displayGroupBox) - self.styleSizeSpinBox.setMinimumSize(QtCore.QSize(100, 0)) - self.styleSizeSpinBox.setMaximumSize(QtCore.QSize(100, 16777215)) - self.styleSizeSpinBox.setObjectName(_fromUtf8("styleSizeSpinBox")) - self.gridLayout_2.addWidget(self.styleSizeSpinBox, 3, 1, 1, 1) - self.gridLayout.addWidget(self.displayGroupBox, 2, 2, 1, 1) - self.sysGroupBox = QtGui.QGroupBox(self.centralwidget) - self.sysGroupBox.setMinimumSize(QtCore.QSize(200, 0)) - self.sysGroupBox.setObjectName(_fromUtf8("sysGroupBox")) - self.formLayout = QtGui.QFormLayout(self.sysGroupBox) - self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) - self.formLayout.setObjectName(_fromUtf8("formLayout")) - self.sampleRateLabel = QtGui.QLabel(self.sysGroupBox) - self.sampleRateLabel.setObjectName(_fromUtf8("sampleRateLabel")) - self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.sampleRateLabel) - self.sampleRateLineEdit = QtGui.QLineEdit(self.sysGroupBox) - self.sampleRateLineEdit.setMinimumSize(QtCore.QSize(50, 0)) - self.sampleRateLineEdit.setMaximumSize(QtCore.QSize(100, 16777215)) - self.sampleRateLineEdit.setObjectName(_fromUtf8("sampleRateLineEdit")) - self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.sampleRateLineEdit) - self.gridLayout.addWidget(self.sysGroupBox, 2, 1, 1, 1) - self.frame = QtGui.QFrame(self.centralwidget) - self.frame.setFrameShape(QtGui.QFrame.StyledPanel) - self.frame.setFrameShadow(QtGui.QFrame.Raised) - self.frame.setObjectName(_fromUtf8("frame")) - self.gridLayout_3 = QtGui.QGridLayout(self.frame) - self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) - self.tabGroup = QtGui.QTabWidget(self.frame) - self.tabGroup.setMinimumSize(QtCore.QSize(0, 0)) - self.tabGroup.setObjectName(_fromUtf8("tabGroup")) - self.timeTab = QtGui.QWidget() - self.timeTab.setObjectName(_fromUtf8("timeTab")) - self.horizontalLayout = QtGui.QHBoxLayout(self.timeTab) - self.horizontalLayout.setMargin(0) - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - self.timePlot = Qwt5.QwtPlot(self.timeTab) - self.timePlot.setObjectName(_fromUtf8("timePlot")) - self.horizontalLayout.addWidget(self.timePlot) - self.timePlot.raise_() - self.tabGroup.addTab(self.timeTab, _fromUtf8("")) - self.freqTab = QtGui.QWidget() - self.freqTab.setObjectName(_fromUtf8("freqTab")) - self.horizontalLayout_2 = QtGui.QHBoxLayout(self.freqTab) - self.horizontalLayout_2.setMargin(0) - self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) - self.fftPropBox = QtGui.QGroupBox(self.freqTab) - self.fftPropBox.setMinimumSize(QtCore.QSize(160, 0)) - self.fftPropBox.setObjectName(_fromUtf8("fftPropBox")) - self.formLayout_4 = QtGui.QFormLayout(self.fftPropBox) - self.formLayout_4.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) - self.formLayout_4.setObjectName(_fromUtf8("formLayout_4")) - self.psdFFTSizeLabel = QtGui.QLabel(self.fftPropBox) - self.psdFFTSizeLabel.setObjectName(_fromUtf8("psdFFTSizeLabel")) - self.formLayout_4.setWidget(0, QtGui.QFormLayout.LabelRole, self.psdFFTSizeLabel) - self.psdFFTComboBox = QtGui.QComboBox(self.fftPropBox) - self.psdFFTComboBox.setMinimumSize(QtCore.QSize(96, 0)) - self.psdFFTComboBox.setMaximumSize(QtCore.QSize(96, 16777215)) - self.psdFFTComboBox.setObjectName(_fromUtf8("psdFFTComboBox")) - self.formLayout_4.setWidget(0, QtGui.QFormLayout.FieldRole, self.psdFFTComboBox) - self.psdFFTSizeLabel.raise_() - self.psdFFTComboBox.raise_() - self.horizontalLayout_2.addWidget(self.fftPropBox) - self.freqPlot = Qwt5.QwtPlot(self.freqTab) - self.freqPlot.setObjectName(_fromUtf8("freqPlot")) - self.horizontalLayout_2.addWidget(self.freqPlot) - self.tabGroup.addTab(self.freqTab, _fromUtf8("")) - self.specTab = QtGui.QWidget() - self.specTab.setObjectName(_fromUtf8("specTab")) - self.horizontalLayout_3 = QtGui.QHBoxLayout(self.specTab) - self.horizontalLayout_3.setMargin(0) - self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) - self.groupBox = QtGui.QGroupBox(self.specTab) - self.groupBox.setObjectName(_fromUtf8("groupBox")) - self.formLayout_3 = QtGui.QFormLayout(self.groupBox) - self.formLayout_3.setObjectName(_fromUtf8("formLayout_3")) - self.specFFTLabel = QtGui.QLabel(self.groupBox) - self.specFFTLabel.setObjectName(_fromUtf8("specFFTLabel")) - self.formLayout_3.setWidget(1, QtGui.QFormLayout.LabelRole, self.specFFTLabel) - self.specFFTComboBox = QtGui.QComboBox(self.groupBox) - self.specFFTComboBox.setMinimumSize(QtCore.QSize(96, 0)) - self.specFFTComboBox.setMaximumSize(QtCore.QSize(96, 16777215)) - self.specFFTComboBox.setObjectName(_fromUtf8("specFFTComboBox")) - self.formLayout_3.setWidget(1, QtGui.QFormLayout.FieldRole, self.specFFTComboBox) - self.horizontalLayout_3.addWidget(self.groupBox) - self.specPlot = Qwt5.QwtPlot(self.specTab) - self.specPlot.setObjectName(_fromUtf8("specPlot")) - self.horizontalLayout_3.addWidget(self.specPlot) - self.specPlot.raise_() - self.groupBox.raise_() - self.tabGroup.addTab(self.specTab, _fromUtf8("")) - self.gridLayout_3.addWidget(self.tabGroup, 0, 0, 1, 1) - self.tabGroup.raise_() - self.gridLayout.addWidget(self.frame, 0, 0, 1, 3) - MainWindow.setCentralWidget(self.centralwidget) - self.menubar = QtGui.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 927, 24)) - self.menubar.setObjectName(_fromUtf8("menubar")) - self.menu_File = QtGui.QMenu(self.menubar) - self.menu_File.setObjectName(_fromUtf8("menu_File")) - MainWindow.setMenuBar(self.menubar) - self.statusbar = QtGui.QStatusBar(MainWindow) - self.statusbar.setObjectName(_fromUtf8("statusbar")) - MainWindow.setStatusBar(self.statusbar) - self.action_open = QtGui.QAction(MainWindow) - self.action_open.setObjectName(_fromUtf8("action_open")) - self.action_exit = QtGui.QAction(MainWindow) - self.action_exit.setObjectName(_fromUtf8("action_exit")) - self.action_reload = QtGui.QAction(MainWindow) - self.action_reload.setObjectName(_fromUtf8("action_reload")) - self.menu_File.addAction(self.action_open) - self.menu_File.addAction(self.action_reload) - self.menu_File.addAction(self.action_exit) - self.menubar.addAction(self.menu_File.menuAction()) - - self.retranslateUi(MainWindow) - self.tabGroup.setCurrentIndex(0) - QtCore.QObject.connect(self.action_exit, QtCore.SIGNAL(_fromUtf8("activated()")), MainWindow.close) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - - def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None)) - self.filePosBox.setTitle(_translate("MainWindow", "File Position", None)) - self.filePosStopLabel.setText(_translate("MainWindow", "Stop", None)) - self.filePosLengthLabel.setText(_translate("MainWindow", "Length", None)) - self.filePosStartLabel.setText(_translate("MainWindow", "Start", None)) - self.fileTimeStartLabel.setText(_translate("MainWindow", "time start (sec)", None)) - self.fileTimeStopLabel.setText(_translate("MainWindow", "time stop (sec)", None)) - self.fileTimeLengthLabel.setText(_translate("MainWindow", "time length (sec)", None)) - self.displayGroupBox.setTitle(_translate("MainWindow", "Display Properties", None)) - self.lineWidthLabel.setText(_translate("MainWindow", "Line Width", None)) - self.lineStyleLabel.setText(_translate("MainWindow", "Line Style", None)) - self.styleSizeLabel.setText(_translate("MainWindow", "Style Size", None)) - self.sysGroupBox.setTitle(_translate("MainWindow", "System Properties", None)) - self.sampleRateLabel.setText(_translate("MainWindow", "Sample Rate", None)) - self.tabGroup.setTabText(self.tabGroup.indexOf(self.timeTab), _translate("MainWindow", "Time Domain", None)) - self.fftPropBox.setTitle(_translate("MainWindow", "FFT Properties", None)) - self.psdFFTSizeLabel.setText(_translate("MainWindow", "FFT Size", None)) - self.tabGroup.setTabText(self.tabGroup.indexOf(self.freqTab), _translate("MainWindow", "Frequency Domain", None)) - self.groupBox.setTitle(_translate("MainWindow", "Spectrogram Properties", None)) - self.specFFTLabel.setText(_translate("MainWindow", "FFT Size", None)) - self.tabGroup.setTabText(self.tabGroup.indexOf(self.specTab), _translate("MainWindow", "Spectrogram", None)) - self.menu_File.setTitle(_translate("MainWindow", "&File", None)) - self.action_open.setText(_translate("MainWindow", "&Open", None)) - self.action_open.setShortcut(_translate("MainWindow", "Ctrl+O", None)) - self.action_exit.setText(_translate("MainWindow", "E&xit", None)) - self.action_reload.setText(_translate("MainWindow", "&Reload", None)) - -from PyQt4 import Qwt5 diff --git a/gr-utils/python/utils/pyqt_plot.ui b/gr-utils/python/utils/pyqt_plot.ui deleted file mode 100644 index 7244d24c9d..0000000000 --- a/gr-utils/python/utils/pyqt_plot.ui +++ /dev/null @@ -1,514 +0,0 @@ -<ui version="4.0" > - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>927</width> - <height>718</height> - </rect> - </property> - <property name="windowTitle" > - <string>MainWindow</string> - </property> - <widget class="QWidget" name="centralwidget" > - <layout class="QGridLayout" name="gridLayout" > - <item row="1" column="0" colspan="3" > - <widget class="QScrollBar" name="plotHBar" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QGroupBox" name="filePosBox" > - <property name="minimumSize" > - <size> - <width>0</width> - <height>120</height> - </size> - </property> - <property name="title" > - <string>File Position</string> - </property> - <layout class="QGridLayout" name="gridLayout_4" > - <item row="0" column="0" > - <layout class="QFormLayout" name="filePosLayout" > - <item row="0" column="1" > - <widget class="QLineEdit" name="filePosStartLineEdit" > - <property name="minimumSize" > - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="filePosStopLabel" > - <property name="text" > - <string>Stop</string> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="filePosStopLineEdit" > - <property name="minimumSize" > - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="filePosLengthLabel" > - <property name="text" > - <string>Length</string> - </property> - </widget> - </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="filePosLengthLineEdit" > - <property name="minimumSize" > - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - <item row="0" column="0" > - <widget class="QLabel" name="filePosStartLabel" > - <property name="text" > - <string>Start</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="0" column="1" > - <layout class="QFormLayout" name="fileTimeLayout" > - <item row="0" column="0" > - <widget class="QLabel" name="fileTimeStartLabel" > - <property name="text" > - <string>time start (sec)</string> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="fileTimeStartLineEdit" > - <property name="minimumSize" > - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="fileTimeStopLabel" > - <property name="text" > - <string>time stop (sec)</string> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="fileTimeStopLineEdit" > - <property name="minimumSize" > - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="fileTimeLengthLabel" > - <property name="text" > - <string>time length (sec)</string> - </property> - </widget> - </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="fileTimeLengthLineEdit" > - <property name="minimumSize" > - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item row="2" column="2" > - <widget class="QGroupBox" name="displayGroupBox" > - <property name="minimumSize" > - <size> - <width>170</width> - <height>0</height> - </size> - </property> - <property name="title" > - <string>Display Properties</string> - </property> - <layout class="QGridLayout" name="gridLayout_2" > - <item row="0" column="0" colspan="2" > - <widget class="QComboBox" name="colorComboBox" /> - </item> - <item row="1" column="1" > - <widget class="QSpinBox" name="lineWidthSpinBox" > - <property name="minimumSize" > - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="lineWidthLabel" > - <property name="text" > - <string>Line Width</string> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="lineStyleLabel" > - <property name="text" > - <string>Line Style</string> - </property> - </widget> - </item> - <item row="2" column="1" > - <widget class="QComboBox" name="lineStyleComboBox" > - <property name="minimumSize" > - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="styleSizeLabel" > - <property name="text" > - <string>Style Size</string> - </property> - </widget> - </item> - <item row="3" column="1" > - <widget class="QSpinBox" name="styleSizeSpinBox" > - <property name="minimumSize" > - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="2" column="1" > - <widget class="QGroupBox" name="sysGroupBox" > - <property name="minimumSize" > - <size> - <width>200</width> - <height>0</height> - </size> - </property> - <property name="title" > - <string>System Properties</string> - </property> - <layout class="QFormLayout" name="formLayout" > - <property name="fieldGrowthPolicy" > - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="0" column="0" > - <widget class="QLabel" name="sampleRateLabel" > - <property name="text" > - <string>Sample Rate</string> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="sampleRateLineEdit" > - <property name="minimumSize" > - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>100</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="0" column="0" colspan="3" > - <widget class="QFrame" name="frame" > - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow" > - <enum>QFrame::Raised</enum> - </property> - <layout class="QGridLayout" name="gridLayout_3" > - <item row="0" column="0" > - <widget class="QTabWidget" name="tabGroup" > - <property name="minimumSize" > - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="currentIndex" > - <number>0</number> - </property> - <widget class="QWidget" name="timeTab" > - <attribute name="title" > - <string>Time Domain</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="QwtPlot" name="timePlot" /> - </item> - </layout> - <zorder>timePlot</zorder> - </widget> - <widget class="QWidget" name="freqTab" > - <attribute name="title" > - <string>Frequency Domain</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_2" > - <item> - <widget class="QGroupBox" name="fftPropBox" > - <property name="minimumSize" > - <size> - <width>160</width> - <height>0</height> - </size> - </property> - <property name="title" > - <string>FFT Properties</string> - </property> - <layout class="QFormLayout" name="formLayout_4" > - <property name="fieldGrowthPolicy" > - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="0" column="0" > - <widget class="QLabel" name="psdFFTSizeLabel" > - <property name="text" > - <string>FFT Size</string> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QComboBox" name="psdFFTComboBox" > - <property name="minimumSize" > - <size> - <width>96</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>96</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - </layout> - <zorder>psdFFTSizeLabel</zorder> - <zorder>psdFFTComboBox</zorder> - </widget> - </item> - <item> - <widget class="QwtPlot" name="freqPlot" /> - </item> - </layout> - </widget> - <widget class="QWidget" name="specTab" > - <attribute name="title" > - <string>Spectrogram</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_3" > - <item> - <widget class="QGroupBox" name="groupBox" > - <property name="title" > - <string>Spectrogram Properties</string> - </property> - <layout class="QFormLayout" name="formLayout_3" > - <item row="1" column="0" > - <widget class="QLabel" name="specFFTLabel" > - <property name="text" > - <string>FFT Size</string> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QComboBox" name="specFFTComboBox" > - <property name="minimumSize" > - <size> - <width>96</width> - <height>0</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>96</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QwtPlot" name="specPlot" /> - </item> - </layout> - <zorder>specPlot</zorder> - <zorder>groupBox</zorder> - </widget> - </widget> - </item> - </layout> - <zorder>tabGroup</zorder> - </widget> - </item> - </layout> - </widget> - <widget class="QMenuBar" name="menubar" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>927</width> - <height>24</height> - </rect> - </property> - <widget class="QMenu" name="menu_File" > - <property name="title" > - <string>&File</string> - </property> - <addaction name="action_open" /> - <addaction name="action_reload" /> - <addaction name="action_exit" /> - </widget> - <addaction name="menu_File" /> - </widget> - <widget class="QStatusBar" name="statusbar" /> - <action name="action_open" > - <property name="text" > - <string>&Open</string> - </property> - <property name="shortcut" > - <string>Ctrl+O</string> - </property> - </action> - <action name="action_exit" > - <property name="text" > - <string>E&xit</string> - </property> - </action> - <action name="action_reload" > - <property name="text" > - <string>&Reload</string> - </property> - </action> - </widget> - <customwidgets> - <customwidget> - <class>QwtPlot</class> - <extends>QFrame</extends> - <header>qwt_plot.h</header> - </customwidget> - </customwidgets> - <resources/> - <connections> - <connection> - <sender>action_exit</sender> - <signal>activated()</signal> - <receiver>MainWindow</receiver> - <slot>close()</slot> - <hints> - <hint type="sourcelabel" > - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel" > - <x>399</x> - <y>347</y> - </hint> - </hints> - </connection> - </connections> -</ui> |