diff options
Diffstat (limited to 'gr-utils/src')
-rw-r--r-- | gr-utils/src/python/Makefile.am | 11 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_filter_design.py | 673 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_qt.py | 643 | ||||
-rw-r--r-- | gr-utils/src/python/pyqt_filter.py | 426 | ||||
-rw-r--r-- | gr-utils/src/python/pyqt_filter.ui | 676 | ||||
-rw-r--r-- | gr-utils/src/python/pyqt_plot.py | 206 | ||||
-rw-r--r-- | gr-utils/src/python/pyqt_plot.ui | 389 |
7 files changed, 3022 insertions, 2 deletions
diff --git a/gr-utils/src/python/Makefile.am b/gr-utils/src/python/Makefile.am index 65cbd536c..59ca215a7 100644 --- a/gr-utils/src/python/Makefile.am +++ b/gr-utils/src/python/Makefile.am @@ -23,12 +23,16 @@ include $(top_srcdir)/Makefile.common EXTRA_DIST = \ $(bin_SCRIPTS) \ - README.plot + README.plot \ + pyqt_plot.ui \ + pyqt_filter.ui ourpythondir = $(grpythondir) ourpython_PYTHON = \ - plot_data.py + plot_data.py \ + pyqt_plot.py \ + pyqt_filter.py bin_SCRIPTS = \ gr_plot_char.py \ @@ -43,6 +47,8 @@ bin_SCRIPTS = \ gr_plot_int.py \ gr_plot_iq.py \ gr_plot_short.py \ + gr_plot_qt.py \ + gr_filter_design.py \ lsusrp \ qr_fft.py \ usrp_fft.py \ @@ -57,3 +63,4 @@ bin_SCRIPTS = \ usrp2_rx_cfile.py \ usrp2_siggen.py \ usrp2_siggen_gui.py + diff --git a/gr-utils/src/python/gr_filter_design.py b/gr-utils/src/python/gr_filter_design.py new file mode 100755 index 000000000..bf83cf69f --- /dev/null +++ b/gr-utils/src/python/gr_filter_design.py @@ -0,0 +1,673 @@ +#!/usr/bin/env python + +import sys, os +from optparse import OptionParser +from gnuradio import gr, blks2, eng_notation + +try: + import scipy + from scipy import fftpack +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + 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: + from pyqt_filter import Ui_MainWindow +except ImportError: + print "Could not import from pyqt_filter. Please build with \"pyuic4 pyqt_filter.ui -o pyqt_filter.py\"" + raise SystemExit, 1 + + +class gr_plot_filter(QtGui.QMainWindow): + def __init__(self, qapp, options): + QtGui.QWidget.__init__(self, None) + self.gui = Ui_MainWindow() + self.gui.setupUi(self) + + self.connect(self.gui.filterTypeComboBox, + Qt.SIGNAL("currentIndexChanged(const QString&)"), + self.changed_filter_type) + self.connect(self.gui.filterDesignTypeComboBox, + Qt.SIGNAL("currentIndexChanged(const QString&)"), + self.changed_filter_design_type) + + self.connect(self.gui.designButton, + Qt.SIGNAL("released()"), + self.design) + + self.connect(self.gui.tabGroup, + Qt.SIGNAL("currentChanged(int)"), + self.tab_changed) + + self.connect(self.gui.nfftEdit, + Qt.SIGNAL("textEdited(QString)"), + self.nfft_edit_changed) + + self.gui.designButton.setShortcut(QtCore.Qt.Key_Return) + + self.taps = [] + self.fftdB = [] + self.fftDeg = [] + self.groupDelay = [] + self.nfftpts = int(10000) + self.gui.nfftEdit.setText(Qt.QString("%1").arg(self.nfftpts)) + + self.firFilters = ("Low Pass", "Band Pass", "Complex Band Pass", "Band Notch", + "High Pass", "Root Raised Cosine", "Gaussian") + self.optFilters = ("Low Pass", "Band Pass", "Complex Band Pass", + "Band Notch", "High Pass") + + self.set_windowed() + + # Initialize to LPF + self.gui.filterTypeWidget.setCurrentWidget(self.gui.firlpfPage) + + # Set Axis labels + self.gui.freqPlot.setAxisTitle(self.gui.freqPlot.xBottom, + "Frequency (Hz)") + self.gui.freqPlot.setAxisTitle(self.gui.freqPlot.yLeft, + "Magnitude (dB)") + self.gui.timePlot.setAxisTitle(self.gui.timePlot.xBottom, + "Tap number") + self.gui.timePlot.setAxisTitle(self.gui.timePlot.yLeft, + "Amplitude") + self.gui.phasePlot.setAxisTitle(self.gui.phasePlot.xBottom, + "Frequency (Hz)") + self.gui.phasePlot.setAxisTitle(self.gui.phasePlot.yLeft, + "Phase (Radians)") + self.gui.groupPlot.setAxisTitle(self.gui.groupPlot.xBottom, + "Frequency (Hz)") + self.gui.groupPlot.setAxisTitle(self.gui.groupPlot.yLeft, + "Delay (sec)") + + # Set up plot curves + self.rcurve = Qwt.QwtPlotCurve("Real") + self.rcurve.attach(self.gui.timePlot) + self.icurve = Qwt.QwtPlotCurve("Imag") + self.icurve.attach(self.gui.timePlot) + + self.freqcurve = Qwt.QwtPlotCurve("PSD") + self.freqcurve.attach(self.gui.freqPlot) + + self.phasecurve = Qwt.QwtPlotCurve("Phase") + self.phasecurve.attach(self.gui.phasePlot) + + self.groupcurve = Qwt.QwtPlotCurve("Group Delay") + self.groupcurve.attach(self.gui.groupPlot) + + # 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.phaseZoomer = Qwt.QwtPlotZoomer(self.gui.phasePlot.xBottom, + self.gui.phasePlot.yLeft, + Qwt.QwtPicker.PointSelection, + Qwt.QwtPicker.AlwaysOn, + self.gui.phasePlot.canvas()) + + self.groupZoomer = Qwt.QwtPlotZoomer(self.gui.groupPlot.xBottom, + self.gui.groupPlot.yLeft, + Qwt.QwtPicker.PointSelection, + Qwt.QwtPicker.AlwaysOn, + self.gui.groupPlot.canvas()) + + # Set up pen for colors and line width + blue = QtGui.qRgb(0x00, 0x00, 0xFF) + blueBrush = Qt.QBrush(Qt.QColor(blue)) + red = QtGui.qRgb(0xFF, 0x00, 0x00) + redBrush = Qt.QBrush(Qt.QColor(red)) + self.freqcurve.setPen(Qt.QPen(blueBrush, 2)) + self.rcurve.setPen(Qt.QPen(blueBrush, 2)) + self.icurve.setPen(Qt.QPen(redBrush, 2)) + self.phasecurve.setPen(Qt.QPen(blueBrush, 2)) + self.groupcurve.setPen(Qt.QPen(blueBrush, 2)) + + # Set up validators for edit boxes + self.intVal = Qt.QIntValidator(None) + self.dblVal = Qt.QDoubleValidator(None) + self.gui.nfftEdit.setValidator(self.intVal) + self.gui.sampleRateEdit.setValidator(self.dblVal) + self.gui.filterGainEdit.setValidator(self.dblVal) + self.gui.endofLpfPassBandEdit.setValidator(self.dblVal) + self.gui.startofLpfStopBandEdit.setValidator(self.dblVal) + self.gui.lpfStopBandAttenEdit.setValidator(self.dblVal) + self.gui.lpfPassBandRippleEdit.setValidator(self.dblVal) + self.gui.startofBpfPassBandEdit.setValidator(self.dblVal) + self.gui.endofBpfPassBandEdit.setValidator(self.dblVal) + self.gui.bpfTransitionEdit.setValidator(self.dblVal) + self.gui.bpfStopBandAttenEdit.setValidator(self.dblVal) + self.gui.bpfPassBandRippleEdit.setValidator(self.dblVal) + self.gui.startofBnfStopBandEdit.setValidator(self.dblVal) + self.gui.endofBnfStopBandEdit.setValidator(self.dblVal) + self.gui.bnfTransitionEdit.setValidator(self.dblVal) + self.gui.bnfStopBandAttenEdit.setValidator(self.dblVal) + self.gui.bnfPassBandRippleEdit.setValidator(self.dblVal) + self.gui.endofHpfStopBandEdit.setValidator(self.dblVal) + self.gui.startofHpfPassBandEdit.setValidator(self.dblVal) + self.gui.hpfStopBandAttenEdit.setValidator(self.dblVal) + self.gui.hpfPassBandRippleEdit.setValidator(self.dblVal) + self.gui.rrcSymbolRateEdit.setValidator(self.dblVal) + self.gui.rrcAlphaEdit.setValidator(self.dblVal) + self.gui.rrcNumTapsEdit.setValidator(self.dblVal) + self.gui.gausSymbolRateEdit.setValidator(self.dblVal) + self.gui.gausBTEdit.setValidator(self.dblVal) + self.gui.gausNumTapsEdit.setValidator(self.dblVal) + + self.gui.nTapsEdit.setText("0") + + self.filterWindows = {"Hamming Window" : gr.firdes.WIN_HAMMING, + "Hann Window" : gr.firdes.WIN_HANN, + "Blackman Window" : gr.firdes.WIN_BLACKMAN, + "Rectangular Window" : gr.firdes.WIN_RECTANGULAR, + "Kaiser Window" : gr.firdes.WIN_KAISER, + "Blackman-harris Window" : gr.firdes.WIN_BLACKMAN_hARRIS} + + self.show() + + def changed_filter_type(self, ftype): + strftype = str(ftype.toAscii()) + if(ftype == "Low Pass"): + self.gui.filterTypeWidget.setCurrentWidget(self.gui.firlpfPage) + elif(ftype == "Band Pass"): + self.gui.filterTypeWidget.setCurrentWidget(self.gui.firbpfPage) + elif(ftype == "Complex Band Pass"): + self.gui.filterTypeWidget.setCurrentWidget(self.gui.firbpfPage) + elif(ftype == "Band Notch"): + self.gui.filterTypeWidget.setCurrentWidget(self.gui.firbnfPage) + elif(ftype == "High Pass"): + self.gui.filterTypeWidget.setCurrentWidget(self.gui.firhpfPage) + elif(ftype == "Root Raised Cosine"): + self.gui.filterTypeWidget.setCurrentWidget(self.gui.rrcPage) + elif(ftype == "Gaussian"): + self.gui.filterTypeWidget.setCurrentWidget(self.gui.gausPage) + + self.design() + + def changed_filter_design_type(self, design): + if(design == "Equiripple"): + self.set_equiripple() + else: + self.set_windowed() + + self.design() + + def set_equiripple(self): + # Stop sending the signal for this function + self.gui.filterTypeComboBox.blockSignals(True) + + self.equiripple = True + self.gui.lpfPassBandRippleLabel.setVisible(True) + self.gui.lpfPassBandRippleEdit.setVisible(True) + self.gui.bpfPassBandRippleLabel.setVisible(True) + self.gui.bpfPassBandRippleEdit.setVisible(True) + self.gui.bnfPassBandRippleLabel.setVisible(True) + self.gui.bnfPassBandRippleEdit.setVisible(True) + self.gui.hpfPassBandRippleLabel.setVisible(True) + self.gui.hpfPassBandRippleEdit.setVisible(True) + + # Save current type and repopulate the combo box for + # filters this window type can handle + currenttype = self.gui.filterTypeComboBox.currentText() + items = self.gui.filterTypeComboBox.count() + for i in xrange(items): + self.gui.filterTypeComboBox.removeItem(0) + self.gui.filterTypeComboBox.addItems(self.optFilters) + + # If the last filter type was valid for this window type, + # go back to it; otherwise, reset + try: + index = self.optFilters.index(currenttype) + self.gui.filterTypeComboBox.setCurrentIndex(index) + except ValueError: + pass + + # Tell gui its ok to start sending this signal again + self.gui.filterTypeComboBox.blockSignals(False) + + def set_windowed(self): + # Stop sending the signal for this function + self.gui.filterTypeComboBox.blockSignals(True) + + self.equiripple = False + self.gui.lpfPassBandRippleLabel.setVisible(False) + self.gui.lpfPassBandRippleEdit.setVisible(False) + self.gui.bpfPassBandRippleLabel.setVisible(False) + self.gui.bpfPassBandRippleEdit.setVisible(False) + self.gui.bnfPassBandRippleLabel.setVisible(False) + self.gui.bnfPassBandRippleEdit.setVisible(False) + self.gui.hpfPassBandRippleLabel.setVisible(False) + self.gui.hpfPassBandRippleEdit.setVisible(False) + + # Save current type and repopulate the combo box for + # filters this window type can handle + currenttype = self.gui.filterTypeComboBox.currentText() + items = self.gui.filterTypeComboBox.count() + for i in xrange(items): + self.gui.filterTypeComboBox.removeItem(0) + self.gui.filterTypeComboBox.addItems(self.firFilters) + + # If the last filter type was valid for this window type, + # go back to it; otherwise, reset + try: + index = self.optFilters.index(currenttype) + self.gui.filterTypeComboBox.setCurrentIndex(index) + except ValueError: + pass + + # Tell gui its ok to start sending this signal again + self.gui.filterTypeComboBox.blockSignals(False) + + def design(self): + ret = True + fs,r = self.gui.sampleRateEdit.text().toDouble() + ret = r and ret + gain,r = self.gui.filterGainEdit.text().toDouble() + ret = r and ret + + if(ret): + winstr = str(self.gui.filterDesignTypeComboBox.currentText().toAscii()) + ftype = str(self.gui.filterTypeComboBox.currentText().toAscii()) + + if(winstr == "Equiripple"): + designer = {"Low Pass" : self.design_opt_lpf, + "Band Pass" : self.design_opt_bpf, + "Complex Band Pass" : self.design_opt_cbpf, + "Band Notch" : self.design_opt_bnf, + "High Pass" : self.design_opt_hpf} + taps,r = designer[ftype](fs, gain) + + else: + designer = {"Low Pass" : self.design_win_lpf, + "Band Pass" : self.design_win_bpf, + "Complex Band Pass" : self.design_win_cbpf, + "Band Notch" : self.design_win_bnf, + "High Pass" : self.design_win_hpf, + "Root Raised Cosine" : self.design_win_rrc, + "Gaussian" : self.design_win_gaus} + wintype = self.filterWindows[winstr] + taps,r = designer[ftype](fs, gain, wintype) + + if(r): + self.taps = scipy.array(taps) + self.get_fft(fs, self.taps, self.nfftpts) + self.update_time_curves() + self.update_freq_curves() + self.update_phase_curves() + self.update_group_curves() + + self.gui.nTapsEdit.setText(Qt.QString("%1").arg(self.taps.size)) + + + # Filter design functions using a window + def design_win_lpf(self, fs, gain, wintype): + ret = True + pb,r = self.gui.endofLpfPassBandEdit.text().toDouble() + ret = r and ret + sb,r = self.gui.startofLpfStopBandEdit.text().toDouble() + ret = r and ret + atten,r = self.gui.lpfStopBandAttenEdit.text().toDouble() + ret = r and ret + + if(ret): + tb = sb - pb + + taps = gr.firdes.low_pass_2(gain, fs, pb, tb, + atten, wintype) + return (taps, ret) + else: + return ([], ret) + + def design_win_bpf(self, fs, gain, wintype): + ret = True + pb1,r = self.gui.startofBpfPassBandEdit.text().toDouble() + ret = r and ret + pb2,r = self.gui.endofBpfPassBandEdit.text().toDouble() + ret = r and ret + tb,r = self.gui.bpfTransitionEdit.text().toDouble() + ret = r and ret + atten,r = self.gui.bpfStopBandAttenEdit.text().toDouble() + ret = r and ret + + if(r): + taps = gr.firdes.band_pass_2(gain, fs, pb1, pb2, tb, + atten, wintype) + return (taps,r) + else: + return ([],r) + + def design_win_cbpf(self, fs, gain, wintype): + ret = True + pb1,r = self.gui.startofBpfPassBandEdit.text().toDouble() + ret = r and ret + pb2,r = self.gui.endofBpfPassBandEdit.text().toDouble() + ret = r and ret + tb,r = self.gui.bpfTransitionEdit.text().toDouble() + ret = r and ret + atten,r = self.gui.bpfStopBandAttenEdit.text().toDouble() + ret = r and ret + + if(r): + taps = gr.firdes.complex_band_pass_2(gain, fs, pb1, pb2, tb, + atten, wintype) + return (taps,r) + else: + return ([],r) + + def design_win_bnf(self, fs, gain, wintype): + ret = True + pb1,r = self.gui.startofBnfStopBandEdit.text().toDouble() + ret = r and ret + pb2,r = self.gui.endofBnfStopBandEdit.text().toDouble() + ret = r and ret + tb,r = self.gui.bnfTransitionEdit.text().toDouble() + ret = r and ret + atten,r = self.gui.bnfStopBandAttenEdit.text().toDouble() + ret = r and ret + + if(r): + taps = gr.firdes.band_reject_2(gain, fs, pb1, pb2, tb, + atten, wintype) + return (taps,r) + else: + return ([],r) + + def design_win_hpf(self, fs, gain, wintype): + ret = True + sb,r = self.gui.endofHpfStopBandEdit.text().toDouble() + ret = r and ret + pb,r = self.gui.startofHpfPassBandEdit.text().toDouble() + ret = r and ret + atten,r = self.gui.hpfStopBandAttenEdit.text().toDouble() + ret = r and ret + + if(r): + tb = pb - sb + taps = gr.firdes.high_pass_2(gain, fs, pb, tb, + atten, wintype) + return (taps,r) + else: + return ([],r) + + def design_win_rrc(self, fs, gain, wintype): + ret = True + sr,r = self.gui.rrcSymbolRateEdit.text().toDouble() + ret = r and ret + alpha,r = self.gui.rrcAlphaEdit.text().toDouble() + ret = r and ret + ntaps,r = self.gui.rrcNumTapsEdit.text().toInt() + ret = r and ret + + if(r): + taps = gr.firdes.root_raised_cosine(gain, fs, sr, + alpha, ntaps) + return (taps,r) + else: + return ([],r) + + def design_win_gaus(self, fs, gain, wintype): + ret = True + sr,r = self.gui.gausSymbolRateEdit.text().toDouble() + ret = r and ret + bt,r = self.gui.gausBTEdit.text().toDouble() + ret = r and ret + ntaps,r = self.gui.gausNumTapsEdit.text().toInt() + ret = r and ret + + if(r): + spb = fs / sr + taps = gr.firdes.gaussian(gain, spb, bt, ntaps) + return (taps,r) + else: + return ([],r) + + # Design Functions for Equiripple Filters + def design_opt_lpf(self, fs, gain): + ret = True + pb,r = self.gui.endofLpfPassBandEdit.text().toDouble() + ret = r and ret + sb,r = self.gui.startofLpfStopBandEdit.text().toDouble() + ret = r and ret + atten,r = self.gui.lpfStopBandAttenEdit.text().toDouble() + ret = r and ret + ripple,r = self.gui.lpfPassBandRippleEdit.text().toDouble() + ret = r and ret + + if(ret): + taps = blks2.optfir.low_pass(gain, fs, pb, sb, + ripple, atten) + return (taps, ret) + else: + return ([], ret) + + def design_opt_bpf(self, fs, gain): + ret = True + pb1,r = self.gui.startofBpfPassBandEdit.text().toDouble() + ret = r and ret + pb2,r = self.gui.endofBpfPassBandEdit.text().toDouble() + ret = r and ret + tb,r = self.gui.bpfTransitionEdit.text().toDouble() + ret = r and ret + atten,r = self.gui.bpfStopBandAttenEdit.text().toDouble() + ret = r and ret + ripple,r = self.gui.bpfPassBandRippleEdit.text().toDouble() + ret = r and ret + + if(r): + sb1 = pb1 - tb + sb2 = pb2 + tb + taps = blks2.optfir.band_pass(gain, fs, sb1, pb1, pb2, sb2, + ripple, atten) + return (taps,r) + else: + return ([],r) + + def design_opt_cbpf(self, fs, gain): + ret = True + pb1,r = self.gui.startofBpfPassBandEdit.text().toDouble() + ret = r and ret + pb2,r = self.gui.endofBpfPassBandEdit.text().toDouble() + ret = r and ret + tb,r = self.gui.bpfTransitionEdit.text().toDouble() + ret = r and ret + atten,r = self.gui.bpfStopBandAttenEdit.text().toDouble() + ret = r and ret + ripple,r = self.gui.bpfPassBandRippleEdit.text().toDouble() + ret = r and ret + + if(r): + sb1 = pb1 - tb + sb2 = pb2 + tb + taps = blks2.optfir.complex_band_pass(gain, fs, sb1, pb1, pb2, sb2, + ripple, atten) + return (taps,r) + else: + return ([],r) + + def design_opt_bnf(self, fs, gain): + ret = True + sb1,r = self.gui.startofBnfStopBandEdit.text().toDouble() + ret = r and ret + sb2,r = self.gui.endofBnfStopBandEdit.text().toDouble() + ret = r and ret + tb,r = self.gui.bnfTransitionEdit.text().toDouble() + ret = r and ret + atten,r = self.gui.bnfStopBandAttenEdit.text().toDouble() + ret = r and ret + ripple,r = self.gui.bnfPassBandRippleEdit.text().toDouble() + ret = r and ret + + if(r): + pb1 = sb1 - tb + pb2 = sb2 + tb + taps = blks2.optfir.band_reject(gain, fs, pb1, sb1, sb2, pb2, + ripple, atten) + return (taps,r) + else: + return ([],r) + + def design_opt_hpf(self, fs, gain): + ret = True + sb,r = self.gui.endofHpfStopBandEdit.text().toDouble() + ret = r and ret + pb,r = self.gui.startofHpfPassBandEdit.text().toDouble() + ret = r and ret + atten,r = self.gui.hpfStopBandAttenEdit.text().toDouble() + ret = r and ret + ripple,r = self.gui.hpfPassBandRippleEdit.text().toDouble() + ret = r and ret + + if(r): + taps = blks2.optfir.high_pass(gain, fs, sb, pb, + atten, ripple) + return (taps,r) + else: + return ([],r) + + def nfft_edit_changed(self, nfft): + infft,r = nfft.toInt() + if(r and (infft != self.nfftpts)): + self.nfftpts = infft + self.update_freq_curves() + + def tab_changed(self, tab): + if(tab == 0): + self.update_freq_curves() + if(tab == 1): + self.update_time_curves() + if(tab == 2): + self.update_phase_curves() + if(tab == 3): + self.update_group_curves() + + def get_fft(self, fs, taps, Npts): + Ts = 1.0/fs + fftpts = fftpack.fft(taps, Npts) + self.freq = scipy.arange(0, fs, 1.0/(Npts*Ts)) + self.fftdB = 20.0*scipy.log10(abs(fftpts)) + self.fftDeg = scipy.unwrap(scipy.angle(fftpts)) + self.groupDelay = -scipy.diff(self.fftDeg) + + def update_time_curves(self): + ntaps = len(self.taps) + if(ntaps > 0): + if(type(self.taps[0]) == scipy.complex128): + self.rcurve.setData(scipy.arange(ntaps), self.taps.real) + self.icurve.setData(scipy.arange(ntaps), self.taps.imag) + else: + self.rcurve.setData(scipy.arange(ntaps), self.taps) + + # Reset the x-axis to the new time scale + ymax = 1.5 * max(self.taps) + ymin = 1.5 * min(self.taps) + self.gui.timePlot.setAxisScale(self.gui.timePlot.xBottom, + 0, ntaps) + self.gui.timePlot.setAxisScale(self.gui.timePlot.yLeft, + ymin, ymax) + + # Set the zoomer base to unzoom to the new axis + self.timeZoomer.setZoomBase() + + self.gui.timePlot.replot() + + def update_freq_curves(self): + npts = len(self.fftdB) + if(npts > 0): + self.freqcurve.setData(self.freq, self.fftdB) + + # Reset the x-axis to the new time scale + ymax = 1.5 * max(self.fftdB[0:npts/2]) + ymin = 1.1 * min(self.fftdB[0:npts/2]) + xmax = self.freq[npts/2] + xmin = self.freq[0] + self.gui.freqPlot.setAxisScale(self.gui.freqPlot.xBottom, + xmin, xmax) + self.gui.freqPlot.setAxisScale(self.gui.freqPlot.yLeft, + ymin, ymax) + + # Set the zoomer base to unzoom to the new axis + self.freqZoomer.setZoomBase() + + self.gui.freqPlot.replot() + + + def update_phase_curves(self): + npts = len(self.fftDeg) + if(npts > 0): + self.phasecurve.setData(self.freq, self.fftDeg) + + # Reset the x-axis to the new time scale + ymax = 1.5 * max(self.fftDeg[0:npts/2]) + ymin = 1.1 * min(self.fftDeg[0:npts/2]) + xmax = self.freq[npts/2] + xmin = self.freq[0] + self.gui.phasePlot.setAxisScale(self.gui.phasePlot.xBottom, + xmin, xmax) + self.gui.phasePlot.setAxisScale(self.gui.phasePlot.yLeft, + ymin, ymax) + + # Set the zoomer base to unzoom to the new axis + self.phaseZoomer.setZoomBase() + + self.gui.phasePlot.replot() + + def update_group_curves(self): + npts = len(self.groupDelay) + if(npts > 0): + self.groupcurve.setData(self.freq, self.groupDelay) + + # Reset the x-axis to the new time scale + ymax = 1.5 * max(self.groupDelay[0:npts/2]) + ymin = 1.1 * min(self.groupDelay[0:npts/2]) + xmax = self.freq[npts/2] + xmin = self.freq[0] + self.gui.groupPlot.setAxisScale(self.gui.groupPlot.xBottom, + xmin, xmax) + self.gui.groupPlot.setAxisScale(self.gui.groupPlot.yLeft, + ymin, ymax) + + # Set the zoomer base to unzoom to the new axis + self.groupZoomer.setZoomBase() + + self.gui.groupPlot.replot() + + +def setup_options(): + usage="%prog: [options] (input_filename)" + description = "" + + parser = OptionParser(conflict_handler="resolve", + usage=usage, description=description) + return parser + +def main(args): + parser = setup_options() + (options, args) = parser.parse_args () + + app = Qt.QApplication(args) + gplt = gr_plot_filter(app, options) + app.exec_() + +if __name__ == '__main__': + main(sys.argv) + diff --git a/gr-utils/src/python/gr_plot_qt.py b/gr-utils/src/python/gr_plot_qt.py new file mode 100755 index 000000000..a5e3463c8 --- /dev/null +++ b/gr-utils/src/python/gr_plot_qt.py @@ -0,0 +1,643 @@ +#!/usr/bin/env python + +try: + import scipy + from scipy import fftpack +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + raise SystemExit, 1 + +import sys, os +from PyQt4 import Qt, QtCore, QtGui +import PyQt4.Qwt5 as Qwt +from matplotlib import mlab +from optparse import OptionParser +from gnuradio import eng_notation + +from pyqt_plot import Ui_MainWindow + +class SpectrogramData(Qwt.QwtRasterData): + + def __init__(self, f, t): + Qwt.QwtArrayData.__init__(self, Qt.QRectF(0, 0, 0, 0)) + self.sp = scipy.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): + f = int(self.freq.searchsorted(x)) + t = int(self.time.searchsorted(y)) + return self.sp[f][t-1] + + +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.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 = scipy.blackman + self.sizeof_data = 8 + self.datatype = scipy.complex64 + 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) + + + # 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()) + + self.picker = Qwt.QwtPlotPicker(self.gui.timePlot.xBottom, + self.gui.timePlot.yLeft, + Qwt.QwtPicker.PointSelection, + Qwt.QwtPlotPicker.CrossRubberBand, + Qwt.QwtPicker.AlwaysOn, + self.gui.timePlot.canvas()) + self.picker.connect(self.picker, + Qt.SIGNAL('selected(const QwtDoublePoint&)'), + self.clickMe) + + # 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) + + # 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) + + self.rcurve = Qwt.QwtPlotCurve("Real") + self.icurve = Qwt.QwtPlotCurve("Imaginary") + + 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"]() + + # 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 initialize(self, 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.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 = scipy.fromfile(self.hfile, dtype=self.datatype, + count=end-start) + + if(len(iq) < (end-start)): + end = len(iq) + self.gui.filePosLengthLineEdit.setText(Qt.QString("%1").arg(end)) + self.gui.plotHBar.setMaximum(end) + self.gui.plotHBar.setSingleStep(end) + self.file_length_changed() + + tstep = 1.0 / self.sample_rate + self.iq = iq + self.time = [tstep*(self.position + i) for i in xrange(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*scipy.log10(abs(fftpack.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*scipy.log10(abs(iq_spec)) + self.spec_f = f + self.spec_t = t + + def clickMe(self, qPoint): + print qPoint.x() + + 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 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: + self.set_file_pos_box(self.cur_start, self.cur_stop) + + 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() + + def color_black_on_white(self): + blue = QtGui.qRgb(0x00, 0x00, 0xFF) + red = QtGui.qRgb(0xFF, 0x00, 0x00) + + blackBrush = Qt.QBrush(Qt.QColor("black")) + blueBrush = Qt.QBrush(Qt.QColor(blue)) + redBrush = Qt.QBrush(Qt.QColor(red)) + + self.gui.timePlot.setCanvasBackground(Qt.QColor("white")) + self.gui.freqPlot.setCanvasBackground(Qt.QColor("white")) + self.picker.setTrackerPen(Qt.QPen(blackBrush, 2)) + self.timeZoomer.setTrackerPen(Qt.QPen(blackBrush, 2)) + self.timeZoomer.setRubberBandPen(Qt.QPen(blackBrush, 2)) + self.freqZoomer.setTrackerPen(Qt.QPen(blackBrush, 2)) + self.freqZoomer.setRubberBandPen(Qt.QPen(blackBrush, 2)) + self.psdcurve.setPen(Qt.QPen(blueBrush, 1)) + self.rcurve.setPen(Qt.QPen(blueBrush, 2)) + self.icurve.setPen(Qt.QPen(redBrush, 2)) + + 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.picker.setTrackerPen(Qt.QPen(whiteBrush, 2)) + self.timeZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2)) + self.timeZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2)) + self.freqZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2)) + self.freqZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2)) + self.psdcurve.setPen(Qt.QPen(whiteBrush, 1)) + self.rcurve.setPen(Qt.QPen(whiteBrush, 2)) + self.icurve.setPen(Qt.QPen(redBrush, 2)) + + 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.picker.setTrackerPen(Qt.QPen(whiteBrush, 2)) + self.timeZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2)) + self.timeZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2)) + self.freqZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2)) + self.freqZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2)) + self.psdcurve.setPen(Qt.QPen(greenBrush, 1)) + self.rcurve.setPen(Qt.QPen(greenBrush, 2)) + self.icurve.setPen(Qt.QPen(redBrush, 2)) + + 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.picker.setTrackerPen(Qt.QPen(whiteBrush, 2)) + self.timeZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2)) + self.timeZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2)) + self.freqZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2)) + self.freqZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2)) + self.psdcurve.setPen(Qt.QPen(blueBrush, 1)) + self.rcurve.setPen(Qt.QPen(blueBrush, 2)) + self.icurve.setPen(Qt.QPen(redBrush, 2)) + + 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/src/python/pyqt_filter.py b/gr-utils/src/python/pyqt_filter.py new file mode 100644 index 000000000..12ad183b0 --- /dev/null +++ b/gr-utils/src/python/pyqt_filter.py @@ -0,0 +1,426 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'pyqt_filter.ui' +# +# Created: Tue Aug 25 11:13:57 2009 +# by: PyQt4 UI code generator 4.4.3 +# +# WARNING! All changes made in this file will be lost! + +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(QtCore.QString()) + self.filterTypeComboBox.addItem(QtCore.QString()) + self.filterTypeComboBox.addItem(QtCore.QString()) + self.filterTypeComboBox.addItem(QtCore.QString()) + self.filterTypeComboBox.addItem(QtCore.QString()) + self.filterTypeComboBox.addItem(QtCore.QString()) + self.filterTypeComboBox.addItem(QtCore.QString()) + self.verticalLayout.addWidget(self.filterTypeComboBox) + self.filterDesignTypeComboBox = QtGui.QComboBox(self.filterFrame) + self.filterDesignTypeComboBox.setObjectName("filterDesignTypeComboBox") + self.filterDesignTypeComboBox.addItem(QtCore.QString()) + self.filterDesignTypeComboBox.addItem(QtCore.QString()) + self.filterDesignTypeComboBox.addItem(QtCore.QString()) + self.filterDesignTypeComboBox.addItem(QtCore.QString()) + self.filterDesignTypeComboBox.addItem(QtCore.QString()) + self.filterDesignTypeComboBox.addItem(QtCore.QString()) + self.filterDesignTypeComboBox.addItem(QtCore.QString()) + 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.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 = Qwt5.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 = Qwt5.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 = Qwt5.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 = Qwt5.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, 24)) + 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_open = QtGui.QAction(MainWindow) + self.action_open.setObjectName("action_open") + self.action_exit = QtGui.QAction(MainWindow) + self.action_exit.setObjectName("action_exit") + self.menu_File.addAction(self.action_exit) + self.menubar.addAction(self.menu_File.menuAction()) + + self.retranslateUi(MainWindow) + self.filterTypeWidget.setCurrentIndex(0) + 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_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)) + self.action_exit.setText(QtGui.QApplication.translate("MainWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8)) + +from PyQt4 import Qwt5 diff --git a/gr-utils/src/python/pyqt_filter.ui b/gr-utils/src/python/pyqt_filter.ui new file mode 100644 index 000000000..9b31112e8 --- /dev/null +++ b/gr-utils/src/python/pyqt_filter.ui @@ -0,0 +1,676 @@ +<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>0</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>24</height> + </rect> + </property> + <widget class="QMenu" name="menu_File" > + <property name="title" > + <string>&File</string> + </property> + <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> + </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/src/python/pyqt_plot.py b/gr-utils/src/python/pyqt_plot.py new file mode 100644 index 000000000..74c43c3eb --- /dev/null +++ b/gr-utils/src/python/pyqt_plot.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'pyqt_plot.ui' +# +# Created: Tue Aug 25 18:18:14 2009 +# by: PyQt4 UI code generator 4.4.3 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(927, 696) + self.centralwidget = QtGui.QWidget(MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout = QtGui.QGridLayout(self.centralwidget) + self.gridLayout.setObjectName("gridLayout") + self.plotHBar = QtGui.QScrollBar(self.centralwidget) + self.plotHBar.setOrientation(QtCore.Qt.Horizontal) + self.plotHBar.setObjectName("plotHBar") + self.gridLayout.addWidget(self.plotHBar, 2, 0, 1, 2) + self.tabGroup = QtGui.QTabWidget(self.centralwidget) + self.tabGroup.setObjectName("tabGroup") + self.timeTab = QtGui.QWidget() + self.timeTab.setObjectName("timeTab") + self.horizontalLayout = QtGui.QHBoxLayout(self.timeTab) + self.horizontalLayout.setObjectName("horizontalLayout") + self.timePlot = Qwt5.QwtPlot(self.timeTab) + self.timePlot.setObjectName("timePlot") + self.horizontalLayout.addWidget(self.timePlot) + self.tabGroup.addTab(self.timeTab, "") + self.freqTab = QtGui.QWidget() + self.freqTab.setObjectName("freqTab") + self.horizontalLayout_2 = QtGui.QHBoxLayout(self.freqTab) + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.fftPropBox = QtGui.QGroupBox(self.freqTab) + self.fftPropBox.setMinimumSize(QtCore.QSize(160, 0)) + self.fftPropBox.setObjectName("fftPropBox") + self.formLayout_4 = QtGui.QFormLayout(self.fftPropBox) + self.formLayout_4.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) + self.formLayout_4.setObjectName("formLayout_4") + self.psdFFTComboBox = QtGui.QComboBox(self.fftPropBox) + self.psdFFTComboBox.setMinimumSize(QtCore.QSize(96, 0)) + self.psdFFTComboBox.setMaximumSize(QtCore.QSize(96, 16777215)) + self.psdFFTComboBox.setObjectName("psdFFTComboBox") + self.formLayout_4.setWidget(0, QtGui.QFormLayout.FieldRole, self.psdFFTComboBox) + self.psdFFTSizeLabel = QtGui.QLabel(self.fftPropBox) + self.psdFFTSizeLabel.setObjectName("psdFFTSizeLabel") + self.formLayout_4.setWidget(0, QtGui.QFormLayout.LabelRole, self.psdFFTSizeLabel) + self.horizontalLayout_2.addWidget(self.fftPropBox) + self.freqPlot = Qwt5.QwtPlot(self.freqTab) + self.freqPlot.setObjectName("freqPlot") + self.horizontalLayout_2.addWidget(self.freqPlot) + self.tabGroup.addTab(self.freqTab, "") + self.specTab = QtGui.QWidget() + self.specTab.setObjectName("specTab") + self.horizontalLayout_3 = QtGui.QHBoxLayout(self.specTab) + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.groupBox = QtGui.QGroupBox(self.specTab) + self.groupBox.setObjectName("groupBox") + self.formLayout_3 = QtGui.QFormLayout(self.groupBox) + self.formLayout_3.setObjectName("formLayout_3") + self.specFFTLabel = QtGui.QLabel(self.groupBox) + self.specFFTLabel.setObjectName("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("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("specPlot") + self.horizontalLayout_3.addWidget(self.specPlot) + self.tabGroup.addTab(self.specTab, "") + self.gridLayout.addWidget(self.tabGroup, 1, 0, 1, 1) + self.filePosBox = QtGui.QGroupBox(self.centralwidget) + self.filePosBox.setMinimumSize(QtCore.QSize(0, 120)) + self.filePosBox.setObjectName("filePosBox") + self.formLayoutWidget_2 = QtGui.QWidget(self.filePosBox) + self.formLayoutWidget_2.setGeometry(QtCore.QRect(0, 20, 160, 92)) + self.formLayoutWidget_2.setObjectName("formLayoutWidget_2") + self.filePosLayout = QtGui.QFormLayout(self.formLayoutWidget_2) + self.filePosLayout.setObjectName("filePosLayout") + self.filePosStartLabel = QtGui.QLabel(self.formLayoutWidget_2) + self.filePosStartLabel.setObjectName("filePosStartLabel") + self.filePosLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.filePosStartLabel) + self.filePosStartLineEdit = QtGui.QLineEdit(self.formLayoutWidget_2) + self.filePosStartLineEdit.setObjectName("filePosStartLineEdit") + self.filePosLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.filePosStartLineEdit) + self.filePosStopLabel = QtGui.QLabel(self.formLayoutWidget_2) + self.filePosStopLabel.setObjectName("filePosStopLabel") + self.filePosLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.filePosStopLabel) + self.filePosStopLineEdit = QtGui.QLineEdit(self.formLayoutWidget_2) + self.filePosStopLineEdit.setObjectName("filePosStopLineEdit") + self.filePosLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.filePosStopLineEdit) + self.filePosLengthLabel = QtGui.QLabel(self.formLayoutWidget_2) + self.filePosLengthLabel.setObjectName("filePosLengthLabel") + self.filePosLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.filePosLengthLabel) + self.filePosLengthLineEdit = QtGui.QLineEdit(self.formLayoutWidget_2) + self.filePosLengthLineEdit.setObjectName("filePosLengthLineEdit") + self.filePosLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.filePosLengthLineEdit) + self.formLayoutWidget_4 = QtGui.QWidget(self.filePosBox) + self.formLayoutWidget_4.setGeometry(QtCore.QRect(180, 20, 231, 92)) + self.formLayoutWidget_4.setObjectName("formLayoutWidget_4") + self.fileTimeLayout = QtGui.QFormLayout(self.formLayoutWidget_4) + self.fileTimeLayout.setObjectName("fileTimeLayout") + self.fileTimeStartLabel = QtGui.QLabel(self.formLayoutWidget_4) + self.fileTimeStartLabel.setObjectName("fileTimeStartLabel") + self.fileTimeLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.fileTimeStartLabel) + self.fileTimeStartLineEdit = QtGui.QLineEdit(self.formLayoutWidget_4) + self.fileTimeStartLineEdit.setObjectName("fileTimeStartLineEdit") + self.fileTimeLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.fileTimeStartLineEdit) + self.fileTimeStopLabel = QtGui.QLabel(self.formLayoutWidget_4) + self.fileTimeStopLabel.setObjectName("fileTimeStopLabel") + self.fileTimeLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.fileTimeStopLabel) + self.fileTimeStopLineEdit = QtGui.QLineEdit(self.formLayoutWidget_4) + self.fileTimeStopLineEdit.setObjectName("fileTimeStopLineEdit") + self.fileTimeLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.fileTimeStopLineEdit) + self.fileTimeLengthLabel = QtGui.QLabel(self.formLayoutWidget_4) + self.fileTimeLengthLabel.setObjectName("fileTimeLengthLabel") + self.fileTimeLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.fileTimeLengthLabel) + self.fileTimeLengthLineEdit = QtGui.QLineEdit(self.formLayoutWidget_4) + self.fileTimeLengthLineEdit.setObjectName("fileTimeLengthLineEdit") + self.fileTimeLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.fileTimeLengthLineEdit) + self.sysGroupBox = QtGui.QGroupBox(self.filePosBox) + self.sysGroupBox.setGeometry(QtCore.QRect(530, 0, 200, 120)) + self.sysGroupBox.setMinimumSize(QtCore.QSize(200, 0)) + self.sysGroupBox.setObjectName("sysGroupBox") + self.formLayoutWidget_3 = QtGui.QWidget(self.sysGroupBox) + self.formLayoutWidget_3.setGeometry(QtCore.QRect(0, 20, 191, 91)) + self.formLayoutWidget_3.setObjectName("formLayoutWidget_3") + self.formLayout_2 = QtGui.QFormLayout(self.formLayoutWidget_3) + self.formLayout_2.setObjectName("formLayout_2") + self.sampleRateLabel = QtGui.QLabel(self.formLayoutWidget_3) + self.sampleRateLabel.setObjectName("sampleRateLabel") + self.formLayout_2.setWidget(0, QtGui.QFormLayout.LabelRole, self.sampleRateLabel) + self.sampleRateLineEdit = QtGui.QLineEdit(self.formLayoutWidget_3) + self.sampleRateLineEdit.setMinimumSize(QtCore.QSize(0, 0)) + self.sampleRateLineEdit.setObjectName("sampleRateLineEdit") + self.formLayout_2.setWidget(0, QtGui.QFormLayout.FieldRole, self.sampleRateLineEdit) + self.displayGroupBox = QtGui.QGroupBox(self.filePosBox) + self.displayGroupBox.setGeometry(QtCore.QRect(730, 0, 170, 120)) + self.displayGroupBox.setMinimumSize(QtCore.QSize(170, 0)) + self.displayGroupBox.setObjectName("displayGroupBox") + self.verticalLayoutWidget = QtGui.QWidget(self.displayGroupBox) + self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 20, 160, 91)) + self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") + self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget) + self.verticalLayout.setObjectName("verticalLayout") + self.colorComboBox = QtGui.QComboBox(self.verticalLayoutWidget) + self.colorComboBox.setObjectName("colorComboBox") + self.verticalLayout.addWidget(self.colorComboBox) + spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.verticalLayout.addItem(spacerItem) + self.gridLayout.addWidget(self.filePosBox, 3, 0, 1, 1) + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QtGui.QMenuBar(MainWindow) + self.menubar.setGeometry(QtCore.QRect(0, 0, 927, 24)) + 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_open = QtGui.QAction(MainWindow) + self.action_open.setObjectName("action_open") + self.action_exit = QtGui.QAction(MainWindow) + self.action_exit.setObjectName("action_exit") + self.menu_File.addAction(self.action_open) + 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("activated()"), MainWindow.close) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8)) + self.tabGroup.setTabText(self.tabGroup.indexOf(self.timeTab), QtGui.QApplication.translate("MainWindow", "Time Domain", None, QtGui.QApplication.UnicodeUTF8)) + self.fftPropBox.setTitle(QtGui.QApplication.translate("MainWindow", "FFT Properties", None, QtGui.QApplication.UnicodeUTF8)) + self.psdFFTSizeLabel.setText(QtGui.QApplication.translate("MainWindow", "FFT Size", None, QtGui.QApplication.UnicodeUTF8)) + self.tabGroup.setTabText(self.tabGroup.indexOf(self.freqTab), QtGui.QApplication.translate("MainWindow", "Frequency Domain", None, QtGui.QApplication.UnicodeUTF8)) + self.groupBox.setTitle(QtGui.QApplication.translate("MainWindow", "Spectrogram Properties", None, QtGui.QApplication.UnicodeUTF8)) + self.specFFTLabel.setText(QtGui.QApplication.translate("MainWindow", "FFT Size", None, QtGui.QApplication.UnicodeUTF8)) + self.tabGroup.setTabText(self.tabGroup.indexOf(self.specTab), QtGui.QApplication.translate("MainWindow", "Spectrogram", None, QtGui.QApplication.UnicodeUTF8)) + self.filePosBox.setTitle(QtGui.QApplication.translate("MainWindow", "File Position", None, QtGui.QApplication.UnicodeUTF8)) + self.filePosStartLabel.setText(QtGui.QApplication.translate("MainWindow", "Start", None, QtGui.QApplication.UnicodeUTF8)) + self.filePosStopLabel.setText(QtGui.QApplication.translate("MainWindow", "Stop", None, QtGui.QApplication.UnicodeUTF8)) + self.filePosLengthLabel.setText(QtGui.QApplication.translate("MainWindow", "Length", None, QtGui.QApplication.UnicodeUTF8)) + self.fileTimeStartLabel.setText(QtGui.QApplication.translate("MainWindow", "time start (sec)", None, QtGui.QApplication.UnicodeUTF8)) + self.fileTimeStopLabel.setText(QtGui.QApplication.translate("MainWindow", "time stop (sec)", None, QtGui.QApplication.UnicodeUTF8)) + self.fileTimeLengthLabel.setText(QtGui.QApplication.translate("MainWindow", "time length (sec)", None, QtGui.QApplication.UnicodeUTF8)) + self.sysGroupBox.setTitle(QtGui.QApplication.translate("MainWindow", "System Properties", None, QtGui.QApplication.UnicodeUTF8)) + self.sampleRateLabel.setText(QtGui.QApplication.translate("MainWindow", "Sample Rate", None, QtGui.QApplication.UnicodeUTF8)) + self.displayGroupBox.setTitle(QtGui.QApplication.translate("MainWindow", "Display Properties", None, QtGui.QApplication.UnicodeUTF8)) + self.menu_File.setTitle(QtGui.QApplication.translate("MainWindow", "&File", 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)) + self.action_exit.setText(QtGui.QApplication.translate("MainWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8)) + +from PyQt4 import Qwt5 diff --git a/gr-utils/src/python/pyqt_plot.ui b/gr-utils/src/python/pyqt_plot.ui new file mode 100644 index 000000000..19a62adf5 --- /dev/null +++ b/gr-utils/src/python/pyqt_plot.ui @@ -0,0 +1,389 @@ +<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>696</height> + </rect> + </property> + <property name="windowTitle" > + <string>MainWindow</string> + </property> + <widget class="QWidget" name="centralwidget" > + <layout class="QGridLayout" name="gridLayout" > + <item row="2" column="0" colspan="2" > + <widget class="QScrollBar" name="plotHBar" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QTabWidget" name="tabGroup" > + <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> + </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="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> + <item row="0" column="0" > + <widget class="QLabel" name="psdFFTSizeLabel" > + <property name="text" > + <string>FFT Size</string> + </property> + </widget> + </item> + </layout> + </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> + <item row="3" 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> + <widget class="QWidget" name="formLayoutWidget_2" > + <property name="geometry" > + <rect> + <x>0</x> + <y>20</y> + <width>160</width> + <height>92</height> + </rect> + </property> + <layout class="QFormLayout" name="filePosLayout" > + <item row="0" column="0" > + <widget class="QLabel" name="filePosStartLabel" > + <property name="text" > + <string>Start</string> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QLineEdit" name="filePosStartLineEdit" /> + </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" /> + </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" /> + </item> + </layout> + </widget> + <widget class="QWidget" name="formLayoutWidget_4" > + <property name="geometry" > + <rect> + <x>180</x> + <y>20</y> + <width>231</width> + <height>92</height> + </rect> + </property> + <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" /> + </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" /> + </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" /> + </item> + </layout> + </widget> + <widget class="QGroupBox" name="sysGroupBox" > + <property name="geometry" > + <rect> + <x>530</x> + <y>0</y> + <width>200</width> + <height>120</height> + </rect> + </property> + <property name="minimumSize" > + <size> + <width>200</width> + <height>0</height> + </size> + </property> + <property name="title" > + <string>System Properties</string> + </property> + <widget class="QWidget" name="formLayoutWidget_3" > + <property name="geometry" > + <rect> + <x>0</x> + <y>20</y> + <width>191</width> + <height>91</height> + </rect> + </property> + <layout class="QFormLayout" name="formLayout_2" > + <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>0</width> + <height>0</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> + </widget> + <widget class="QGroupBox" name="displayGroupBox" > + <property name="geometry" > + <rect> + <x>730</x> + <y>0</y> + <width>170</width> + <height>120</height> + </rect> + </property> + <property name="minimumSize" > + <size> + <width>170</width> + <height>0</height> + </size> + </property> + <property name="title" > + <string>Display Properties</string> + </property> + <widget class="QWidget" name="verticalLayoutWidget" > + <property name="geometry" > + <rect> + <x>0</x> + <y>20</y> + <width>160</width> + <height>91</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QComboBox" name="colorComboBox" /> + </item> + <item> + <spacer name="verticalSpacer" > + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </widget> + </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_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> + </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> |