5 from scipy import fftpack
7 print "Please install SciPy to run this script (http://www.scipy.org/)"
11 from PyQt4 import Qt, QtCore, QtGui
12 import PyQt4.Qwt5 as Qwt
13 from matplotlib import mlab
14 from optparse import OptionParser
15 from gnuradio import eng_notation
17 from pyqt_plot import Ui_MainWindow
19 class SpectrogramData(Qwt.QwtRasterData):
21 def __init__(self, f, t):
22 Qwt.QwtArrayData.__init__(self, Qt.QRectF(0, 0, 0, 0))
23 self.sp = scipy.array([[0], [0]])
25 def set_data(self, xfreq, ytime, data):
29 boundingBox = Qt.QRectF(self.freq.min(), self.time.min(),
30 self.freq.max() - self.freq.min(),
31 self.time.max() - self.time.min())
32 self.setBoundingRect(boundingBox)
34 def rasterHint(self, rect):
35 return Qt.QSize(self.sp.shape[0], self.sp.shape[1])
42 return Qwt.QwtDoubleInterval(self.sp.min(), self.sp.max())
44 def value(self, x, y):
45 f = int(self.freq.searchsorted(x))
46 t = int(self.time.searchsorted(y))
47 return self.sp[f][t-1]
50 class gr_plot_qt(QtGui.QMainWindow):
51 def __init__(self, qapp, filename, options, parent=None):
52 QtGui.QWidget.__init__(self, parent)
53 self.gui = Ui_MainWindow()
54 self.gui.setupUi(self)
56 self.block_length = options.block_length
57 self.start = options.start
58 self.sample_rate = options.sample_rate
59 self.psdfftsize = options.psd_size
60 self.specfftsize = options.spec_size
61 self.winfunc = scipy.blackman
63 self.datatype = scipy.complex64
67 # Set up basic plot attributes
68 self.gui.timePlot.setAxisTitle(self.gui.timePlot.xBottom, "Time (sec)")
69 self.gui.timePlot.setAxisTitle(self.gui.timePlot.yLeft, "Amplitude (V)")
70 self.gui.freqPlot.setAxisTitle(self.gui.freqPlot.xBottom, "Frequency (Hz)")
71 self.gui.freqPlot.setAxisTitle(self.gui.freqPlot.yLeft, "Magnitude (dB)")
72 self.gui.specPlot.setAxisTitle(self.gui.specPlot.xBottom, "Frequency (Hz)")
73 self.gui.specPlot.setAxisTitle(self.gui.specPlot.yLeft, "Time (sec)")
75 # Set up FFT size combo box
76 self.fftsizes = ["128", "256", "512", "1024", "2048",
77 "4096", "8192", "16384", "32768"]
78 self.gui.psdFFTComboBox.addItems(self.fftsizes)
79 self.gui.specFFTComboBox.addItems(self.fftsizes)
80 pos = self.gui.psdFFTComboBox.findText(Qt.QString("%1").arg(self.psdfftsize))
81 self.gui.psdFFTComboBox.setCurrentIndex(pos)
82 pos = self.gui.specFFTComboBox.findText(Qt.QString("%1").arg(self.specfftsize))
83 self.gui.specFFTComboBox.setCurrentIndex(pos)
85 self.connect(self.gui.psdFFTComboBox,
86 Qt.SIGNAL("activated (const QString&)"),
87 self.psdFFTComboBoxEdit)
88 self.connect(self.gui.specFFTComboBox,
89 Qt.SIGNAL("activated (const QString&)"),
90 self.specFFTComboBoxEdit)
92 # Set up color scheme box
93 self.color_modes = {"Black on White" : self.color_black_on_white,
94 "White on Black" : self.color_white_on_black,
95 "Blue on Black" : self.color_blue_on_black,
96 "Green on Black" : self.color_green_on_black}
97 self.gui.colorComboBox.addItems(self.color_modes.keys())
98 pos = self.gui.colorComboBox.findText("Blue on Black")
99 self.gui.colorComboBox.setCurrentIndex(pos)
100 self.connect(self.gui.colorComboBox,
101 Qt.SIGNAL("activated (const QString&)"),
102 self.colorComboBoxEdit)
105 # Create zoom functionality for the plots
106 self.timeZoomer = Qwt.QwtPlotZoomer(self.gui.timePlot.xBottom,
107 self.gui.timePlot.yLeft,
108 Qwt.QwtPicker.PointSelection,
109 Qwt.QwtPicker.AlwaysOn,
110 self.gui.timePlot.canvas())
112 self.freqZoomer = Qwt.QwtPlotZoomer(self.gui.freqPlot.xBottom,
113 self.gui.freqPlot.yLeft,
114 Qwt.QwtPicker.PointSelection,
115 Qwt.QwtPicker.AlwaysOn,
116 self.gui.freqPlot.canvas())
118 self.specZoomer = Qwt.QwtPlotZoomer(self.gui.specPlot.xBottom,
119 self.gui.specPlot.yLeft,
120 Qwt.QwtPicker.PointSelection,
121 Qwt.QwtPicker.AlwaysOn,
122 self.gui.specPlot.canvas())
124 self.picker = Qwt.QwtPlotPicker(self.gui.timePlot.xBottom,
125 self.gui.timePlot.yLeft,
126 Qwt.QwtPicker.PointSelection,
127 Qwt.QwtPlotPicker.CrossRubberBand,
128 Qwt.QwtPicker.AlwaysOn,
129 self.gui.timePlot.canvas())
130 self.picker.connect(self.picker,
131 Qt.SIGNAL('selected(const QwtDoublePoint&)'),
134 # Set up action when tab is changed
135 self.connect(self.gui.tabGroup,
136 Qt.SIGNAL("currentChanged (int)"),
139 # Add a legend to the Time plot
140 legend_real = Qwt.QwtLegend()
141 self.gui.timePlot.insertLegend(legend_real)
144 self.gui.plotHBar.setSingleStep(1)
145 self.gui.plotHBar.setPageStep(self.block_length)
146 self.gui.plotHBar.setMinimum(0)
147 self.gui.plotHBar.setMaximum(self.block_length)
148 self.connect(self.gui.plotHBar,
149 Qt.SIGNAL("valueChanged(int)"),
152 # Connect Open action to Open Dialog box
153 self.connect(self.gui.action_open,
154 Qt.SIGNAL("activated()"),
157 # Set up file position boxes to update current figure
158 self.connect(self.gui.filePosStartLineEdit,
159 Qt.SIGNAL("editingFinished()"),
160 self.file_position_changed)
161 self.connect(self.gui.filePosStopLineEdit,
162 Qt.SIGNAL("editingFinished()"),
163 self.file_position_changed)
164 self.connect(self.gui.filePosLengthLineEdit,
165 Qt.SIGNAL("editingFinished()"),
166 self.file_length_changed)
168 self.connect(self.gui.fileTimeStartLineEdit,
169 Qt.SIGNAL("editingFinished()"),
170 self.file_time_changed)
171 self.connect(self.gui.fileTimeStopLineEdit,
172 Qt.SIGNAL("editingFinished()"),
173 self.file_time_changed)
174 self.connect(self.gui.fileTimeLengthLineEdit,
175 Qt.SIGNAL("editingFinished()"),
176 self.file_time_length_changed)
178 self.rcurve = Qwt.QwtPlotCurve("Real")
179 self.icurve = Qwt.QwtPlotCurve("Imaginary")
181 self.icurve.attach(self.gui.timePlot)
182 self.rcurve.attach(self.gui.timePlot)
184 self.psdcurve = Qwt.QwtPlotCurve("PSD")
185 self.psdcurve.attach(self.gui.freqPlot)
187 # Set up specTab plot as a spectrogram
188 self.specdata = SpectrogramData(range(0, 10), range(0, 10))
190 colorMap = Qwt.QwtLinearColorMap(Qt.Qt.darkCyan, Qt.Qt.red)
191 colorMap.addColorStop(0.1, Qt.Qt.cyan)
192 colorMap.addColorStop(0.6, Qt.Qt.green)
193 colorMap.addColorStop(0.95, Qt.Qt.yellow)
195 self.spec = Qwt.QwtPlotSpectrogram()
196 self.spec.setColorMap(colorMap)
197 self.spec.attach(self.gui.specPlot)
198 self.spec.setContourLevels([0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5])
199 self.spec.setDisplayMode(Qwt.QwtPlotSpectrogram.ImageMode, True)
200 self.spec.setData(self.specdata)
202 # Set up initial color scheme
203 self.color_modes["Blue on Black"]()
205 # Connect a signal for when the sample rate changes
206 self.set_sample_rate(self.sample_rate)
207 self.connect(self.gui.sampleRateLineEdit,
208 Qt.SIGNAL("editingFinished()"),
209 self.sample_rate_changed)
211 if(filename is not None):
212 self.initialize(filename)
217 filename = Qt.QFileDialog.getOpenFileName(self, "Open", ".")
220 self.initialize(filename)
222 def initialize(self, filename):
223 self.hfile = open(filename, "r")
225 self.setWindowTitle(("GNU Radio File Plot Utility: %s" % filename))
227 self.gui.filePosStartLineEdit.setText("0")
228 self.gui.filePosStopLineEdit.setText("0")
229 self.gui.fileTimeStartLineEdit.setText("0")
230 self.gui.fileTimeStopLineEdit.setText("0")
233 self.cur_stop = self.block_length
235 self.init_data_input()
236 self.get_data(self.cur_start, self.cur_stop)
239 self.gui.plotHBar.setSliderPosition(0)
240 self.gui.plotHBar.setMaximum(self.signal_size)
243 self.update_time_curves()
244 self.update_psd_curves()
245 self.update_specgram_curves()
247 def init_data_input(self):
248 self.hfile.seek(0, os.SEEK_END)
249 self.signal_size = self.hfile.tell()/self.sizeof_data
250 print "Sizeof File: ", self.signal_size
251 self.hfile.seek(0, os.SEEK_SET)
253 def get_data(self, start, end):
255 self.hfile.seek(start*self.sizeof_data, os.SEEK_SET)
256 self.position = start
258 iq = scipy.fromfile(self.hfile, dtype=self.datatype,
261 if(len(iq) < (end-start)):
263 self.gui.filePosLengthLineEdit.setText(Qt.QString("%1").arg(end))
264 self.gui.plotHBar.setMaximum(end)
265 self.gui.plotHBar.setSingleStep(end)
266 self.file_length_changed()
268 tstep = 1.0 / self.sample_rate
270 self.time = [tstep*(self.position + i) for i in xrange(len(self.iq))]
272 self.set_file_pos_box(start, end)
276 # Do we want to do anything about this?
280 winpoints = self.winfunc(self.psdfftsize)
281 iq_psd, freq = mlab.psd(self.iq, Fs=self.sample_rate,
282 NFFT=self.psdfftsize,
283 noverlap=self.psdfftsize/4.0,
287 self.iq_psd = 10.0*scipy.log10(abs(fftpack.fftshift(iq_psd)))
288 self.freq = freq - self.sample_rate/2.0
290 def get_specgram(self):
291 winpoints = self.winfunc(self.specfftsize)
292 iq_spec, f, t = mlab.specgram(self.iq, Fs=self.sample_rate,
293 NFFT=self.specfftsize,
294 noverlap=self.specfftsize/4.0,
298 self.iq_spec = 10.0*scipy.log10(abs(iq_spec))
302 def clickMe(self, qPoint):
305 def psdFFTComboBoxEdit(self, fftSize):
306 self.psdfftsize = fftSize.toInt()[0]
308 self.update_psd_curves()
310 def specFFTComboBoxEdit(self, fftSize):
311 self.specfftsize = fftSize.toInt()[0]
313 self.update_specgram_curves()
315 def colorComboBoxEdit(self, colorSelection):
316 colorstr = str(colorSelection.toAscii())
317 color_func = self.color_modes[colorstr]
320 def sliderMoved(self, value):
322 pos_end = value + self.gui.plotHBar.pageStep()
324 self.get_data(pos_start, pos_end)
327 self.update_time_curves()
328 self.update_psd_curves()
329 self.update_specgram_curves()
331 def set_sample_rate(self, sr):
332 self.sample_rate = sr
333 srstr = eng_notation.num_to_str(self.sample_rate)
334 self.gui.sampleRateLineEdit.setText(Qt.QString("%1").arg(srstr))
336 def sample_rate_changed(self):
337 srstr = self.gui.sampleRateLineEdit.text().toAscii()
338 self.sample_rate = eng_notation.str_to_num(srstr)
339 self.set_file_pos_box(self.cur_start, self.cur_stop)
340 self.get_data(self.cur_start, self.cur_stop)
343 self.update_time_curves()
344 self.update_psd_curves()
345 self.update_specgram_curves()
347 def set_file_pos_box(self, start, end):
348 tstart = start / self.sample_rate
349 tend = end / self.sample_rate
351 self.gui.filePosStartLineEdit.setText(Qt.QString("%1").arg(start))
352 self.gui.filePosStopLineEdit.setText(Qt.QString("%1").arg(end))
353 self.gui.filePosLengthLineEdit.setText(Qt.QString("%1").arg(end-start))
355 self.gui.fileTimeStartLineEdit.setText(Qt.QString("%1").arg(tstart))
356 self.gui.fileTimeStopLineEdit.setText(Qt.QString("%1").arg(tend))
357 self.gui.fileTimeLengthLineEdit.setText(Qt.QString("%1").arg(tend-tstart))
359 def file_position_changed(self):
360 start = self.gui.filePosStartLineEdit.text().toInt()
361 end = self.gui.filePosStopLineEdit.text().toInt()
362 if((start[1] == True) and (end[1] == True)):
363 self.cur_start = start[0]
364 self.cur_stop = end[0]
366 tstart = self.cur_start / self.sample_rate
367 tend = self.cur_stop / self.sample_rate
368 self.gui.fileTimeStartLineEdit.setText(Qt.QString("%1").arg(tstart))
369 self.gui.fileTimeStopLineEdit.setText(Qt.QString("%1").arg(tend))
371 self.get_data(self.cur_start, self.cur_stop)
373 self.update_time_curves()
374 self.update_psd_curves()
375 self.update_specgram_curves()
377 # If there's a non-digit character, reset box
379 self.set_file_pos_box(self.cur_start, self.cur_stop)
381 def file_time_changed(self):
382 tstart = self.gui.fileTimeStartLineEdit.text().toDouble()
383 tstop = self.gui.fileTimeStopLineEdit.text().toDouble()
384 if((tstart[1] == True) and (tstop[1] == True)):
385 self.cur_start = int(tstart[0] * self.sample_rate)
386 self.cur_stop = int(tstop[0] * self.sample_rate)
387 self.get_data(self.cur_start, self.cur_stop)
389 self.gui.filePosStartLineEdit.setText(Qt.QString("%1").arg(self.cur_start))
390 self.gui.filePosStopLineEdit.setText(Qt.QString("%1").arg(self.cur_stop))
392 self.update_time_curves()
393 self.update_psd_curves()
394 self.update_specgram_curves()
395 # If there's a non-digit character, reset box
397 self.set_file_pos_box(self.cur_start, self.cur_stop)
399 def file_length_changed(self):
400 start = self.gui.filePosStartLineEdit.text().toInt()
401 length = self.gui.filePosLengthLineEdit.text().toInt()
403 if((start[1] == True) and (length[1] == True)):
404 self.cur_start = start[0]
405 self.block_length = length[0]
406 self.cur_stop = self.cur_start + self.block_length
408 tstart = self.cur_start / self.sample_rate
409 tend = self.cur_stop / self.sample_rate
410 tlen = self.block_length / self.sample_rate
411 self.gui.fileTimeStartLineEdit.setText(Qt.QString("%1").arg(tstart))
412 self.gui.fileTimeStopLineEdit.setText(Qt.QString("%1").arg(tend))
413 self.gui.fileTimeLengthLineEdit.setText(Qt.QString("%1").arg(tlen))
415 self.gui.plotHBar.setPageStep(self.block_length)
417 self.get_data(self.cur_start, self.cur_stop)
421 self.update_time_curves()
422 self.update_psd_curves()
423 self.update_specgram_curves()
424 # If there's a non-digit character, reset box
426 self.set_file_pos_box(self.cur_start, self.cur_stop)
428 def file_time_length_changed(self):
429 tstart = self.gui.fileTimeStartLineEdit.text().toDouble()
430 tlength = self.gui.fileTimeLengthLineEdit.text().toDouble()
431 if((tstart[1] == True) and (tlength[1] == True)):
432 self.cur_start = int(tstart[0] * self.sample_rate)
433 self.block_length = int(tlength[0] * self.sample_rate)
434 self.cur_stop = self.cur_start + self.block_length
436 tstart = self.cur_start / self.sample_rate
437 tend = self.cur_stop / self.sample_rate
438 tlen = self.block_length / self.sample_rate
439 self.gui.fileTimeStartLineEdit.setText(Qt.QString("%1").arg(tstart))
440 self.gui.fileTimeStopLineEdit.setText(Qt.QString("%1").arg(tend))
441 self.gui.fileTimeLengthLineEdit.setText(Qt.QString("%1").arg(tlen))
443 self.get_data(self.cur_start, self.cur_stop)
447 self.update_time_curves()
448 self.update_psd_curves()
449 self.update_specgram_curves()
450 # If there's a non-digit character, reset box
452 self.set_file_pos_box(self.cur_start, self.cur_stop)
455 def update_time_curves(self):
456 self.icurve.setData(self.time, self.iq.imag)
457 self.rcurve.setData(self.time, self.iq.real)
459 # Reset the x-axis to the new time scale
460 iqmax = 1.5 * max(max(self.iq.real), max(self.iq.imag))
461 iqmin = 1.5 * min(min(self.iq.real), min(self.iq.imag))
462 self.gui.timePlot.setAxisScale(self.gui.timePlot.xBottom,
465 self.gui.timePlot.setAxisScale(self.gui.timePlot.yLeft,
469 # Set the zoomer base to unzoom to the new axis
470 self.timeZoomer.setZoomBase()
472 self.gui.timePlot.replot()
474 def update_psd_curves(self):
475 self.psdcurve.setData(self.freq, self.iq_psd)
477 self.gui.freqPlot.setAxisScale(self.gui.freqPlot.xBottom,
481 # Set the zoomer base to unzoom to the new axis
482 self.freqZoomer.setZoomBase()
484 self.gui.freqPlot.replot()
486 def update_specgram_curves(self):
487 # We don't have to reset the data for the speccurve here
488 # since this is taken care of in the SpectrogramData class
489 self.specdata.set_data(self.spec_f, self.spec_t, self.iq_spec)
491 self.gui.specPlot.setAxisScale(self.gui.specPlot.xBottom,
494 self.gui.specPlot.setAxisScale(self.gui.specPlot.yLeft,
498 # Set the zoomer base to unzoom to the new axis
499 self.specZoomer.setZoomBase()
501 self.gui.specPlot.replot()
503 def tabChanged(self, index):
504 self.gui.timePlot.replot()
505 self.gui.freqPlot.replot()
507 def color_black_on_white(self):
508 blue = QtGui.qRgb(0x00, 0x00, 0xFF)
509 red = QtGui.qRgb(0xFF, 0x00, 0x00)
511 blackBrush = Qt.QBrush(Qt.QColor("black"))
512 blueBrush = Qt.QBrush(Qt.QColor(blue))
513 redBrush = Qt.QBrush(Qt.QColor(red))
515 self.gui.timePlot.setCanvasBackground(Qt.QColor("white"))
516 self.gui.freqPlot.setCanvasBackground(Qt.QColor("white"))
517 self.picker.setTrackerPen(Qt.QPen(blackBrush, 2))
518 self.timeZoomer.setTrackerPen(Qt.QPen(blackBrush, 2))
519 self.timeZoomer.setRubberBandPen(Qt.QPen(blackBrush, 2))
520 self.freqZoomer.setTrackerPen(Qt.QPen(blackBrush, 2))
521 self.freqZoomer.setRubberBandPen(Qt.QPen(blackBrush, 2))
522 self.psdcurve.setPen(Qt.QPen(blueBrush, 1))
523 self.rcurve.setPen(Qt.QPen(blueBrush, 2))
524 self.icurve.setPen(Qt.QPen(redBrush, 2))
526 self.gui.timePlot.replot()
527 self.gui.freqPlot.replot()
529 def color_white_on_black(self):
530 white = QtGui.qRgb(0xFF, 0xFF, 0xFF)
531 red = QtGui.qRgb(0xFF, 0x00, 0x00)
533 whiteBrush = Qt.QBrush(Qt.QColor("white"))
534 whiteBrush = Qt.QBrush(Qt.QColor(white))
535 redBrush = Qt.QBrush(Qt.QColor(red))
537 self.gui.timePlot.setCanvasBackground(QtGui.QColor("black"))
538 self.gui.freqPlot.setCanvasBackground(QtGui.QColor("black"))
539 self.picker.setTrackerPen(Qt.QPen(whiteBrush, 2))
540 self.timeZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2))
541 self.timeZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2))
542 self.freqZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2))
543 self.freqZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2))
544 self.psdcurve.setPen(Qt.QPen(whiteBrush, 1))
545 self.rcurve.setPen(Qt.QPen(whiteBrush, 2))
546 self.icurve.setPen(Qt.QPen(redBrush, 2))
548 self.gui.timePlot.replot()
549 self.gui.freqPlot.replot()
552 def color_green_on_black(self):
553 green = QtGui.qRgb(0x00, 0xFF, 0x00)
554 red = QtGui.qRgb(0xFF, 0x00, 0x50)
556 whiteBrush = Qt.QBrush(Qt.QColor("white"))
557 greenBrush = Qt.QBrush(Qt.QColor(green))
558 redBrush = Qt.QBrush(Qt.QColor(red))
560 self.gui.timePlot.setCanvasBackground(QtGui.QColor("black"))
561 self.gui.freqPlot.setCanvasBackground(QtGui.QColor("black"))
562 self.picker.setTrackerPen(Qt.QPen(whiteBrush, 2))
563 self.timeZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2))
564 self.timeZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2))
565 self.freqZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2))
566 self.freqZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2))
567 self.psdcurve.setPen(Qt.QPen(greenBrush, 1))
568 self.rcurve.setPen(Qt.QPen(greenBrush, 2))
569 self.icurve.setPen(Qt.QPen(redBrush, 2))
571 self.gui.timePlot.replot()
572 self.gui.freqPlot.replot()
574 def color_blue_on_black(self):
575 blue = QtGui.qRgb(0x00, 0x00, 0xFF)
576 red = QtGui.qRgb(0xFF, 0x00, 0x00)
578 whiteBrush = Qt.QBrush(Qt.QColor("white"))
579 blueBrush = Qt.QBrush(Qt.QColor(blue))
580 redBrush = Qt.QBrush(Qt.QColor(red))
582 self.gui.timePlot.setCanvasBackground(QtGui.QColor("black"))
583 self.gui.freqPlot.setCanvasBackground(QtGui.QColor("black"))
584 self.picker.setTrackerPen(Qt.QPen(whiteBrush, 2))
585 self.timeZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2))
586 self.timeZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2))
587 self.freqZoomer.setTrackerPen(Qt.QPen(whiteBrush, 2))
588 self.freqZoomer.setRubberBandPen(Qt.QPen(whiteBrush, 2))
589 self.psdcurve.setPen(Qt.QPen(blueBrush, 1))
590 self.rcurve.setPen(Qt.QPen(blueBrush, 2))
591 self.icurve.setPen(Qt.QPen(redBrush, 2))
593 self.gui.timePlot.replot()
594 self.gui.freqPlot.replot()
597 usage="%prog: [options] (input_filename)"
600 parser = OptionParser(conflict_handler="resolve", usage=usage, description=description)
601 parser.add_option("-B", "--block-length", type="int", default=8192,
602 help="Specify the block size [default=%default]")
603 parser.add_option("-s", "--start", type="int", default=0,
604 help="Specify where to start in the file [default=%default]")
605 parser.add_option("-R", "--sample-rate", type="float", default=1.0,
606 help="Set the sampler rate of the data [default=%default]")
607 parser.add_option("", "--psd-size", type="int", default=2048,
608 help="Set the size of the PSD FFT [default=%default]")
609 parser.add_option("", "--spec-size", type="int", default=2048,
610 help="Set the size of the spectrogram FFT [default=%default]")
615 parser = setup_options()
616 (options, args) = parser.parse_args ()
623 app = Qt.QApplication(args)
624 gplt = gr_plot_qt(app, filename, options)
627 if __name__ == '__main__':