#!/usr/bin/env python from gnuradio import gr from gnuradio.wxgui import stdgui,fftsink,scopesink import wx class gnuradioGUI(stdgui.gui_flow_graph): def __init__(self,frame,panel,vbox,argv): stdgui.gui_flow_graph.__init__(self,frame,panel,vbox,argv) fft = fftsink.fft_sink_f(self, panel, title="FFT display", fft_size=512, sample_rate=100000) vbox.Add(fft.win,4,wx.EXPAND) scope = scopesink.scope_sink_f(self, panel, title="Oscilloscope", sample_rate=100000) vbox.Add(scope.win,4,wx.EXPAND) signal = gr.sig_source_f(100000,gr.GR_SIN_WAVE,20000,1000,0) throttle = gr.throttle(gr.sizeof_float,100000) self.connect(signal,throttle) self.connect(throttle,fft) self.connect(throttle,scope) if __name__ == '__main__': app = stdgui.stdapp(gnuradioGUI,"A simple GNU Radio GUI") app.MainLoop()