def __init__(self, demod_class, rx_callback, options): gr.top_block.__init__(self) self.rxpath = receive_path(demod_class, rx_callback, options) self.audio_tx = audio_tx(options.audio_output) if(options.rx_freq is not None): self.source = uhd_receiver(options.args, options.bitrate, options.samples_per_symbol, options.rx_freq, options.rx_gain, options.antenna, options.verbose) options.samples_per_symbol = self.source._sps audio_rate = self.audio_tx.sample_rate usrp_rate = self.source.get_sample_rate() rrate = audio_rate / usrp_rate self.resampler = blks2.pfb_arb_resampler_ccf(rrate) self.connect(self.source, self.resampler, self.rxpath) elif(options.from_file is not None): self.thr = gr.throttle(gr.sizeof_gr_complex, options.bitrate) self.source = gr.file_source(gr.sizeof_gr_complex, options.from_file) self.connect(self.source, self.thr, self.rxpath) else: self.thr = gr.throttle(gr.sizeof_gr_complex, 1e6) self.source = gr.null_source(gr.sizeof_gr_complex) self.connect(self.source, self.thr, self.rxpath) self.connect(self.audio_tx)
def __init__(self, demod_class, rx_callback, options): gr.top_block.__init__(self) self.rxpath = receive_path(demod_class, rx_callback, options) self.audio_tx = audio_tx(options.audio_output) if (options.rx_freq is not None): self.source = uhd_receiver(options.args, options.bitrate, options.samples_per_symbol, options.rx_freq, options.rx_gain, options.antenna, options.verbose) options.samples_per_symbol = self.source._sps audio_rate = self.audio_tx.sample_rate usrp_rate = self.source.get_sample_rate() rrate = audio_rate / usrp_rate self.resampler = blks2.pfb_arb_resampler_ccf(rrate) self.connect(self.source, self.resampler, self.rxpath) elif (options.from_file is not None): self.thr = gr.throttle(gr.sizeof_gr_complex, options.bitrate) self.source = gr.file_source(gr.sizeof_gr_complex, options.from_file) self.connect(self.source, self.thr, self.rxpath) else: self.thr = gr.throttle(gr.sizeof_gr_complex, 1e6) self.source = gr.null_source(gr.sizeof_gr_complex) self.connect(self.source, self.thr, self.rxpath) self.connect(self.audio_tx)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) # build our flow graph input_rate = 20.48e3 # Generate a real and complex sinusoids src1 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 2.21e3, 1) src2 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 2.21e3, 1) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_float, input_rate) thr2 = gr.throttle(gr.sizeof_gr_complex, input_rate) sink1 = number_sink_f (panel, unit='V',label="Real Data", avg_alpha=0.001, sample_rate=input_rate, minval=-1, maxval=1, ref_level=0, decimal_places=3) vbox.Add (sink1.win, 1, wx.EXPAND) sink2 = number_sink_c (panel, unit='V',label="Complex Data", avg_alpha=0.001, sample_rate=input_rate, minval=-1, maxval=1, ref_level=0, decimal_places=3) vbox.Add (sink2.win, 1, wx.EXPAND) self.connect (src1, thr1, sink1) self.connect (src2, thr2, sink2)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) fft_size = 256 # build our flow graph input_rate = 20.000e3 # Generate a complex sinusoid 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) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) sink1 = ra_fft_sink_c (panel, title="Complex Data", fft_size=fft_size, sample_rate=input_rate, baseband_freq=100e3, ref_level=60, y_per_div=10) vbox.Add (sink1.win, 1, wx.EXPAND) self.connect (src1, thr1, sink1) src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 5.75e3, 1000) #src2 = gr.sig_source_f (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1000) thr2 = gr.throttle(gr.sizeof_float, input_rate) sink2 = ra_fft_sink_f (panel, title="Real Data", fft_size=fft_size*2, sample_rate=input_rate, baseband_freq=100e3, ref_level=60, y_per_div=10) vbox.Add (sink2.win, 1, wx.EXPAND) self.connect (src2, thr2, sink2)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block .__init__ (self, frame, panel, vbox, argv) fac_size = 256 # build our flow graph input_rate = 20.48e3 # Generate a complex sinusoid #src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 2e3, 1) src1 = gr.sig_source_c (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) sink1 = fac_sink_c (panel, title="Complex Data", fac_size=fac_size, sample_rate=input_rate, baseband_freq=100e3, ref_level=0, y_per_div=20) vbox.Add (sink1.win, 1, wx.EXPAND) self.connect (src1, thr1, sink1) #src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 2e3, 1) src2 = gr.sig_source_f (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1) thr2 = gr.throttle(gr.sizeof_float, input_rate) sink2 = fac_sink_f (panel, title="Real Data", fac_size=fac_size*2, sample_rate=input_rate, baseband_freq=100e3, ref_level=0, y_per_div=20) vbox.Add (sink2.win, 1, wx.EXPAND) self.connect (src2, thr2, sink2)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) fft_size = 512 # build our flow graph 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) # 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) self.connect(self.src1, self.thr1, sink1) 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.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) self.connect(self.src2, self.thr2, sink2) vbox.Add (sink2.win, 1, wx.EXPAND)
def __init__(self, frame, panel, vbox, argv): stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv) #number_size = 256 # build our flow graph input_rate = 20.48e3 # Generate a complex sinusoid src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 2e3, 1) #src1 = gr.sig_source_c (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) #sink1 = number_sink_c (self, panel, label="Complex Data", number_size=number_size, # sample_rate=input_rate, base_value=100e3, # ref_level=0, decimal_places=3) #vbox.Add (sink1.win, 1, wx.EXPAND) #self.connect (src1, thr1, sink1) src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 2e3, 1) #src2 = gr.sig_source_f (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1) thr2 = gr.throttle(gr.sizeof_float, input_rate) sink2 = number_sink_f (self, panel, unit='Hz',label="Real Data", avg_alpha=0.001,#number_size=number_size*2, sample_rate=input_rate, base_value=100e3, ref_level=0, decimal_places=3) vbox.Add (sink2.win, 1, wx.EXPAND) sink3 = number_sink_c (self, panel, unit='V',label="Complex Data", avg_alpha=0.001,#number_size=number_size*2, sample_rate=input_rate, base_value=0, ref_level=0, decimal_places=3) vbox.Add (sink3.win, 1, wx.EXPAND) self.connect (src2, thr2, sink2) self.connect (src1, thr1, sink3)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) fft_size = 256 # build our flow graph input_rate = 2048.0e3 # Generate some noise noise = gr.noise_source_c(gr.GR_UNIFORM, 1.0 / 10) # Generate a complex sinusoid # src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 2e3, 1) src1 = gr.sig_source_c(input_rate, gr.GR_CONST_WAVE, 57.50e3, 1) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) sink1 = fft_sink_c( panel, title="Complex Data", fft_size=fft_size, sample_rate=input_rate, baseband_freq=100e3, ref_level=0, y_per_div=20, y_divs=10, ) vbox.Add(sink1.win, 1, wx.EXPAND) combine1 = gr.add_cc() self.connect(src1, (combine1, 0)) self.connect(noise, (combine1, 1)) self.connect(combine1, thr1, sink1) # src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 2e3, 1) src2 = gr.sig_source_f(input_rate, gr.GR_CONST_WAVE, 57.50e3, 1) thr2 = gr.throttle(gr.sizeof_float, input_rate) sink2 = fft_sink_f( panel, title="Real Data", fft_size=fft_size * 2, sample_rate=input_rate, baseband_freq=100e3, ref_level=0, y_per_div=20, y_divs=10, ) vbox.Add(sink2.win, 1, wx.EXPAND) combine2 = gr.add_ff() c2f2 = gr.complex_to_float() self.connect(src2, (combine2, 0)) self.connect(noise, c2f2, (combine2, 1)) self.connect(combine2, thr2, sink2)
def __init__(self): gr.top_block.__init__(self) xmtr_hack = True rcvr_hack = True self.options = self.run_parser() self.transceiver = bts_transceiver.proto_transceiver() if rcvr_hack: self.src = gr.throttle(itemsize = gr.sizeof_gr_complex, samples_per_sec = self.options.rx_samp_rate) self.f_src = gr.file_source( itemsize = gr.sizeof_gr_complex, filename = self.options.test_src, repeat = False) self.connect(self.f_src, self.src) else: self.bb_sink = gr.file_sink( itemsize = gr.sizeof_gr_complex, filename = 'bb_dump.dat') self.src = self.setup_src() self.connect( self.src, self.bb_sink) if xmtr_hack: self.snk = gr.throttle( itemsize = gr.sizeof_gr_complex, samples_per_sec = self.options.tx_samp_rate) self.fsnk = gr.file_sink( itemsize = gr.sizeof_gr_complex, filename = self.options.test_snk) self.connect( self.snk, self.fsnk) else: self.snk = self.setup_snk() self.fsnk = gr.file_sink( itemsize = gr.sizeof_gr_complex, filename = self.options.test_snk) self.connect( self.transceiver, self.fsnk) self.connect( self.src, self.transceiver) self.connect( self.transceiver, self.snk) #sleep for a bit, let the USRP clocks stablize and such time.sleep(1)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) fft_size = 256 # build our flow graph input_rate = 2048.0e3 #Generate some noise noise = gr.noise_source_c(gr.GR_UNIFORM, 1.0 / 10) # Generate a complex sinusoid #src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 2e3, 1) src1 = gr.sig_source_c(input_rate, gr.GR_CONST_WAVE, 57.50e3, 1) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) sink1 = fft_sink_c(panel, title="Complex Data", fft_size=fft_size, sample_rate=input_rate, baseband_freq=100e3, ref_level=0, y_per_div=20, y_divs=10) vbox.Add(sink1.win, 1, wx.EXPAND) combine1 = gr.add_cc() self.connect(src1, (combine1, 0)) self.connect(noise, (combine1, 1)) self.connect(combine1, thr1, sink1) #src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 2e3, 1) src2 = gr.sig_source_f(input_rate, gr.GR_CONST_WAVE, 57.50e3, 1) thr2 = gr.throttle(gr.sizeof_float, input_rate) sink2 = fft_sink_f(panel, title="Real Data", fft_size=fft_size * 2, sample_rate=input_rate, baseband_freq=100e3, ref_level=0, y_per_div=20, y_divs=10) vbox.Add(sink2.win, 1, wx.EXPAND) combine2 = gr.add_ff() c2f2 = gr.complex_to_float() self.connect(src2, (combine2, 0)) self.connect(noise, c2f2, (combine2, 1)) self.connect(combine2, thr2, sink2)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1000 ################################################## # Blocks ################################################## self.const_source_x_0 = gr.sig_source_f(0, gr.GR_CONST_WAVE, 0, 0, 0) self.gr_descrambler_bb_0 = gr.descrambler_bb(0x8A, 0x7F, 7) self.gr_float_to_complex_0 = gr.float_to_complex(1) self.gr_packed_to_unpacked_xx_0 = gr.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST) self.gr_scrambler_bb_0 = gr.scrambler_bb(0x8A, 0x7F, 7) self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate) self.gr_throttle_0_0 = gr.throttle(gr.sizeof_char*1, samp_rate) self.gr_throttle_0_0_0 = gr.throttle(gr.sizeof_char*1, samp_rate*8) self.gr_throttle_0_0_0_0 = gr.throttle(gr.sizeof_char*1, samp_rate*8*8) self.gr_uchar_to_float_0 = gr.uchar_to_float() self.gr_unpacked_to_packed_xx_0 = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) self.gr_vector_source_x_0 = gr.vector_source_b((0, 1, 3,7,255,3,1,0), True, 1) self.wxgui_scopesink2_0 = scopesink2.scope_sink_c( self.GetWin(), title="Scope Plot", sample_rate=samp_rate*32, v_scale=0, v_offset=0, t_scale=0, ac_couple=False, xy_mode=False, num_inputs=1, ) self.Add(self.wxgui_scopesink2_0.win) ################################################## # Connections ################################################## self.connect((self.gr_float_to_complex_0, 0), (self.gr_throttle_0, 0)) self.connect((self.const_source_x_0, 0), (self.gr_float_to_complex_0, 1)) self.connect((self.gr_throttle_0, 0), (self.wxgui_scopesink2_0, 0)) self.connect((self.gr_vector_source_x_0, 0), (self.gr_throttle_0_0, 0)) self.connect((self.gr_throttle_0_0, 0), (self.gr_packed_to_unpacked_xx_0, 0)) self.connect((self.gr_descrambler_bb_0, 0), (self.gr_unpacked_to_packed_xx_0, 0)) self.connect((self.gr_packed_to_unpacked_xx_0, 0), (self.gr_throttle_0_0_0, 0)) self.connect((self.gr_throttle_0_0_0, 0), (self.gr_scrambler_bb_0, 0)) self.connect((self.gr_scrambler_bb_0, 0), (self.gr_throttle_0_0_0_0, 0)) self.connect((self.gr_throttle_0_0_0_0, 0), (self.gr_descrambler_bb_0, 0)) self.connect((self.gr_uchar_to_float_0, 0), (self.gr_float_to_complex_0, 0)) self.connect((self.gr_unpacked_to_packed_xx_0, 0), (self.gr_uchar_to_float_0, 0))
def test_001_srcsink_ss (self): sys.stderr.write("Creating null source\n") src = gr.null_source(gr.sizeof_short) sys.stderr.write("Creating throttle\n") thr = gr.throttle(gr.sizeof_short,1000) sys.stderr.write("Creating fake SPI device\n") dummy = spi.srcsink_ss("/dev/null",1000000) sys.stderr.write("Creating null sink\n") sink = gr.null_sink(gr.sizeof_short) sys.stderr.write("Connecting source to throttle\n") self.fg.connect(src,thr) sys.stderr.write("Connecting throttle to SPI\n") self.fg.connect(thr,dummy) sys.stderr.write("Connecting SPI to sink\n") self.fg.connect(dummy,sink) sys.stderr.write("Starting flow graph\n") self.fg.start() time.sleep(0.1) sys.stderr.write("Stopping flow graph\n") self.fg.stop() sys.stderr.write("Deleting blocks\n") del src del thr del dummy del sink sys.stderr.write("All done!\n")
def __init__(self): gr.top_block.__init__(self, "Affinity Set Test") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 32000 ################################################## # Blocks ################################################## vec_len = 1 self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*vec_len, samp_rate) self.gr_null_source_0 = gr.null_source(gr.sizeof_gr_complex*vec_len) self.gr_null_sink_0 = gr.null_sink(gr.sizeof_gr_complex*vec_len) self.gr_filt_0 = gr.fir_filter_ccc(1, 40000*[0.2+0.3j,]) self.gr_filt_1 = gr.fir_filter_ccc(1, 40000*[0.2+0.3j,]) self.gr_filt_0.set_processor_affinity([0,]) self.gr_filt_1.set_processor_affinity([0,1]) ################################################## # Connections ################################################## self.connect((self.gr_null_source_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_throttle_0, 0), (self.gr_filt_0, 0)) self.connect((self.gr_filt_0, 0), (self.gr_filt_1, 0)) self.connect((self.gr_filt_1, 0), (self.gr_null_sink_0, 0))
def test_001_fib_sink (self): ################################# # Testsequenz generieren src_data_0 =(0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, 0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,0,0,1,1,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,0,0,0,1,1,1,0,1,1,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,1,1,1,1,1, 0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,1,1,0,1,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,1,0,0,0,0,1,1,1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,1,1,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,1,0,1,1,1,1,0,0,0,0,1,0,0,0,1,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, 0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,0,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,1,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,0,0,1,1,1,0,1,1,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,1,1,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,1,1,1,1,1, 0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,1,1,1,1,0,1,0,0,1,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,0,0,1,0,1,0,1,0,0,1,0,0,0,0,1,1,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,0,0,1,0,0,1,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,0,1,1,0,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,1,1,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,0,1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,1,1,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) ################################# # Objekte erzeugen src_0 = gr.vector_source_b (src_data_0) throttle_0 = gr.throttle(gr.sizeof_char*1, 32000) s2v = gr.stream_to_vector(gr.sizeof_char, 240) sink = howto_swig.fib_sink2_vb() # Objekte verbinden self.tb.connect(src_0, throttle_0) self.tb.connect(throttle_0, s2v) self.tb.connect(s2v, sink) # Simulationsstart self.tb.run ()
def test_014_bonder_vbb(self): ################################# src_data_0 = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) ################################ expected_result_0 = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) ################################# # Objekte erzeugen src_0 = gr.vector_source_f(src_data_0) throttle_0 = gr.throttle(gr.sizeof_float * 1, 320000) s2v_0 = gr.stream_to_vector(gr.sizeof_float, 2) bonder = howto_swig.bonder_vff(2, 6) v2s_0 = gr.vector_to_stream(gr.sizeof_float, 6) dst_0 = gr.vector_sink_f() # Objekte verbinden self.tb.connect(src_0, throttle_0, s2v_0, bonder, v2s_0, dst_0) # Simulationsstart self.tb.run() # Ergebnis auswerten result_data0 = dst_0.data() self.assertEqual(expected_result_0, result_data0)
def test_001_cutter_vbb(self): ################################# # Testsequenz generieren src_data_0 = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) ################################ # Ergebnis generieren expected_result_0 = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) ################################# # Objekte erzeugen src_0 = gr.vector_source_b(src_data_0) throttle_0 = gr.throttle(gr.sizeof_char * 1, 320000) s2v_0 = gr.stream_to_vector(gr.sizeof_char, 6) cutter = howto_swig.cutter_vbb(6, 2) v2s_0 = gr.vector_to_stream(gr.sizeof_char, 2) dst_0 = gr.vector_sink_b() self.tb.connect(src_0, throttle_0, s2v_0, cutter, v2s_0, dst_0) self.tb.run() result_data0 = dst_0.data() self.assertEqual(expected_result_0, result_data0)
def __init__(self): gr.top_block.__init__(self) Rs = 8000 f1 = 100 f2 = 200 npts = 2048 self.qapp = QtGui.QApplication(sys.argv) src1 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f1, 0.5, 0) src2 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f2, 0.5, 0) src = gr.add_cc() channel = filter.channel_model(0.001) thr = gr.throttle(gr.sizeof_gr_complex, 100*npts) self.snk1 = qtgui.const_sink_c(npts, "Constellation Example", 1) self.connect(src1, (src,0)) self.connect(src2, (src,1)) self.connect(src, channel, thr, (self.snk1, 0)) self.ctrl_win = control_box() self.ctrl_win.attach_signal1(src1) self.ctrl_win.attach_signal2(src2) # Get the reference pointer to the SpectrumDisplayForm QWidget pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object # This can now be manipulated as a PyQt4.QtGui.QWidget pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) self.main_box = dialog_box(pyWin, self.ctrl_win) self.main_box.show()
def test_002null_symbol_resample_bb(self): ################################# # Testsequenz generieren src_data_0 = (1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0) ################################ # Ergebnis generieren exp_resu_0 = (1, 0, 1, 0, 1, 0) ################################# # Objekte erzeugen src_0 = gr.vector_source_b(src_data_0) throttle_0 = gr.throttle(gr.sizeof_char * 1, 320000) null_symbol_resample = howto_swig.null_symbol_resample_bb( 3) #Blockgroesse=3, Guardtime = 1, Blockanzahl=2, Offset=1 dst_0 = gr.vector_sink_b() # Objekte verbinden self.tb.connect(src_0, throttle_0, (null_symbol_resample, 0)) self.tb.connect((null_symbol_resample, 0), dst_0) # Simulationsstart self.tb.run() # Ergebnis auswerten result_data0 = dst_0.data() self.assertEqual(exp_resu_0, result_data0)
def test_001_interpolation_cc (self): ################################# # Testsequenz generieren src_data_0 = ( 3+0j, 6+0j, 6+6j, 6+6j, 0+0j, 3+3j) ################################ # Ergebnis generieren exp_resu_0 = ( 0+0j, 2+0j, 4+0j, 6+0j, 6+4j, 6+6j, 6+6j, 2+2j, 1+1j, 3+3j,1+1j) ################################# # Objekte erzeugen src_0 = gr.vector_source_c (src_data_0) throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, 320000) interpol = howto_swig.interpolation_cc(3,2) dst_0 = gr.vector_sink_c() # Objekte verbinden self.tb.connect(src_0, throttle_0) self.tb.connect(throttle_0, interpol) self.tb.connect(interpol, dst_0) # Simulationsstart self.tb.run () # Ergebnis auswerten result_data0 = dst_0.data () self.assertComplexTuplesAlmostEqual (exp_resu_0, result_data0, 6)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) pspectrum_len = 1024 # build our flow graph input_rate = 2e6 #Generate some noise noise = gr.noise_source_c(gr.GR_GAUSSIAN, 1.0/10) # Generate a complex sinusoid #source = gr.file_source(gr.sizeof_gr_complex, 'foobar2.dat', repeat=True) src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, -500e3, 1) src2 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 500e3, 1) src3 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, -250e3, 2) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) sink1 = spectrum_sink_c (panel, title="Spectrum Sink", pspectrum_len=pspectrum_len, sample_rate=input_rate, baseband_freq=0, ref_level=0, y_per_div=20, y_divs=10, m = 70, n = 3, nsamples = 1024) vbox.Add (sink1.win, 1, wx.EXPAND) combine1=gr.add_cc() self.connect(src1,(combine1,0)) self.connect(src2,(combine1,1)) self.connect(src3,(combine1,2)) self.connect(noise, (combine1,3)) self.connect(combine1,thr1, sink1)
def __init__(self): gr.top_block.__init__(self) usage = "%prog: [options] samples_file" parser = OptionParser(option_class=eng_option, usage=usage) (options, args) = parser.parse_args () if len(args)<1: # print "using gaussian noise as source" # self.sigsrc = gr.noise_source_c(gr.GR_GAUSSIAN,10e6) print "using repeating random vector as source" self.sigsrc = gr.vector_source_c([10e6*(random.random() + 1j*random.random()) for i in range(0,100000)],True) self.src = gr.throttle( gr.sizeof_gr_complex,2048000) self.connect(self.sigsrc, self.src) else: filename = args[0] print "using samples from file " + filename self.src = gr.file_source(gr.sizeof_gr_complex, filename, False) dp = parameters.dab_parameters(1) rp = parameters.receiver_parameters(1) self.sync_dab = ofdm_sync_dab(dp, rp, False) self.nop0 = gr.nop(gr.sizeof_gr_complex) self.nop1 = gr.nop(gr.sizeof_char) self.connect(self.src, self.sync_dab, self.nop0) self.connect((self.sync_dab,1), self.nop1)
def __init__(self, decim=32, sync_check=False, satellite='METEOR-M-1', baseband_file=os.environ['HOME'] + '/METEOR-M-1.dat', frames_file=os.environ['HOME'] + '/METEOR-M-1.hrpt'): gr.top_block.__init__(self, "Meteor M N1 HRPT Baseband To Frames") ################################################## # Parameters ################################################## self.decim = decim self.sync_check = sync_check self.satellite = satellite self.baseband_file = baseband_file self.frames_file = frames_file ################################################## # Variables ################################################## self.sym_rate = sym_rate = 600*1109 self.sample_rate = sample_rate = 64e6/decim self.sps = sps = sample_rate/sym_rate self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/mn1_hrpt.conf' self._saved_pll_alpha_config = ConfigParser.ConfigParser() self._saved_pll_alpha_config.read(config_filename) try: saved_pll_alpha = self._saved_pll_alpha_config.getfloat("satname", 'pll_alpha') except: saved_pll_alpha = 0.01 self.saved_pll_alpha = saved_pll_alpha self._saved_clock_alpha_config = ConfigParser.ConfigParser() self._saved_clock_alpha_config.read(config_filename) try: saved_clock_alpha = self._saved_clock_alpha_config.getfloat("satname", 'clock_alpha') except: saved_clock_alpha = 0.01 self.saved_clock_alpha = saved_clock_alpha self.max_clock_offset = max_clock_offset = 100e-6 self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate self.hs = hs = int(sps/2.0) ################################################## # Blocks ################################################## self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) self.frame_sink = gr.file_sink(gr.sizeof_short*1, frames_file) self.frame_sink.set_unbuffered(False) self.gr_binary_slicer_fb_0 = gr.binary_slicer_fb() self.gr_clock_recovery_mm_xx_0 = gr.clock_recovery_mm_ff(sps/2.0, saved_clock_alpha**2/4.0, 0.5, saved_clock_alpha, max_clock_offset) self.gr_file_source_0 = gr.file_source(gr.sizeof_short*1, baseband_file, False) self.gr_interleaved_short_to_complex_0 = gr.interleaved_short_to_complex() self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) self.pll = noaa.hrpt_pll_cf(saved_pll_alpha, saved_pll_alpha**2/4.0, max_carrier_offset) self.poesweather_mn1_hrpt_deframer_0 = poesweather.mn1_hrpt_deframer(sync_check) self.throttle = gr.throttle(gr.sizeof_short*1, sample_rate*10) ################################################## # Connections ################################################## self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.gr_binary_slicer_fb_0, 0)) self.connect((self.gr_file_source_0, 0), (self.throttle, 0)) self.connect((self.throttle, 0), (self.gr_interleaved_short_to_complex_0, 0)) self.connect((self.gr_interleaved_short_to_complex_0, 0), (self.agc, 0)) self.connect((self.agc, 0), (self.pll, 0)) self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) self.connect((self.gr_moving_average_xx_0, 0), (self.gr_clock_recovery_mm_xx_0, 0)) self.connect((self.gr_binary_slicer_fb_0, 0), (self.poesweather_mn1_hrpt_deframer_0, 0)) self.connect((self.poesweather_mn1_hrpt_deframer_0, 0), (self.frame_sink, 0))
def __init__(self): gr.top_block.__init__(self, "FFT Sink Test") fft_size = 256 # build our flow graph input_rate = 2048.0e3 #Generate some noise noise = gr.noise_source_c(gr.GR_UNIFORM, 1.0/10) # Generate a complex sinusoid src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 2e3, 1) #src1 = gr.sig_source_c(input_rate, gr.GR_CONST_WAVE, 57.50e3, 1) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) test_fft = zmq_fft_sink_c(title="Complex Data", fft_size=fft_size, sample_rate=input_rate, baseband_freq=100e3, ref_level=0, y_per_div=20, y_divs=10) combine1 = gr.add_cc() #self.connect(src1, (combine1, 0)) #self.connect(noise,(combine1, 1)) self.connect(src1, thr1, test_fft)
def test_002null_symbol_resample_bb (self): ################################# # Testsequenz generieren src_data_0 = (1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0) ################################ # Ergebnis generieren exp_resu_0 = (1, 0, 1, 0, 1, 0) ################################# # Objekte erzeugen src_0 = gr.vector_source_b (src_data_0) throttle_0 = gr.throttle(gr.sizeof_char*1, 320000) null_symbol_resample = howto_swig.null_symbol_resample_bb(3) #Blockgroesse=3, Guardtime = 1, Blockanzahl=2, Offset=1 dst_0 = gr.vector_sink_b() # Objekte verbinden self.tb.connect(src_0, throttle_0, (null_symbol_resample,0)) self.tb.connect((null_symbol_resample,0), dst_0) # Simulationsstart self.tb.run () # Ergebnis auswerten result_data0 = dst_0.data () self.assertEqual(exp_resu_0, result_data0)
def test_011_viterbi_test (self): ################################# # Matlab Viterbi Testsequenz src_data_0 = (6.10,7.11,14.37,0.00,18.13,3.16,12.13,0.00,10.83,21.49,19.65,0.00,24.97,13.57,11.37,0.00,0.61,7.21,23.30,0.00,19.04,20.74,10.53,0.00,-3.65,-12.64,-26.67,0.00,10.62,-4.62,-14.32,0.00,10.05,10.80,-3.46,0.00,-13.44,5.20,-3.91,0.00,16.34,8.40,16.89,0.00,-1.75,-11.33,7.98,0.00,-6.68,6.79,4.78,0.00,14.16,14.18,6.76,0.00,16.59,-17.25,0.88,0.00,-10.88,-5.10,5.58,0.00,24.01,-13.35,10.51,0.00,11.26,-8.15,-5.66,0.00,-18.93,-3.86,13.61,0.00,-6.00,-13.72,7.79,0.00,10.92,13.47,10.58,0.00,13.48,-19.71,-14.66,0.00,-9.00,-3.13,-14.41,0.00,19.08,13.96,2.32,0.00,-12.29,-14.80,7.14,0.00,-10.17,11.90,12.99,0.00,-17.15,-15.61,14.06,0.00,-4.01,-29.32,10.65,0.00,-1.95,-5.50,-20.98,0.00,6.02,3.05,1.87,0.00,-7.55,-8.47,11.30,0.00,8.71,-1.94,3.38,0.00,2.87,-8.22,20.77,0.00,-11.54,-28.61,-8.87,0.00,-2.04,8.53,-4.38,0.00,17.10,-9.31,24.04,0.00,-11.07,-6.60,9.39,0.00,2.41,-1.03,-7.61,0.00,6.66,-4.19,12.54,0.00,-1.62,16.44,-9.85,0.00,-35.20,8.52,22.23,0.00,-5.33,20.10,-5.98,0.00,14.11,0.61,1.56,0.00,-8.76,-12.88,8.13,0.00,1.09,-19.52,15.89,0.00,20.90,-20.31,-15.97,0.00,-11.83,-12.27,-0.53,0.00,12.26,18.42,-11.01,0.00,-15.33,-7.92,-8.68,0.00,-10.56,-4.28,-3.37,0.00,-4.08,20.17,18.25,0.00,-22.93,10.72,16.22,0.00,23.35,21.93,3.91,0.00,-15.13,9.69,6.14,0.00,-7.97,13.64,3.36,0.00,17.49,2.76,8.93,0.00,-1.04,1.52,6.09,0.00,-9.85,20.94,14.51,0.00,30.77,2.21,14.93,0.00,1.65,-11.99,-10.15,0.00,-6.84,-7.58,-14.90,0.00,15.78,3.11,-4.94,0.00,10.68,25.81,-15.91,0.00,-2.15,15.15,5.80,0.00,-5.79,-16.44,13.01,0.00,8.91,7.15,7.54,0.00,15.27,-8.36,-9.58,0.00,-13.68,-4.94,10.56,0.00,-0.51,-7.36,-8.21,0.00,9.69,6.69,-10.96,0.00,5.83,10.17,4.06,0.00,22.13,-3.77,7.71,0.00,-5.97,-11.88,18.97,0.00,-6.80,15.29,20.14,0.00,-22.25,-4.53,-25.46,0.00,4.04,7.63,9.11,0.00,31.27,11.59,15.90,0.00,-14.39,-16.64,-7.78,0.00,17.13,-12.89,-7.93,0.00,-1.35,-26.56,11.43,0.00,-8.34,-13.67,7.63,0.00,14.59,5.34,-9.26,0.00,11.09,-10.86,-7.98,0.00,-3.41,18.91,8.10,0.00,4.80,0.85,-9.15,0.00,15.15,-15.19,10.12,0.00,2.81,-9.31,-0.66,0.00,2.39,3.08,10.51,0.00,9.41,-7.17,24.47,0.00,-10.28,-14.54,5.16,0.00,-23.50,13.94,-4.41,0.00,-11.50,-12.98,-11.52,0.00,7.96,-2.81,-8.01,0.00,-12.00,-0.85,9.06,0.00,-15.33,-6.42,-9.17,0.00,-20.85,-16.52,10.77,0.00,9.60,-20.00,-5.21,0.00,-13.22,1.68,15.86,0.00,1.24,22.38,9.85,0.00,9.24,-11.78,11.57,0.00,22.88,4.69,1.87,0.00,-1.52,-1.23,13.71,0.00,-10.35,28.43,-3.10,0.00,6.26,3.16,0.70,0.00,10.48,23.87,-15.81,0.00,12.97,15.49,16.29,0.00,14.15,-7.14,13.82,0.00,-2.81,-21.34,3.35,0.00,-4.55,3.14,6.03,0.00,-8.68,-36.42,-9.37,0.00,1.43,3.50,8.11,0.00,-2.87,-12.40,-4.15,0.00,-12.57,4.36,25.12,0.00,-7.36,17.17,-6.14,0.00,11.76,13.23,9.07,0.00,8.15,11.87,21.04,0.00,-9.05,-10.14,8.17,0.00,-3.56,10.56,-16.68,0.00,1.40,13.47,-16.17,0.00,11.59,3.32,-7.21,0.00,7.50,-12.02,-10.73,0.00,-22.25,10.72,9.96,0.00,-11.81,-2.41,8.60,0.00,17.73,10.29,-18.72,0.00,-9.52,8.01,-11.69,0.00,-2.50,-3.66,2.20,0.00,3.08,-21.95,-12.21,0.00,10.79,-26.07,8.52,0.00,-6.39,8.58,-14.17,0.00,8.98,-1.47,-1.91,0.00,-17.36,-6.53,3.86,0.00,-8.98,-18.15,4.99,0.00,-14.42,-19.02,-3.08,0.00,8.92,3.30,17.09,0.00,35.91,4.14,-7.48,0.00,-9.46,-9.49,0.65,0.00,-13.60,-12.13,-13.08,0.00,-14.48,-9.42,-11.51,0.00,-15.75,5.79,-8.93,0.00,-21.91,3.75,7.55,0.00,-26.59,4.90,5.46,0.00,-21.95,-2.00,15.01,0.00,1.95,8.13,-7.75,0.00,15.40,-3.06,0.28,0.00,-12.07,19.42,-16.81,0.00,7.35,-11.43,5.85,0.00,2.88,8.45,10.39,0.00,-14.39,-11.50,3.49,0.00,-8.89,8.83,4.91,0.00,14.71,2.32,14.16,0.00,9.87,-12.13,1.55,0.00,-15.27,-15.73,4.59,0.00,-13.15,8.11,-5.06,0.00,6.89,22.04,11.72,0.00,-21.54,-18.02,-8.12,0.00,-9.41,6.84,8.30,0.00,21.41,-7.08,-9.33,0.00,8.34,-9.89,-7.27,0.00,13.36,-5.71,18.51,0.00,10.31,-9.40,11.60,0.00,34.06,4.22,-18.35,0.00,-17.65,-18.96,-6.60,0.00,-9.40,-12.03,-2.93,0.00,8.54,-9.98,11.84,0.00,6.00,13.27,15.54,0.00,5.04,7.77,-1.80,0.00,2.07,15.19,-4.99,0.00,-12.38,8.71,-10.13,0.00,-7.99,-3.48,9.71,0.00,6.36,-6.29,-20.77,0.00,11.50,-7.51,6.06,0.00,-10.82,2.35,-5.31,0.00,-9.59,21.47,12.62,0.00,13.47,-8.04,15.76,0.00,-11.90,1.76,14.60,0.00,23.80,-16.77,-19.82,0.00,-8.35,6.00,-18.57,0.00,-13.57,-17.68,-19.84,0.00,10.00,-7.87,-9.05,0.00,12.58,6.23,17.57,0.00,-15.58,25.38,15.68,0.00,-3.96,15.09,7.94,0.00,-26.06,-7.72,-12.39,0.00,-6.65,-9.62,-10.31,0.00,12.46,-11.70,2.49,0.00,-11.44,-10.44,6.96,0.00,15.49,-14.99,12.62,0.00,6.91,-15.06,-9.04,0.00,-2.55,-13.63,10.27,0.00,27.95,3.21,-1.62,0.00,-15.52,11.13,4.41,0.00,11.22,7.92,-13.12,0.00,8.28,-6.33,-10.94,0.00,17.73,-5.05,10.03,0.00,-17.31,2.50,26.21,0.00,9.12,-20.21,-11.16,0.00,-12.77,16.14,-17.18,0.00,12.48,2.02,4.44,0.00,9.77,10.63,16.32,0.00,13.49,7.65,-1.75,0.00,-9.34,-1.29,21.86,0.00,26.00,1.23,23.37,0.00,-18.51,11.90,13.84,0.00,5.51,-18.28,-9.38,0.00,17.79,-8.54,14.96,0.00,-8.97,12.81,-7.70,0.00,-3.43,6.51,-7.64,0.00,-11.28,11.94,-11.32,0.00,21.17,-17.99,-4.99,0.00,6.19,6.62,14.13,0.00,-18.00,20.57,-7.63,0.00,8.34,-8.13,8.03,0.00,13.48,10.22,8.81,0.00,-4.21,-12.28,-10.53,0.00,7.31,-6.89,-16.45,0.00,-7.01,-11.17,-7.34,0.00,-9.81,-12.33,6.40,0.00,-9.98,12.96,-2.37,0.00,8.89,11.78,-2.87,0.00,23.69,9.57,-3.80,0.00,-4.11,21.25,9.48,0.00,7.04,13.89,1.87,0.00,-24.54,7.15,7.67,0.00,7.65,-11.11,3.47,0.00,10.42,-9.91,-1.98,0.00,-14.40,-1.61,20.83,0.00,20.47,10.08,31.24,0.00,-6.38,11.93,7.53,0.00,-13.44,4.55,-24.33,0.00,-8.88,-13.83,19.32,0.00,-16.57,6.90,4.06,0.00,-6.37,-25.32,-3.93,0.00,0.80,24.23,11.69,0.00,11.35,12.33,14.84,0.00,-4.95,-32.65,-8.25,0.00,9.27,-8.83,-5.68,0.00,-12.40,-9.31,11.87,0.00,14.25,14.49,-13.79,0.00,-13.85,12.86,-13.49,0.00,17.06,3.79,-8.20,0.00,-3.45,-6.10,-5.95,0.00,-13.15,-10.06,-10.93,0.00,18.64,-8.79,10.67,0.00,-5.09,-5.43,-0.23,0.00,13.75,-26.29,10.48,0.00,30.32,4.71,4.24,0.00,17.36,7.74,10.56,0.00,-1.94,-13.34,23.24,0.00,-0.74,18.54,-3.37,0.00,14.65,13.51,-14.69,0.00,-14.38,-15.24,10.92,0.00,-10.33,-8.51,-12.22,0.00,-24.09,-0.45,28.45,0.00,-13.65,17.67,-13.14,0.00,19.70,0.76,2.01,0.00,20.39,11.03,-7.79,0.00,-19.49,-21.86,-15.03,0.00,-8.97,-19.89,15.99,0.00,1.13,-30.56,-2.11,0.00,-2.07,3.48,11.71,0.00,-8.65,-1.82,-13.44,0.00,2.04,5.78,-13.08,0.00,11.85,5.93,-16.99,0.00,-28.90,9.54,23.02,0.00,-20.76,-14.48,5.51,0.00,5.52,4.91,14.65,0.00,-13.76,19.55,11.71,0.00,14.91,-22.55,2.56,0.00,-13.51,4.61,-22.87,0.00,-7.15,14.54,-3.19,0.00,13.92,-16.96,2.75,0.00,-3.61,-10.43,-16.55,0.00,5.06,-16.05,10.29,0.00,19.66,13.49,-8.63,0.00,15.30,12.81,13.74,0.00,3.97,-9.38,11.11,0.00,-18.28,-8.55,-8.49,0.00,-7.80,10.93,25.23,0.00,17.52,-18.41,-15.40,0.00,8.15,-21.36,17.28,0.00,-5.12,17.34,-12.89,0.00,-6.52,11.69,-28.40,0.00,-13.48,11.34,-21.74,0.00,13.18,-6.54,-17.74,0.00,5.54,30.61,5.47,0.00,15.93,-13.61,15.29,0.00,16.14,10.96,-8.18,0.00,-7.52,-4.84,13.06,0.00,17.46,10.65,-12.91,0.00,-8.62,13.11,-18.42,0.00,-22.99,-14.10,-10.73,0.00,-14.76,14.18,5.68,0.00,-6.13,13.16,-21.40,0.00,22.83,30.46,-3.56,0.00,-19.41,-13.17,-8.98,0.00,-11.71,-14.57,1.83,0.00,10.11,-25.61,16.48,0.00,-16.77,6.68,8.12,0.00,-23.66,8.51,13.06,0.00,26.88,15.51,4.13,0.00,9.10,-8.13,3.50,0.00,-7.77,-4.78,-6.69,0.00,-1.75,12.73,-11.83,0.00,12.28,-4.31,-26.17,0.00,-6.01,-12.84,17.11,0.00,5.64,26.76,14.41,0.00,12.90,-7.61,-9.63,0.00,13.24,10.44,-9.54,0.00,3.05,-5.53,-9.78,0.00,-5.76,8.89,14.20,0.00,-13.00,-14.11,-12.57,0.00,-5.28,-7.83,2.20,0.00,18.67,-11.70,7.02,0.00,-5.49,4.24,-17.36,0.00,-5.49,13.32,8.33,0.00,-10.86,9.50,8.33,0.00,-23.80,-17.43,-24.04,0.00,6.33,2.71,-3.97,0.00,7.55,11.74,-5.99,0.00,1.52,-15.62,-10.18,0.00,23.80,-5.64,15.31,0.00,-10.41,7.86,-1.33,0.00,-16.93,10.24,11.83,0.00,-16.11,15.05,-8.87,0.00,-5.06,-9.78,-32.81,0.00,-13.95,18.20,-8.33,0.00,-3.70,26.07,5.79,0.00,-2.39,19.30,-2.49,0.00,-3.78,-12.75,8.33,0.00,-15.44,11.57,-3.77,0.00,17.69,17.87,1.05,0.00,8.85,19.30,7.07,0.00,10.67,15.18,1.80,0.00,10.45,10.32,-10.76,0.00,17.16,4.43,17.66,0.00,-17.79,7.82,10.82,0.00,-19.37,13.70,-7.73,0.00,-8.58,-17.83,8.39,0.00,-12.27,12.98,5.72,0.00,20.93,17.90,7.82,0.00,-4.49,16.71,22.01,0.00,-6.07,3.20,-25.23,0.00,-20.65,-11.66,-3.48,0.00,-14.34,15.00,8.62,0.00,-21.27,16.29,8.49,0.00,22.34,24.45,-5.74,0.00,23.68,-7.32,-5.75,0.00,7.23,-10.39,-1.27,0.00,-0.67,1.55,3.91,0.00,12.17,10.17,18.50,0.00,-25.41,8.83,2.71,0.00,-15.53,5.40,5.46,0.00,-13.52,-13.86,-1.48,0.00,8.01,5.63,3.91,0.00,2.02,5.85,-5.33,0.00,-9.42,-12.67,-15.61,0.00,-14.33,-13.10,-7.68,0.00,2.81,-5.52,-12.57,0.00,9.22,18.92,13.12,0.00,-2.78,6.04,-9.31,0.00,17.56,-6.76,-11.39,0.00,11.49,7.68,9.73,0.00,8.27,-2.46,-6.43,0.00,1.80,19.12,-7.74,0.00,17.85,-17.11,11.51,0.00,-28.43,22.83,19.88,0.00,9.44,-6.70,-11.09,0.00,9.33,-19.32,-14.48,0.00,-23.05,10.32,26.66,0.00,9.71,11.75,-1.88,0.00,-10.19,5.44,18.02,0.00,7.72,13.54,10.42,0.00,2.72,-0.99,6.43,0.00,-4.85,-13.87,17.20,0.00,-13.54,13.48,-8.38,0.00,-9.87,-12.94,-22.09,0.00,11.85,-7.90,-1.60,0.00,-13.80,-23.10,12.48,0.00,-13.46,-7.88,-15.08,0.00,18.30,16.13,-18.17,0.00,-17.26,-1.09,-11.89,0.00,1.46,9.64,-8.66,0.00,12.53,3.12,11.93,0.00,14.62,-16.32,9.55,0.00,-14.04,-8.31,7.96,0.00,-14.39,9.22,9.54,0.00,-4.51,-5.79,-7.73,0.00,-11.53,-20.21,-8.32,0.00,1.49,-18.82,-1.47,0.00,4.11,17.75,-5.36,0.00,-6.44,10.37,-8.19,0.00,-10.20,-8.03,-6.37,0.00,-6.24,24.71,-3.66,0.00,-19.48,8.92,-16.02,0.00,-14.16,4.73,-19.98,0.00,10.24,-26.82,6.63,0.00,7.70,19.07,18.71,0.00,-10.86,-6.19,7.19,0.00,-7.83,4.01,2.37,0.00,4.99,10.69,16.30,0.00,-15.84,11.49,-25.02,0.00,-6.20,5.67,-16.26,0.00,1.11,-17.37,-5.38,0.00,12.19,6.59,-5.62,0.00,17.63,-15.32,2.32,0.00,-16.77,17.96,-1.53,0.00,9.30,-25.69,-22.52,0.00,-6.86,-1.58,-14.29,0.00,16.40,14.41,-2.16,0.00,-16.45,-17.25,-8.70,0.00,4.84,9.10,3.70,0.00,11.70,2.06,17.39,0.00,-5.55,-9.47,24.06,0.00,11.01,-7.12,-11.37,0.00,30.69,-8.31,7.38,0.00,2.16,-18.69,-14.38,0.00,-18.77,-11.41,-5.69,0.00,-5.02,-14.92,-28.45,0.00,-9.71,18.46,13.26,0.00,12.50,-11.56,11.81,0.00,4.52,-25.81,-1.44,0.00,15.98,17.61,-18.62,0.00,-9.76,6.79,25.02,0.00,-16.03,-8.58,13.47,0.00,6.24,14.82,-8.35,0.00,-15.16,24.51,6.62,0.00,-19.18,-13.57,2.16,0.00,9.95,7.32,1.67,0.00,-10.79,2.66,12.88,0.00,18.37,-8.19,2.10,0.00,-5.73,4.17,-15.85,0.00,1.88,-9.78,10.55,0.00,-23.09,-3.02,23.95,0.00,-11.18,6.55,-4.31,0.00,-16.39,-5.53,5.49,0.00,27.61,-13.95,-4.54,0.00,6.55,-12.33,22.44,0.00,12.84,-21.55,2.40,0.00,-9.85,-7.53,-9.16,0.00,16.50,-8.83,-9.94,0.00,3.73,3.37,-16.67,0.00,-9.53,7.32,16.32,0.00,-2.47,-7.89,-8.31,0.00,9.22,2.84,-10.16,0.00,15.58,10.75,14.53,0.00,4.32,-8.59,-8.31,0.00,-10.73,-5.90,22.67,0.00,14.32,22.38,10.25,0.00,18.39,-6.48,31.19,0.00,17.43,17.67,-20.44,0.00,-1.65,-8.23,-10.75,0.00,11.35,2.57,-17.09,0.00,16.36,2.75,-10.67,0.00,5.67,-6.76,14.17,0.00,11.78,-15.56,4.52,0.00,5.96,10.43,-14.99,0.00,24.61,28.53,-2.20,0.00,12.10,-10.41,-19.30,0.00,9.57,-12.32,-7.89,0.00,-19.11,5.29,-3.79,0.00,14.62,6.88,5.36,0.00,20.50,10.02,10.31,0.00,12.78,19.15,-3.10,0.00,8.53,12.14,-17.27,0.00,-1.77,10.68,7.29,0.00,13.45,15.14,-3.69,0.00,7.09,-13.15,-12.66,0.00,1.93,-6.89,12.26,0.00,-8.52,3.06,9.30,0.00,-20.46,8.65,1.64,0.00,4.10,2.79,-13.45,0.00,10.81,-15.56,7.23,0.00,12.87,-4.32,-12.42,0.00,12.35,10.06,1.91,0.00,-12.72,10.33,-18.24,0.00,14.37,-4.13,6.63,0.00,6.41,7.20,9.24,0.00,-12.28,-13.51,-0.78,0.00,-13.66,3.46,18.94,0.00,-1.36,8.50,10.91,0.00,4.43,4.28,13.15,0.00,6.99,-15.77,-5.60,0.00,-12.18,-12.90,-29.96,0.00,16.91,12.84,-10.45,0.00,-12.29,-27.03,1.79,0.00,10.47,4.81,2.26,0.00,-11.97,10.77,9.83,0.00,9.76,-10.20,-2.55,0.00,-2.12,5.66,-19.44,0.00,-5.90,-10.81,10.31,0.00,21.10,-11.10,-0.90,0.00,17.57,-12.43,-27.74,0.00,1.61,-4.58,4.28,0.00,8.80,-20.42,-12.06,0.00,-20.39,-1.43,5.50,0.00,-22.02,-9.48,-12.23,0.00,-2.94,-4.22,-6.13,0.00,-9.09,8.32,3.67,0.00,-5.95,12.00,5.57,0.00,12.04,12.69,25.97,0.00,-9.36,13.36,16.59,0.00,8.53,-15.41,-5.68,0.00,-17.96,5.88,12.27,0.00,20.40,8.04,-7.33,0.00,13.74,-5.88,-10.47,0.00,13.89,-14.06,-9.97,0.00,17.50,-8.63,-5.17,0.00,-21.00,26.24,8.40,0.00,-1.43,-5.47,7.84,0.00,-19.97,-10.06,-11.29,0.00,-12.05,-20.34,8.37,0.00,15.67,-5.55,-10.42,0.00,7.70,-4.05,-11.00,0.00,-13.40,4.31,15.10,0.00,-6.80,-16.44,-13.84,0.00,-17.63,-11.33,-7.64,0.00,-0.35,10.10,-17.31,0.00,-11.07,27.00,-6.81,0.00,-5.04,9.29,19.59,0.00,17.49,-5.72,9.76,0.00,14.40,-7.98,-4.71,0.00,11.53,7.39,3.10,0.00,-12.06,12.05,24.28,0.00,1.34,-14.74,11.50,0.00,-12.05,10.61,6.43,0.00,-10.83,21.94,-5.35,0.00,-12.82,-28.87,1.25,0.00,7.42,-6.77,7.22,0.00,-17.39,10.36,14.30,0.00,-7.76,5.57,-6.53,0.00,13.75,2.83,16.24,0.00,-9.07,-20.20,11.99,0.00,16.90,-9.01,15.45,0.00,16.91,-26.04,-20.39,0.00,-12.77,-3.57,-18.01,0.00,-12.35,-10.49,3.42,0.00,-16.94,11.92,9.03,0.00,-14.40,-8.18,18.56,0.00,-27.85,-21.92,17.45,0.00,-5.69,-35.54,-6.66,0.00,1.53,3.88,16.75,0.00,-3.71,-2.20,2.44,0.00,-9.79,6.17,-7.87,0.00,12.91,1.42,-2.66,0.00,3.16,5.66,-14.12,0.00,-13.48,23.61,6.23,0.00,1.49,12.01,2.90,0.00,20.26,-11.56,-16.99,0.00,-16.79,-8.39,13.69,0.00,3.28,0.80,-10.29,0.00,8.46,-5.71,16.30,0.00,-2.51,21.64,-13.52,0.00,24.50,-5.95,32.58,0.00,-6.85,-18.26,-7.43,0.00,-10.00,0.72,-0.95,0.00,7.07,-16.76,13.51,0.00,-0.90,-25.84,20.10,0.00,-15.97,14.95,12.37,0.00,-16.75,-16.59,0.35,0.00,-8.94,-17.39,-14.85,0.00,-22.05,-11.36,-11.60,0.00,-12.99,3.32,2.07,0.00,3.30,-13.55,-11.57,0.00,15.96,-7.58,-11.38,0.00,-17.41,34.20,-2.90,0.00,10.01,14.92,-4.40,0.00,5.97,19.12,3.89,0.00,-12.54,2.99,-7.19,0.00,-1.46,2.29,12.51,0.00,6.15,-13.56,21.03,0.00,-18.17,3.37,-9.77,0.00,2.37,-15.25,-16.37,0.00,-8.81,-9.48,12.49,0.00,22.78,4.13,-6.50,0.00,14.08,-18.16,-23.39,0.00,-3.72,20.38,-4.46,0.00,-9.18,-23.84,13.94,0.00,11.74,-5.05,9.93,0.00,22.04,-13.06,-11.66,0.00,-18.60,-7.87,15.92,0.00,-1.41,-10.32,5.84,0.00,11.18,10.03,8.34,0.00,8.80,-8.39,-2.85,0.00,30.54,2.88,9.48,0.00,3.79,-15.42,-12.05,0.00,4.91,21.98,26.78,0.00,14.54,-5.96,20.84,0.00,5.49,11.35,11.15,0.00,-21.10,-9.72,24.67,0.00,-16.88,10.71,-13.97,0.00,21.68,9.81,6.34,0.00,0.74,15.48,-9.28,0.00,5.03,11.68,9.32,0.00,-11.36,7.79,-15.45,0.00,-7.53,8.61,-11.70,0.00,2.29,-13.90,11.68,0.00,5.59,1.35,-12.77,0.00,-10.86,-21.24,13.81,0.00,4.40,8.00,0.68,0.00,-1.57,5.40,-8.52,0.00,14.26,-9.94,-15.40,0.00,6.59,10.71,-3.79,0.00,18.18,-9.71,-5.50,0.00,-16.25,9.54,-16.05,0.00,-5.58,-4.15,-9.90,0.00,7.87,-1.34,11.48,0.00,-19.13,-8.44,-11.66,0.00,17.24,-25.10,-7.55,0.00,11.35,14.58,3.82,0.00,-18.50,2.06,21.49,0.00,2.12,-15.71,-8.31,0.00,-6.48,8.88,12.90,0.00,-14.55,-3.30,2.89,0.00,-3.15,-2.17,-9.85,0.00,-14.66,-22.99,2.53,0.00,-4.14,4.19,0.87,0.00,-7.16,-17.51,-21.18,0.00,-8.86,-11.38,21.09,0.00,21.62,-9.79,-8.95,0.00,-4.20,16.96,-2.73,0.00,3.01,3.95,7.33,0.00,7.08,25.73,-13.60,0.00,2.19,4.50,-6.33,0.00,-4.25,9.82,-6.19,0.00,8.10,6.30,-19.24,0.00,-10.13,-12.77,-8.76,0.00,-10.69,-10.92,-6.40,0.00,11.87,-9.11,27.87,0.00,5.94,7.54,9.91,0.00,2.30,14.36,-20.13,0.00,-1.17,-9.00,13.09,0.00,-7.54,-1.90,4.73,0.00,-5.40,-13.01,-13.28,0.00,15.95,16.85,-6.48,0.00,-17.99,-3.86,11.87,0.00,22.21,12.94,-24.51,0.00,-15.17,12.80,10.74,0.00,-4.40,-4.93,-1.68,0.00,3.69,15.86,8.34,0.00,14.71,19.66,11.42,0.00,-7.93,-5.74,-21.73,0.00,13.29,-1.87,-2.47,0.00,-23.24,-7.96,4.49,0.00,-13.74,-27.19,7.37,0.00,9.65,13.01,-4.29,0.00,12.10,-2.53,-11.84,0.00,-23.78,5.41,5.75,0.00,-14.58,-13.23,1.06,0.00,-22.72,-15.77,12.05,0.00,-20.33,-11.30,8.48,0.00,11.66,9.07,6.97,0.00,16.97,-2.81,10.18,0.00,17.47,6.41,8.80,0.00,-32.99,-2.44,-9.58,0.00,-1.74,10.90,-10.26,0.00,-10.24,2.30,0.43,0.00,-18.67,25.66,9.54,0.00,-4.68,-13.03,9.09,0.00,4.57,11.83,-8.00,0.00,-19.24,8.21,-2.58,0.00,-11.74,-6.11,6.77,0.00,-10.33,3.78,18.26,0.00,15.46,9.26,-0.86,0.00,-19.45,12.31,8.85,0.00,11.77,13.83,-7.44,0.00,8.94,-14.79,18.51,0.00,15.39,-22.74,5.70,0.00,6.20,11.22,11.92,0.00,28.97,5.09,-12.75,0.00,-6.84,-13.25,-11.61,0.00,-8.80,-7.29,25.26,0.00,14.81,-13.17,-8.69,0.00,-20.68,6.70,14.87,0.00,13.06,18.15,5.01,0.00,-14.06,8.80,-4.02,0.00,-6.62,6.11,16.73,0.00,10.95,-8.68,-13.09,0.00,-3.77,10.53,-2.54,0.00,-1.41,-11.66,-7.13,0.00,8.59,-6.17,0.00,0.00,-15.65,-10.74,-4.94,0.00,-6.90,-3.98,-7.82,0.00,-27.66,18.54,-12.07,0.00,8.15,-17.29,3.59,0.00,-9.39,-11.95,-16.11,0.00,-8.98,19.46,6.72,0.00,24.29,-13.67,2.65,0.00,18.90,-18.36,0.00,0.00,12.03,15.32,-11.75,0.00,9.62,12.74,10.00,0.00,11.77,-31.63,-5.89,0.00,-11.23,-10.75,-9.24,0.00,10.49,22.14,12.03,0.00,-19.63,-12.28,2.59,0.00,-10.12,10.16,18.70,0.00,5.03,8.17,0.00,0.00,-8.70,6.66,-15.84,0.00,18.50,9.26,-1.75,0.00,-16.72,-16.54,9.70,0.00,-12.98,-23.68,-10.27,0.00,-6.37,-20.64,5.93,0.00,-3.50,7.46,-6.05,0.00,-20.80,-2.63,-2.01,0.00,11.80,-9.05,0.00,0.00,-3.68,-9.09,11.34,0.00,8.09,-6.36,-9.95,0.00,-17.14,19.63,3.92,0.00,15.55,12.00,-2.03,0.00,-22.40,13.11,-28.17,0.00,8.77,8.05,23.80,0.00,-26.97,-8.36,3.47,0.00,6.69,-7.24,0.00,0.00,13.52,-9.44,-9.72,0.00,12.50,-2.33,-14.73,0.00,1.05,-16.38,-19.06,0.00,1.71,-20.55,13.37,0.00,17.03,-10.56,6.76,0.00,-23.86,-13.22,26.04,0.00,6.20,-11.46,-11.85,0.00,-10.89,4.81,0.00,0.00,2.77,9.49,-11.40,0.00,7.91,16.04,-16.54,0.00,-15.34,14.14,-6.56,0.00,7.65,10.89,24.47,0.00,-23.78,-14.99,-11.06,0.00,10.52,-10.70,-6.16,0.00,-10.29,-6.47,-7.23,0.00,-6.51,-18.04,0.00,0.00,-18.43,11.25,-10.01,0.00,-20.75,-11.18,9.02,0.00,5.32,-13.00,10.19,0.00,8.95,-15.10,17.86,0.00,-2.82,-6.48,13.31,0.00,2.36,-19.37,15.00,0.00,-4.73,3.18,-13.54,0.00,-7.69,11.80,0.00,0.00,-9.04,2.61,17.40,0.00,10.17,-6.81,-5.82,0.00,-15.81,4.82,14.49,0.00,-14.84,-3.64,-18.41,0.00,-2.82,-15.04,-16.80,0.00,14.56,-21.95,4.96,0.00,18.61,11.91,-17.95,0.00,6.50,16.16,0.00,0.00,6.25,-20.54,25.95,0.00,11.76,-4.96,-2.19,0.00,4.56,17.59,-5.34,0.00,-0.63,25.03,-8.82,0.00,-7.63,-8.43,20.91,0.00,-6.66,24.04,-11.51,0.00,11.13,7.10,-8.41,0.00,8.32,5.50,0.00,0.00,15.49,-9.26,-12.22,0.00,-17.19,-17.38,-10.89,0.00,-19.05,-12.44,-3.04,0.00,-11.75,2.14,-9.19,0.00,-9.74,8.34,-12.20,0.00,9.38,-14.80,-12.98,0.00,13.19,4.20,-8.16,0.00,-0.44,18.91,0.00,0.00,19.87,17.17,-20.26,0.00,-3.78,-3.15,22.10,0.00,13.14,14.27,1.35,0.00,10.33,-15.14,0.60,0.00,-12.35,-4.41,-12.14,0.00,-10.31,9.82,11.10,0.00,9.42,-8.34,-14.66,0.00,-11.18,8.33,0.00,0.00,-28.87,-0.79,0.00,0.00,-21.69,9.05,0.00,0.00,-13.91,-18.71,0.00,0.00,28.28,1.05,0.00,0.00,2.75,25.92,0.00,0.00,15.85,5.32,0.00,0.00,) ################################ # Ergebnis Matlab Viterbi Testsequenz expected_result_0 = (0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,1,0,0,1,1,0,0,1,0,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,0,0,1,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,1,0,1,0,1,1,1,1,1,0,1,1,0,1,0,0,1,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,1,1,0,1,1,0,1,1,1,1,1,0,0,1,1,1,0,0,0,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,1,1,0,1,1,0,0,1,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,0,0,0,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,0,0,1,0,1,0,0,0,1,1,0,1,0,0,1,0,1,1,1,1,1,1,1,0,1,0,0,0,1,0,1,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,1,0,1,1,1,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,1,0,1,1,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,1,1,1,0,0,1,1,1,0,1,0,0,1,0,0,1,1,1,1,0,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,0,0,0,0,1,1,0,0,1,1,1,0,0,0,0,1,0,1,1,1,1,0,1,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,1,1,0,1,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,1,0,1,1,1,0,0,1,1,0,0,1,0,0,0,0,0,1,0,0,1,0,1,0,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,1,0,0,1,1,1,1,1,0,0,1,1,0,1,1,0,0,0,1,0,1,0,1,0,0,1,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,0,1,0,1,1,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1,1,0,0,0,0,1,0,0,1,1,1,0,0,1,0,1,0,1,0,1,1,0,0,0,0,1,1,0,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,0,1,0,0,0,1,0,1,0,0,0,0,1,0,1,0,1,1,0,1,0,0,1,1,1,1,1,1,0,1,1,0,0,1,0,0,1,0,0,1,0,1,1,0,1,1,1,1,1,1,0,0,1,0,0,1,1,0,1,1,1,1,0,0,1,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,) ################################# # Objekte erzeugen src_0 = gr.vector_source_f (src_data_0) throttle_0 = gr.throttle(gr.sizeof_float*1, 32000) s2v = gr.stream_to_vector(gr.sizeof_float, 3096) Viterbi = howto_swig.viterbi_vfb(3096) v2s = gr.vector_to_stream(gr.sizeof_char, 3096/4) dst_0 = gr.vector_sink_b() # Objekte verbinden self.tb.connect(src_0, throttle_0) self.tb.connect(throttle_0, s2v) self.tb.connect(s2v, Viterbi) self.tb.connect(Viterbi, v2s) self.tb.connect(v2s, dst_0) # Simulationsstart self.tb.run () # Ergebnis auswerten result_data0 = dst_0.data () result_data0 = result_data0 expected_result_0 = expected_result_0 self.assertEqual(expected_result_0, result_data0)
def __init__(self, decim=16, N_id_1=134, N_id_2=0): grc_wxgui.top_block_gui.__init__(self, title="Sss Corr Gui") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Parameters ################################################## self.decim = decim self.N_id_1 = N_id_1 self.N_id_2 = N_id_2 ################################################## # Variables ################################################## self.sss_start_ts = sss_start_ts = 10608 - 2048 - 144 self.samp_rate = samp_rate = 30720e3/decim ################################################## # Blocks ################################################## self.wxgui_scopesink2_0 = scopesink2.scope_sink_f( self.GetWin(), title="Scope Plot", sample_rate=200, v_scale=0, v_offset=0, t_scale=0, ac_couple=False, xy_mode=False, num_inputs=1, trig_mode=gr.gr_TRIG_MODE_AUTO, y_axis_label="Counts", ) self.Add(self.wxgui_scopesink2_0.win) self.gr_vector_to_stream_0 = gr.vector_to_stream(gr.sizeof_gr_complex*1, 2048/decim) self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate*decim) self.gr_stream_to_vector_0 = gr.stream_to_vector(gr.sizeof_gr_complex*1, 2048/decim) self.gr_skiphead_0 = gr.skiphead(gr.sizeof_gr_complex*1, sss_start_ts) self.gr_multiply_const_vxx_0 = gr.multiply_const_vcc((gen_sss_fd(N_id_1, N_id_2, 2048/decim).get_sss_conj_rev())) self.gr_integrate_xx_0 = gr.integrate_cc(2048/decim) self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*1, "/home/user/git/gr-lte/gr-lte/test/traces/lte_02_796m_30720k_frame.cfile", True) self.gr_fft_vxx_0 = gr.fft_vcc(2048/decim, True, (window.blackmanharris(1024)), True, 1) self.gr_complex_to_mag_0 = gr.complex_to_mag(1) self.fir_filter_xxx_0 = filter.fir_filter_ccc(decim, (firdes.low_pass(1, decim*samp_rate, 550e3, 100e3))) ################################################## # Connections ################################################## self.connect((self.gr_file_source_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_stream_to_vector_0, 0), (self.gr_fft_vxx_0, 0)) self.connect((self.gr_fft_vxx_0, 0), (self.gr_multiply_const_vxx_0, 0)) self.connect((self.gr_multiply_const_vxx_0, 0), (self.gr_vector_to_stream_0, 0)) self.connect((self.gr_vector_to_stream_0, 0), (self.gr_integrate_xx_0, 0)) self.connect((self.gr_integrate_xx_0, 0), (self.gr_complex_to_mag_0, 0)) self.connect((self.gr_complex_to_mag_0, 0), (self.wxgui_scopesink2_0, 0)) self.connect((self.gr_throttle_0, 0), (self.gr_skiphead_0, 0)) self.connect((self.gr_skiphead_0, 0), (self.fir_filter_xxx_0, 0)) self.connect((self.fir_filter_xxx_0, 0), (self.gr_stream_to_vector_0, 0))
def test_003_ofdm_symbol_cutter_cc(self): ################################# # Testsequenz generieren src_data_0 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 ] src_data_1 = [ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 ] ################################ # Ergebnis generieren exp_resu_0 = [ 5, 6, 7, 10, 11, 12, 16, 17, 18, 21, 22, 23, 28, 29, 30, 33 ] exp_resu_1 = (1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0) ################################# # Objekte erzeugen src_0 = gr.vector_source_c(src_data_0) src_1 = gr.vector_source_b(src_data_1) throttle_0 = gr.throttle(gr.sizeof_gr_complex * 1, 320000) throttle_1 = gr.throttle(gr.sizeof_char * 1, 320000) ofdm_symbole = howto_swig.ofdm_symbol_cutter_cc( 11, 3, 2, 2, 1) #Blockgroesse=3, Guardtime = 1, Blockanzahl=2, Offset=1 dst_0 = gr.vector_sink_c() dst_1 = gr.vector_sink_b() # Objekte verbinden self.tb.connect(src_0, throttle_0, (ofdm_symbole, 0)) self.tb.connect(src_1, throttle_1, (ofdm_symbole, 1)) self.tb.connect((ofdm_symbole, 0), dst_0) self.tb.connect((ofdm_symbole, 1), dst_1) # Simulationsstart self.tb.run() # Ergebnis auswerten result_data0 = dst_0.data() result_data1 = dst_1.data() self.assertComplexTuplesAlmostEqual(exp_resu_0, result_data0, 6) self.assertEqual(exp_resu_1, result_data1)
def __init__(self, callback, options): gr.top_block.__init__(self) if not options.channel_off: SNR = 10.0**(options.snr / 10.0) power_in_signal = abs(options.tx_amplitude)**2.0 noise_power_in_channel = power_in_signal / SNR noise_voltage = math.sqrt(noise_power_in_channel / 2.0) print "Noise voltage: ", noise_voltage frequency_offset = options.frequency_offset / options.fft_length print "Frequency offset: ", frequency_offset if options.multipath_on: taps = [1.0, .2, 0.0, .1, .08, -.4, .12, -.2, 0, 0, 0, .3] else: taps = [1.0, 0.0] else: noise_voltage = 0.0 frequency_offset = 0.0 taps = [1.0, 0.0] symbols_per_packet = math.ceil( ((4 + options.size + 4) * 8) / options.occupied_tones) samples_per_packet = (symbols_per_packet + 2) * (options.fft_length + options.cp_length) print "Symbols per Packet: ", symbols_per_packet print "Samples per Packet: ", samples_per_packet if options.discontinuous: stream_size = [ 100000, int(options.discontinuous * samples_per_packet) ] else: stream_size = [0, 100000] z = [ 0, ] self.zeros = gr.vector_source_c(z, True) self.txpath = transmit_path(options) #self.mux = gr.stream_mux(gr.sizeof_gr_complex, stream_size) self.throttle = gr.throttle(gr.sizeof_gr_complex, options.sample_rate) self.channel = gr.channel_model(noise_voltage, frequency_offset, options.clockrate_ratio, taps) self.rxpath = receive_path(callback, options) #self.connect(self.zeros, (self.mux,0)) #self.connect(self.txpath, (self.mux,1)) #self.connect(self.mux, self.throttle, self.channel, self.rxpath) #self.connect(self.mux, self.throttle, self.rxpath) self.connect(self.txpath, self.throttle, self.channel, self.rxpath) if options.log: self.connect(self.txpath, gr.file_sink(gr.sizeof_gr_complex, "txpath.dat"))
def __init__(self): gr.top_block.__init__(self, "LTE hierarchical Flowgraph") ################################################## # Variables ################################################## self.style = style = "tx_diversity" self.samp_rate = samp_rate = 7.68e6 self.fftlen = fftlen = 512 self.N_rb_dl = N_rb_dl = 6 ################################################## # Blocks ################################################## self.ext = lte_pbch_extraction( N_rb_dl=6, style=style, ) self.eq = demod_and_eq( fftlen=512, N_rb_dl=6, ) self.daemon = lte.cell_id_daemon(self.eq.eq.eq, self.ext.demux, self.ext.descr) self.synchronization_0 = synchronization( fftlen=512, daemon="daemon", ) self.lte_mib_unpack_vb_0 = lte.mib_unpack_vb() self.lte_bch_decode_0 = lte_bch_decode() self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex * 1, samp_rate) self.gr_file_source_0 = gr.file_source( gr.sizeof_gr_complex * 1, "/home/demel/Dokumente/Messungen/Messung_LTE_2012-05-23_12:47:32.dat", False) self.blks2_rational_resampler_xxx_0 = blks2.rational_resampler_ccc( interpolation=768, decimation=1000, taps=None, fractional_bw=None, ) ################################################## # Connections ################################################## self.connect((self.eq, 2), (self.ext, 2)) self.connect((self.eq, 1), (self.ext, 1)) self.connect((self.eq, 0), (self.ext, 0)) self.connect((self.synchronization_0, 0), (self.eq, 0)) self.connect((self.ext, 0), (self.lte_bch_decode_0, 0)) self.connect((self.lte_bch_decode_0, 1), (self.lte_mib_unpack_vb_0, 1)) self.connect((self.lte_bch_decode_0, 0), (self.lte_mib_unpack_vb_0, 0)) self.connect((self.gr_throttle_0, 0), (self.synchronization_0, 0)) self.connect((self.blks2_rational_resampler_xxx_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_file_source_0, 0), (self.blks2_rational_resampler_xxx_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Ais Demod Grc") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.sps = sps = 6 self.samp_rate = samp_rate = 100e3 self.nfilts = nfilts = 32 self.data_rate = data_rate = 9600 ################################################## # Blocks ################################################## self.wxgui_scopesink2_2 = scopesink2.scope_sink_f( self.GetWin(), title="Scope Plot", sample_rate=samp_rate / sps, v_scale=0, v_offset=0, t_scale=0, ac_couple=False, xy_mode=False, num_inputs=1, trig_mode=gr.gr_TRIG_MODE_AUTO, y_axis_label="Counts", ) self.Add(self.wxgui_scopesink2_2.win) self.random_source_x_0 = gr.vector_source_b( list(map(int, numpy.random.randint(0, 2, 1000))), True) self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex * 1, samp_rate * sps) self.gr_quadrature_demod_cf_0 = gr.quadrature_demod_cf(1) self.gr_map_bb_0 = gr.map_bb(([-1, 1])) self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf( sps, 0.004, (gr.firdes.gaussian(nfilts, float(nfilts) / sps, 0.4, int(11 * nfilts * sps))), nfilts, nfilts / 2, 1.5, 1) self.digital_pfb_clock_sync_xxx_0.set_beta((0.004**2) * 0.25) self.digital_gmskmod_bc_0 = digital.gmskmod_bc(sps, 0.4, 4) ################################################## # Connections ################################################## self.connect((self.gr_quadrature_demod_cf_0, 0), (self.wxgui_scopesink2_2, 0)) self.connect((self.gr_throttle_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) self.connect((self.digital_gmskmod_bc_0, 0), (self.gr_throttle_0, 0)) self.connect((self.random_source_x_0, 0), (self.gr_map_bb_0, 0)) self.connect((self.gr_map_bb_0, 0), (self.digital_gmskmod_bc_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.gr_quadrature_demod_cf_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 25000000 self.dec_rate = dec_rate = 25 ################################################## # Blocks ################################################## self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate/dec_rate, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.gr_unpacked_to_packed_xx_0 = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate) self.gr_freq_xlating_fir_filter_xxx_0 = gr.freq_xlating_fir_filter_ccc(dec_rate, (firdes.low_pass(1,samp_rate,1000000,100000)), -1000000, samp_rate) self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*1, "/shampoo/sdr/capture/j9Pro-capture/2400000000-25M-1.cap", False) self.gr_file_sink_0_0 = gr.file_sink(gr.sizeof_char*1, "/shampoo/sdr/projects/gr-nineeagles/gmsk-packed.out") self.gr_file_sink_0_0.set_unbuffered(False) self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char*1, "/shampoo/sdr/projects/gr-nineeagles/gmsk-unpacked.out") self.gr_file_sink_0.set_unbuffered(False) self.digital_gmsk_demod_0 = digital.gmsk_demod( samples_per_symbol=2, gain_mu=0.175, mu=0.5, omega_relative_limit=0.005, freq_error=0.0, verbose=False, log=False, ) ################################################## # Connections ################################################## self.connect((self.gr_file_source_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_unpacked_to_packed_xx_0, 0), (self.gr_file_sink_0_0, 0)) self.connect((self.digital_gmsk_demod_0, 0), (self.gr_file_sink_0, 0)) self.connect((self.digital_gmsk_demod_0, 0), (self.gr_unpacked_to_packed_xx_0, 0)) self.connect((self.gr_freq_xlating_fir_filter_xxx_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.gr_throttle_0, 0), (self.gr_freq_xlating_fir_filter_xxx_0, 0)) self.connect((self.gr_freq_xlating_fir_filter_xxx_0, 0), (self.digital_gmsk_demod_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/home/pfb/.local/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 32000 ################################################## # Blocks ################################################## self.gr_char_to_float_0 = gr.char_to_float() self.gr_scrambler_bb_0 = gr.scrambler_bb(0x8A, 0x7F, 7) self.gr_throttle_0 = gr.throttle(gr.sizeof_char * 1, samp_rate) self.gr_vector_source_x_0 = gr.vector_source_b((0, 0, 0), True, 1) self.wxgui_fftsink2_0 = fftsink2.fft_sink_f( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=50, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=30, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.wxgui_scopesink2_0 = scopesink2.scope_sink_f( self.GetWin(), title="Scope Plot", sample_rate=samp_rate, v_scale=1, v_offset=0, t_scale=0005, ac_couple=False, xy_mode=False, num_inputs=1, ) self.Add(self.wxgui_scopesink2_0.win) ################################################## # Connections ################################################## self.connect((self.gr_scrambler_bb_0, 0), (self.gr_char_to_float_0, 0)) self.connect((self.gr_char_to_float_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.gr_vector_source_x_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_throttle_0, 0), (self.gr_scrambler_bb_0, 0)) self.connect((self.gr_char_to_float_0, 0), (self.wxgui_scopesink2_0, 0))
def __init__(self): gr.top_block.__init__(self) Rs = 8000 f1 = 100 f2 = 200 npts = 2048 self.qapp = QtGui.QApplication(sys.argv) src1 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0) src2 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0) src = gr.add_cc() channel = filter.channel_model(0.01) thr = gr.throttle(gr.sizeof_gr_complex, 100*npts) self.snk1 = qtgui.time_sink_c(npts, Rs, "Complex Time Example", 1) self.connect(src1, (src,0)) self.connect(src2, (src,1)) self.connect(src, channel, thr, (self.snk1, 0)) #self.connect(src1, (self.snk1, 1)) #self.connect(src2, (self.snk1, 2)) self.ctrl_win = control_box() self.ctrl_win.attach_signal1(src1) self.ctrl_win.attach_signal2(src2) # Get the reference pointer to the SpectrumDisplayForm QWidget pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object # This can now be manipulated as a PyQt4.QtGui.QWidget pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) # Example of using signal/slot to set the title of a curve pyWin.connect(pyWin, QtCore.SIGNAL("setTitle(int, QString)"), pyWin, QtCore.SLOT("setTitle(int, QString)")) pyWin.emit(QtCore.SIGNAL("setTitle(int, QString)"), 0, "Re{sum}") self.snk1.set_title(1, "Im{Sum}") #self.snk1.set_title(2, "Re{src1}") #self.snk1.set_title(3, "Im{src1}") #self.snk1.set_title(4, "Re{src2}") #self.snk1.set_title(5, "Im{src2}") # Can also set the color of a curve #self.snk1.set_color(5, "blue") self.snk1.set_update_time(0.5) #pyWin.show() self.main_box = dialog_box(pyWin, self.ctrl_win) self.main_box.show()
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/home/pfb/.local/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 32000 ################################################## # Blocks ################################################## self.gr_char_to_float_0 = gr.char_to_float() self.gr_scrambler_bb_0 = gr.scrambler_bb(0x8A, 0x7F, 7) self.gr_throttle_0 = gr.throttle(gr.sizeof_char*1, samp_rate) self.gr_vector_source_x_0 = gr.vector_source_b((0, 0, 0), True, 1) self.wxgui_fftsink2_0 = fftsink2.fft_sink_f( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=50, ref_scale=2.0, sample_rate=samp_rate, fft_size=1024, fft_rate=30, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.wxgui_scopesink2_0 = scopesink2.scope_sink_f( self.GetWin(), title="Scope Plot", sample_rate=samp_rate, v_scale=1, v_offset=0, t_scale=0005, ac_couple=False, xy_mode=False, num_inputs=1, ) self.Add(self.wxgui_scopesink2_0.win) ################################################## # Connections ################################################## self.connect((self.gr_scrambler_bb_0, 0), (self.gr_char_to_float_0, 0)) self.connect((self.gr_char_to_float_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.gr_vector_source_x_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_throttle_0, 0), (self.gr_scrambler_bb_0, 0)) self.connect((self.gr_char_to_float_0, 0), (self.wxgui_scopesink2_0, 0))
def test_002_measure_processing_rate(self): src = gr.null_source(gr.sizeof_char) throttle = gr.throttle(gr.sizeof_char, 10000000) head = gr.head(gr.sizeof_char, 1000000) sink = dab_swig.measure_processing_rate(gr.sizeof_char,1000000) self.tb.connect(src, throttle, head, sink) self.tb.run() rate = sink.processing_rate() assert(rate > 8000000 and rate < 12000000)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 1000 ################################################## # Blocks ################################################## self.blks2_ofdm_mod_0 = grc_blks2.packet_mod_b(blks2.ofdm_mod( options=grc_blks2.options( modulation="bpsk", fft_length=1024, occupied_tones=256, cp_length=512, pad_for_usrp=True, log=None, verbose=None, ), ), payload_length=0, ) self.gr_float_to_char_0 = gr.float_to_char() self.gr_sig_source_x_0 = gr.sig_source_f(samp_rate, gr.GR_SIN_WAVE, 100, 127, 0) self.gr_throttle_0 = gr.throttle(gr.sizeof_char*1, samp_rate) self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=50, ref_scale=2.0, sample_rate=samp_rate*1000, fft_size=1024, fft_rate=30, average=False, avg_alpha=None, title="FFT Plot", peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) ################################################## # Connections ################################################## self.connect((self.gr_throttle_0, 0), (self.blks2_ofdm_mod_0, 0)) self.connect((self.gr_sig_source_x_0, 0), (self.gr_float_to_char_0, 0)) self.connect((self.gr_float_to_char_0, 0), (self.gr_throttle_0, 0)) self.connect((self.blks2_ofdm_mod_0, 0), (self.wxgui_fftsink2_0, 0))
def __init__(self, samp_rate, small_buffers): gr.top_block.__init__(self, "Test1") ################################################## # Variables ################################################## # self.samp_rate = samp_rate = 32000 self.lspace = lspace = 512 ################################################## # Blocks ################################################## self.latency_tagger_0 = latency.tagger(gr.sizeof_gr_complex, lspace, "latency0") self.latency_probe_0 = latency.probe(gr.sizeof_gr_complex, ["latency0"]) self.gr_vector_source_x_0 = gr.vector_source_c( (0, 1, 2, 3, 4, 5, 6, 7), True, 1) self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex * 1, samp_rate) self.gr_multiply_const_vxx_1 = gr.multiply_const_vcc((0, )) self.gr_multiply_const_vxx_0 = gr.multiply_const_vcc((0, )) self.gr_head_0 = gr.head(gr.sizeof_gr_complex * 1, nsamp) if small_buffers: for b in [ self.gr_vector_source_x_0, self.gr_head_0, self.latency_tagger_0, self.gr_multiply_const_vxx_0, self.gr_multiply_const_vxx_1 ]: b.set_max_output_buffer(1 * 1024) # b.set_min_output_buffer(100*1024); # b.set_max_noutput_items(256); ################################################## # Connections ################################################## self.connect((self.gr_head_0, 0), (self.latency_tagger_0, 0)) self.connect((self.gr_vector_source_x_0, 0), (self.gr_head_0, 0)) self.connect((self.gr_multiply_const_vxx_0, 0), (self.gr_multiply_const_vxx_1, 0)) self.connect((self.latency_tagger_0, 0), (self.gr_multiply_const_vxx_0, 0)) self.connect((self.gr_multiply_const_vxx_1, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_throttle_0, 0), (self.latency_probe_0, 0))
def __init__(self): gr.top_block.__init__(self) Rs = 8000 f1 = 100 f2 = 200 npts = 2048 self.qapp = QtGui.QApplication(sys.argv) src1 = gr.sig_source_f(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0) src2 = gr.sig_source_f(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0) src = gr.add_ff() thr = gr.throttle(gr.sizeof_float, 100*npts) noise = gr.noise_source_f(gr.GR_GAUSSIAN, 0.001) add = gr.add_ff() self.snk1 = qtgui.time_sink_f(npts, Rs, "Complex Time Example", 3) self.connect(src1, (src,0)) self.connect(src2, (src,1)) self.connect(src, thr, (add,0)) self.connect(noise, (add,1)) self.connect(add, self.snk1) self.connect(src1, (self.snk1, 1)) self.connect(src2, (self.snk1, 2)) self.ctrl_win = control_box() self.ctrl_win.attach_signal1(src1) self.ctrl_win.attach_signal2(src2) # Get the reference pointer to the SpectrumDisplayForm QWidget pyQt = self.snk1.pyqwidget() # Wrap the pointer as a PyQt SIP object # This can now be manipulated as a PyQt4.QtGui.QWidget pyWin = sip.wrapinstance(pyQt, QtGui.QWidget) # Example of using signal/slot to set the title of a curve pyWin.connect(pyWin, QtCore.SIGNAL("setTitle(int, QString)"), pyWin, QtCore.SLOT("setTitle(int, QString)")) pyWin.emit(QtCore.SIGNAL("setTitle(int, QString)"), 0, "sum") self.snk1.set_title(1, "src1") self.snk1.set_title(2, "src2") # Can also set the color of a curve #self.snk1.set_color(5, "blue") #pyWin.show() self.main_box = dialog_box(pyWin, self.ctrl_win) self.main_box.show()
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) # build our flow graph input_rate = 20.48e3 src2 = gr.sig_source_f(input_rate, gr.GR_SIN_WAVE, 2e3, 1) #src2 = gr.sig_source_f (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1) thr2 = gr.throttle(gr.sizeof_float, input_rate) sink2 = histo_sink_f(panel, title="Data", num_bins=31, frame_size=1000) vbox.Add(sink2.win, 1, wx.EXPAND) self.connect(src2, thr2, sink2)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) # build our flow graph input_rate = 20.48e3 src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 2e3, 1) #src2 = gr.sig_source_f (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1) thr2 = gr.throttle(gr.sizeof_float, input_rate) sink2 = histo_sink_f (panel, title="Data", num_bins=31, frame_size=1000) vbox.Add (sink2.win, 1, wx.EXPAND) self.connect(src2, thr2, sink2)
def __init__(self): gr.top_block.__init__(self) usage = "%prog: [options] samples_file" parser = OptionParser(option_class=eng_option, usage=usage) parser.add_option("-m", "--dab-mode", type="int", default=1, help="DAB mode [default=%default]") parser.add_option("-F", "--filter-input", action="store_true", default=False, help="Enable FFT filter at input") parser.add_option("-s", "--resample-fixed", type="float", default=1, help="resample by a fixed factor (fractional interpolation)") parser.add_option("-S", "--autocorrect-sample-rate", action="store_true", default=False, help="Estimate sample rate offset and resample (dynamic fractional interpolation)") parser.add_option('-r', '--sample-rate', type="int", default=2048000, help="Use non-standard sample rate (default=%default)") parser.add_option('-e', '--equalize-magnitude', action="store_true", default=False, help="Enable individual carrier magnitude equalizer") parser.add_option('-d', '--debug', action="store_true", default=False, help="Write output to files") parser.add_option('-v', '--verbose', action="store_true", default=False, help="Print status messages") (options, args) = parser.parse_args () dp = parameters.dab_parameters(options.dab_mode, verbose=options.verbose, sample_rate=options.sample_rate) rp = parameters.receiver_parameters(options.dab_mode, input_fft_filter=options.filter_input, autocorrect_sample_rate=options.autocorrect_sample_rate, sample_rate_correction_factor=options.resample_fixed, equalize_magnitude=options.equalize_magnitude, verbose=options.verbose) if len(args)<1: if options.verbose: print "-> using repeating random vector as source" self.sigsrc = gr.vector_source_c([10e6*(random.random() + 1j*random.random()) for i in range(0,100000)],True) self.ns_simulate = gr.vector_source_c([0.01]*dp.ns_length+[1]*dp.symbols_per_frame*dp.symbol_length,1) self.mult = gr.multiply_cc() # simulate null symbols ... self.src = gr.throttle( gr.sizeof_gr_complex,2048000) self.connect(self.sigsrc, (self.mult, 0)) self.connect(self.ns_simulate, (self.mult, 1)) self.connect(self.mult, self.src) else: filename = args[0] if options.verbose: print "-> using samples from file " + filename self.src = gr.file_source(gr.sizeof_gr_complex, filename, False) self.dab_demod = ofdm.ofdm_demod(dp, rp, debug=options.debug, verbose=options.verbose) self.connect(self.src, self.dab_demod) # sink output to nowhere self.nop0 = gr.nop(gr.sizeof_char*dp.num_carriers/4) self.nop1 = gr.nop(gr.sizeof_char) self.connect((self.dab_demod,0),self.nop0) self.connect((self.dab_demod,1),self.nop1)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) parser = OptionParser (option_class=eng_option) (options, args) = parser.parse_args () sample_rate = 16e3 mpoints = 4 ampl = 1000 freq = 0 lo_freq = 1e6 lo_ampl = 1 vbox.Add(slider.slider(panel, -sample_rate/2, sample_rate/2, self.set_lo_freq), 0, wx.ALIGN_CENTER) src = gr.sig_source_c(sample_rate, gr.GR_CONST_WAVE, freq, ampl, 0) self.lo = gr.sig_source_c(sample_rate, gr.GR_SIN_WAVE, lo_freq, lo_ampl, 0) mixer = gr.multiply_cc() self.connect(src, (mixer, 0)) self.connect(self.lo, (mixer, 1)) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr = gr.throttle(gr.sizeof_gr_complex, sample_rate) taps = gr.firdes.low_pass(1, # gain 1, # rate 1.0/mpoints * 0.4, # cutoff 1.0/mpoints * 0.1, # trans width gr.firdes.WIN_HANN) print len(taps) analysis = blks2.analysis_filterbank(mpoints, taps) self.connect(mixer, thr) self.connect(thr, analysis) for i in range(mpoints): fft = fftsink2.fft_sink_c(frame, fft_size=128, sample_rate=sample_rate/mpoints, fft_rate=5, title="Ch %d" % (i,)) self.connect((analysis, i), fft) vbox.Add(fft.win, 1, wx.EXPAND)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Ofdm New") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 10e3 ################################################## # Blocks ################################################## self.thr = gr.throttle(gr.sizeof_float * 1, samp_rate) self.src = gr.vector_source_f(([float(n) - 50 for n in range(100)]), True, 1) self.sink2 = scopesink2.scope_sink_f( self.GetWin(), title="Output", sample_rate=samp_rate, v_scale=0, v_offset=0, t_scale=0.002, ac_couple=False, xy_mode=False, num_inputs=1, trig_mode=gr.gr_TRIG_MODE_AUTO, y_axis_label="Counts", ) self.Add(self.sink2.win) self.sink = scopesink2.scope_sink_f( self.GetWin(), title="Input", sample_rate=samp_rate, v_scale=20, v_offset=0, t_scale=0.002, ac_couple=False, xy_mode=False, num_inputs=1, trig_mode=gr.gr_TRIG_MODE_AUTO, y_axis_label="Counts", ) self.Add(self.sink.win) self.ofdm_new_ff_0 = ofdm.ofdm_swig.new_ff() ################################################## # Connections ################################################## self.connect((self.src, 0), (self.thr, 0)) self.connect((self.thr, 0), (self.sink, 0)) self.connect((self.thr, 0), (self.ofdm_new_ff_0, 0)) self.connect((self.ofdm_new_ff_0, 0), (self.sink2, 0))
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) # build our flow graph input_rate = 20.48e3 # Generate a real and complex sinusoids src1 = gr.sig_source_f(input_rate, gr.GR_SIN_WAVE, 2.21e3, 1) src2 = gr.sig_source_c(input_rate, gr.GR_SIN_WAVE, 2.21e3, 1) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_float, input_rate) thr2 = gr.throttle(gr.sizeof_gr_complex, input_rate) sink1 = number_sink_f(panel, unit='V', label="Real Data", avg_alpha=0.001, sample_rate=input_rate, minval=-1, maxval=1, ref_level=0, decimal_places=3) vbox.Add(sink1.win, 1, wx.EXPAND) sink2 = number_sink_c(panel, unit='V', label="Complex Data", avg_alpha=0.001, sample_rate=input_rate, minval=-1, maxval=1, ref_level=0, decimal_places=3) vbox.Add(sink2.win, 1, wx.EXPAND) self.connect(src1, thr1, sink1) self.connect(src2, thr2, sink2)
def __init__(self): gr.top_block.__init__(self) xmtr_hack = True rcvr_hack = True self.options = self.run_parser() self.transceiver = bts_transceiver.proto_transceiver() if rcvr_hack: self.src = gr.throttle(itemsize=gr.sizeof_gr_complex, samples_per_sec=self.options.rx_samp_rate) self.f_src = gr.file_source(itemsize=gr.sizeof_gr_complex, filename=self.options.test_src, repeat=False) self.connect(self.f_src, self.src) else: self.bb_sink = gr.file_sink(itemsize=gr.sizeof_gr_complex, filename='bb_dump.dat') self.src = self.setup_src() self.connect(self.src, self.bb_sink) if xmtr_hack: self.snk = gr.throttle(itemsize=gr.sizeof_gr_complex, samples_per_sec=self.options.tx_samp_rate) self.fsnk = gr.file_sink(itemsize=gr.sizeof_gr_complex, filename=self.options.test_snk) self.connect(self.snk, self.fsnk) else: self.snk = self.setup_snk() self.fsnk = gr.file_sink(itemsize=gr.sizeof_gr_complex, filename=self.options.test_snk) self.connect(self.transceiver, self.fsnk) self.connect(self.src, self.transceiver) self.connect(self.transceiver, self.snk) #sleep for a bit, let the USRP clocks stablize and such time.sleep(1)
def __init__(self, host, port, pkt_size, sample_rate, eof): gr.top_block.__init__(self, "dial_tone_source") amplitude = 0.3 src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 350, amplitude) src1 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 440, amplitude) add = gr.add_ff() # Throttle needed here to account for the other side's audio card sampling rate thr = gr.throttle(gr.sizeof_float, sample_rate) sink = gr.udp_sink(gr.sizeof_float, host, port, pkt_size, eof=eof) self.connect(src0, (add, 0)) self.connect(src1, (add, 1)) self.connect(add, thr, sink)
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) default_input_rate = 1e6 if len(argv) > 1: input_rate = int(argv[1]) else: input_rate = default_input_rate if len(argv) > 2: v_scale = float(argv[2]) # start up at this v_scale value else: v_scale = None # start up in autorange mode, default if len(argv) > 3: t_scale = float(argv[3]) # start up at this t_scale value else: t_scale = .00003 * default_input_rate / input_rate # old behavior print "input rate %s v_scale %s t_scale %s" % (input_rate, v_scale, t_scale) # Generate a complex sinusoid ampl = 1.0e3 self.src0 = gr.sig_source_c(input_rate, gr.GR_SIN_WAVE, 25.1e3 * input_rate / default_input_rate, ampl) self.noise = gr.sig_source_c( input_rate, gr.GR_SIN_WAVE, 11.1 * 25.1e3 * input_rate / default_input_rate, ampl / 10) #self.noise =gr.noise_source_c(gr.GR_GAUSSIAN, ampl/10) self.combine = gr.add_cc() # We add this throttle block so that this demo doesn't suck down # all the CPU available. You normally wouldn't use it... self.thr = gr.throttle(gr.sizeof_gr_complex, input_rate) scope = scope_sink_c(panel, "Secret Data", sample_rate=input_rate, v_scale=v_scale, t_scale=t_scale) vbox.Add(scope.win, 1, wx.EXPAND) # Ultimately this will be # self.connect("src0 throttle scope") self.connect(self.src0, (self.combine, 0)) self.connect(self.noise, (self.combine, 1)) self.connect(self.combine, self.thr, scope)
def __init__(self): gr.top_block.__init__(self, "Top Block") Qt.QWidget.__init__(self) self.setWindowTitle("Top Block") self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) ################################################## # Variables ################################################## self.samp_rate = samp_rate = 32000 ################################################## # Blocks ################################################## self.qtgui_sink_x_0 = qtgui.sink_c( 1024, #fftsize firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "QT GUI Plot", #name True, #plotfreq True, #plotwaterfall True, #plottime True, #plotconst ) self.qtgui_sink_x_0.set_update_time(1.0 / 10) self._qtgui_sink_x_0_win = sip.wrapinstance( self.qtgui_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_sink_x_0_win) self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex * 1, samp_rate) self.analog_sig_source_x_0 = analog.sig_source_c( samp_rate, analog.GR_COS_WAVE, 1000, 1, 0) ################################################## # Connections ################################################## self.connect((self.analog_sig_source_x_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_throttle_0, 0), (self.qtgui_sink_x_0, 0))
def __init__(self): gr.top_block.__init__(self, "Demoder") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 32000 ################################################## # Blocks ################################################## self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex * 1, samp_rate) self.gr_head_0 = gr.head(gr.sizeof_gr_complex * 1, 1024 * 5) self.gr_file_source_0 = gr.file_source( gr.sizeof_gr_complex * 1, "/home/traviscollins/data/Models/USRP_Receiver/processed_data_C.txt", True) self.gr_file_sink_0 = gr.file_sink( gr.sizeof_char * 1, "/home/traviscollins/data/Models/Demoder/demod_data_B.txt") self.gr_file_sink_0.set_unbuffered(False) self.digital_dxpsk_demod_0 = digital.dbpsk_demod(samples_per_symbol=2, excess_bw=0.35, freq_bw=6.28 / 100.0, phase_bw=6.28 / 100.0, timing_bw=6.28 / 100.0, gray_coded=True, verbose=False, log=False) self.blks2_packet_decoder_0 = grc_blks2.packet_demod_b( grc_blks2.packet_decoder( access_code="", threshold=-1, callback=lambda ok, payload: self.blks2_packet_decoder_0. recv_pkt(ok, payload), ), ) ################################################## # Connections ################################################## self.connect((self.gr_head_0, 0), (self.digital_dxpsk_demod_0, 0)) self.connect((self.digital_dxpsk_demod_0, 0), (self.blks2_packet_decoder_0, 0)) self.connect((self.blks2_packet_decoder_0, 0), (self.gr_file_sink_0, 0)) self.connect((self.gr_file_source_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_throttle_0, 0), (self.gr_head_0, 0))
def __init__(self, frame, panel, vbox, argv): stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) parser = OptionParser (option_class=eng_option) (options, args) = parser.parse_args () sample_rate = 16e6 mpoints = 16 ampl = 1000 enable = mpoints/2 * [1, 0] enable[0] = 1 taps = gr.firdes.low_pass(1, # gain 1, # rate 1.0/mpoints * 0.4, # cutoff 1.0/mpoints * 0.1, # trans width gr.firdes.WIN_HANN) synth = blks2.synthesis_filterbank(mpoints, taps) null_source = gr.null_source(gr.sizeof_gr_complex) if 1: for i in range(mpoints): s = gr.sig_source_c(sample_rate/mpoints, gr.GR_SIN_WAVE, 300e3, ampl * enable[i], 0) self.connect(s, (synth, i)) else: for i in range(mpoints): if i == 1: #s = gr.sig_source_c(sample_rate/mpoints, gr.GR_SIN_WAVE, # 300e3, ampl * enable[i], 0) s = random_noise_c(ampl) self.connect(s, (synth, i)) else: self.connect(null_source, (synth, i)) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr = gr.throttle(gr.sizeof_gr_complex, sample_rate) fft = fftsink2.fft_sink_c(frame, fft_size=1024,sample_rate=sample_rate) vbox.Add(fft.win, 1, wx.EXPAND) self.connect(synth, thr, fft)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Howto Square") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 10e3 ################################################## # Blocks ################################################## self.sink = scopesink2.scope_sink_f( self.GetWin(), title="Input", sample_rate=samp_rate, v_scale=20, v_offset=0, t_scale=0.002, ac_couple=False, xy_mode=False, num_inputs=1, ) self.Add(self.sink.win) self.sink2 = scopesink2.scope_sink_f( self.GetWin(), title="Output", sample_rate=samp_rate, v_scale=0, v_offset=0, t_scale=0.002, ac_couple=False, xy_mode=False, num_inputs=1, ) self.Add(self.sink2.win) self.sqr = howto.square_ff() self.src = gr.vector_source_f(([float(n) - 50 for n in range(100)]), True, 1) self.thr = gr.throttle(gr.sizeof_float * 1, samp_rate) ################################################## # Connections ################################################## self.connect((self.thr, 0), (self.sqr, 0)) self.connect((self.src, 0), (self.thr, 0)) self.connect((self.thr, 0), (self.sink, 0)) self.connect((self.sqr, 0), (self.sink2, 0))
def __init__(self, mod_class, demod_class, rx_callback, options): gr.top_block.__init__(self) channelon = True SNR = 10.0**(options.snr / 10.0) frequency_offset = options.frequency_offset power_in_signal = abs(options.tx_amplitude)**2 noise_power = power_in_signal / SNR noise_voltage = math.sqrt(noise_power) # With new interface, sps does not get set by default, but # in the loopback, we don't recalculate it; so just force it here if (options.samples_per_symbol == None): options.samples_per_symbol = 2 self.txpath = transmit_path(mod_class, options) self.throttle = gr.throttle(gr.sizeof_gr_complex, options.sample_rate) self.rxpath = receive_path(demod_class, rx_callback, options) if channelon: self.channel = gr.channel_model(noise_voltage, frequency_offset, 1.01) if options.discontinuous: z = 20000 * [ 0, ] self.zeros = gr.vector_source_c(z, True) packet_size = 5 * ((4 + 8 + 4 + 1500 + 4) * 8) self.mux = gr.stream_mux( gr.sizeof_gr_complex, [packet_size - 0, int(9e5)]) # Connect components self.connect(self.txpath, (self.mux, 0)) self.connect(self.zeros, (self.mux, 1)) self.connect(self.mux, self.channel, self.rxpath) else: self.connect(self.txpath, self.channel, self.rxpath) else: # Connect components self.connect(self.txpath, self.throttle, self.rxpath)