diff options
Diffstat (limited to 'gr-wxgui/src/python/waterfallsink_nongl.py')
-rw-r--r-- | gr-wxgui/src/python/waterfallsink_nongl.py | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/gr-wxgui/src/python/waterfallsink_nongl.py b/gr-wxgui/src/python/waterfallsink_nongl.py index 213415c82c..0e9b706708 100644 --- a/gr-wxgui/src/python/waterfallsink_nongl.py +++ b/gr-wxgui/src/python/waterfallsink_nongl.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2003,2004,2005,2007,2008 Free Software Foundation, Inc. +# Copyright 2003-2007,2008,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,8 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gru, window +from gnuradio import gr, gru, window, fft, filter +from gnuradio import analog from gnuradio.wxgui import stdgui2 import wx import gnuradio.wxgui.plot as plot @@ -91,9 +92,9 @@ class waterfall_sink_f(gr.hier_block2, waterfall_sink_base): max(1, int(self.sample_rate/self.fft_size/self.fft_rate))) mywindow = window.blackmanharris(self.fft_size) - self.fft = gr.fft_vfc(self.fft_size, True, mywindow) + self.fft = fft.fft_vfc(self.fft_size, True, mywindow) self.c2mag = gr.complex_to_mag(self.fft_size) - self.avg = gr.single_pole_iir_filter_ff(1.0, self.fft_size) + self.avg = filter.single_pole_iir_filter_ff(1.0, self.fft_size) self.log = gr.nlog10_ff(20, self.fft_size, -20*math.log10(self.fft_size)) self.sink = gr.message_sink(gr.sizeof_float * self.fft_size, self.msgq, True) self.connect(self, self.s2p, self.one_in_n, self.fft, self.c2mag, self.avg, self.log, self.sink) @@ -122,9 +123,9 @@ class waterfall_sink_c(gr.hier_block2, waterfall_sink_base): max(1, int(self.sample_rate/self.fft_size/self.fft_rate))) mywindow = window.blackmanharris(self.fft_size) - self.fft = gr.fft_vcc(self.fft_size, True, mywindow) + self.fft = fft.fft_vcc(self.fft_size, True, mywindow) self.c2mag = gr.complex_to_mag(self.fft_size) - self.avg = gr.single_pole_iir_filter_ff(1.0, self.fft_size) + self.avg = filter.single_pole_iir_filter_ff(1.0, self.fft_size) self.log = gr.nlog10_ff(20, self.fft_size, -20*math.log10(self.fft_size)) self.sink = gr.message_sink(gr.sizeof_float * self.fft_size, self.msgq, True) self.connect(self, self.s2p, self.one_in_n, self.fft, self.c2mag, self.avg, self.log, self.sink) @@ -391,7 +392,7 @@ def next_down(v, seq): class test_top_block (stdgui2.std_top_block): def __init__(self, frame, panel, vbox, argv): - stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) + stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) fft_size = 512 @@ -399,30 +400,30 @@ class test_top_block (stdgui2.std_top_block): input_rate = 20.000e3 # Generate a complex sinusoid - self.src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 5.75e3, 1000) - #src1 = gr.sig_source_c (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1000) + self.src1 = analog.sig_source_c(input_rate, analog.GR_SIN_WAVE, 5.75e3, 1000) + #src1 = analog.sig_source_c(input_rate, analog.GR_CONST_WAVE, 5.75e3, 1000) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. self.thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) - sink1 = waterfall_sink_c (panel, title="Complex Data", fft_size=fft_size, - sample_rate=input_rate, baseband_freq=100e3) + sink1 = waterfall_sink_c(panel, title="Complex Data", fft_size=fft_size, + sample_rate=input_rate, baseband_freq=100e3) self.connect(self.src1, self.thr1, sink1) - vbox.Add (sink1.win, 1, wx.EXPAND) + vbox.Add(sink1.win, 1, wx.EXPAND) # generate a real sinusoid - self.src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 5.75e3, 1000) + self.src2 = analog.sig_source_f(input_rate, analog.GR_SIN_WAVE, 5.75e3, 1000) self.thr2 = gr.throttle(gr.sizeof_float, input_rate) - sink2 = waterfall_sink_f (panel, title="Real Data", fft_size=fft_size, - sample_rate=input_rate, baseband_freq=100e3) + sink2 = waterfall_sink_f(panel, title="Real Data", fft_size=fft_size, + sample_rate=input_rate, baseband_freq=100e3) self.connect(self.src2, self.thr2, sink2) - vbox.Add (sink2.win, 1, wx.EXPAND) + vbox.Add(sink2.win, 1, wx.EXPAND) def main (): - app = stdgui2.stdapp (test_top_block, "Waterfall Sink Test App") - app.MainLoop () + app = stdgui2.stdapp(test_top_block, "Waterfall Sink Test App") + app.MainLoop() if __name__ == '__main__': - main () + main() |