#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Vector Subtract # Generated: Mon Dec 19 17:18:29 2011 ################################################## from gnuradio import eng_notation from gnuradio import gr from gnuradio import window from gnuradio.eng_option import eng_option from gnuradio.gr import firdes from grc_gnuradio import wxgui as grc_wxgui from optparse import OptionParser import wx class vector_subtract(grc_wxgui.top_block_gui): def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Vector Subtract") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.veclen = veclen = 1024 self.samp_rate = samp_rate = 32000 ################################################## # Blocks ################################################## self.gr_vector_to_stream_0 = gr.vector_to_stream(gr.sizeof_gr_complex*1, veclen) self.gr_sub_xx_0 = gr.sub_cc(1) self.gr_stream_to_vector_0 = gr.stream_to_vector(gr.sizeof_gr_complex*1, veclen) self.gr_null_sink_0 = gr.null_sink(gr.sizeof_gr_complex*veclen) self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*veclen, "", False) self.gr_fft_vxx_0 = gr.fft_vcc(veclen, True, (window.blackmanharris(veclen)), True) self.gr_delay_0 = gr.delay(gr.sizeof_gr_complex*1, 1) ################################################## # Connections ################################################## self.connect((self.gr_vector_to_stream_0, 0), (self.gr_delay_0, 0)) self.connect((self.gr_delay_0, 0), (self.gr_sub_xx_0, 1)) self.connect((self.gr_vector_to_stream_0, 0), (self.gr_sub_xx_0, 0)) self.connect((self.gr_sub_xx_0, 0), (self.gr_stream_to_vector_0, 0)) self.connect((self.gr_stream_to_vector_0, 0), (self.gr_null_sink_0, 0)) self.connect((self.gr_file_source_0, 0), (self.gr_fft_vxx_0, 0)) self.connect((self.gr_fft_vxx_0, 0), (self.gr_vector_to_stream_0, 0)) def get_veclen(self): return self.veclen def set_veclen(self, veclen): self.veclen = veclen def get_samp_rate(self): return self.samp_rate def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate if __name__ == '__main__': parser = OptionParser(option_class=eng_option, usage="%prog: [options]") (options, args) = parser.parse_args() tb = vector_subtract() tb.Run(True)