def key_factory(index): print "FACTORY CALLED index = %d"%(index); r = es.es_pyhandler(); excess_bw = 0.5; sps = 4; amplitude = sig_amp; taps = gr.firdes.root_raised_cosine(sps*amplitude, # Gain sps, # Sampling rate 1.0, # Symbol rate excess_bw, # Roll-off factor 11*sps) # Number of taps blocks = {}; blocks["src"] = es.vector_source([1]) blocks["scrambler"] = digital.scrambler_bb(0x8A, 0x7F, 7); blocks["mapper"] = digital.chunks_to_symbols_bc( [-1+0j, 0+1j, 1+0j, 0-1j] ); blocks["rrc"] = filter.interp_fir_filter_ccf(sps, taps); r.sink = es.vector_sink([gr.sizeof_gr_complex]); r.set_pyb2(blocks); tb = gr.top_block(); tb.connect( blocks["src"], blocks["scrambler"], blocks["mapper"], blocks["rrc"], r.sink ); r.tb = tb.to_top_block(); return r;
def key_factory(index): print "FACTORY CALLED index = %d" % (index) r = es.es_pyhandler() excess_bw = 0.5 sps = 4 amplitude = sig_amp taps = gr.firdes.root_raised_cosine( sps * amplitude, # Gain sps, # Sampling rate 1.0, # Symbol rate excess_bw, # Roll-off factor 11 * sps) # Number of taps blocks = {} blocks["src"] = es.vector_source([1]) blocks["scrambler"] = digital.scrambler_bb(0x8A, 0x7F, 7) blocks["mapper"] = digital.chunks_to_symbols_bc( [-1 + 0j, 0 + 1j, 1 + 0j, 0 - 1j]) blocks["rrc"] = filter.interp_fir_filter_ccf(sps, taps) r.sink = es.vector_sink([gr.sizeof_gr_complex]) r.set_pyb2(blocks) tb = gr.top_block() tb.connect(blocks["src"], blocks["scrambler"], blocks["mapper"], blocks["rrc"], r.sink) r.tb = tb.to_top_block() return r
def factory_cb(index): print "FACTORY CALLED index = %d"%(index); r = es.es_pyhandler(); src = gr.vector_source_b([10,20,30]); r.sink = es.vector_sink([1]); tb = gr.top_block(); tb.connect(src, r.sink); r.tb = tb.to_top_block(); r.blocks["src"] = src.to_basic_block(); return r;
def factory_cb(index): print "FACTORY CALLED index = %d" % (index) r = es.es_pyhandler() src = gr.vector_source_b([10, 20, 30]) r.sink = es.vector_sink([1]) tb = gr.top_block() tb.connect(src, r.sink) r.tb = tb.to_top_block() r.blocks["src"] = src.to_basic_block() return r
def key_factory(index): print "FACTORY CALLED index = %d"%(index); r = es.es_pyhandler(); src_L = gr.sig_source_f( 48e3, gr.GR_SIN_WAVE, 1440.0, 1.0, 0 ); src_R = gr.sig_source_f( 48e3, gr.GR_SIN_WAVE, 480.0, 1.0, 0 ); head_L = gr.head( gr.sizeof_float, evt_len ); head_R = gr.head( gr.sizeof_float, evt_len ); r.sink = es.vector_sink([gr.sizeof_float, gr.sizeof_float]); tb = gr.top_block(); tb.connect( (src_L,0), (head_L,0), (r.sink,0) ); tb.connect( (src_R,0), (head_R,0), (r.sink,1) ); # store blocks where we can get to them blocks = {}; blocks["src_L"] = src_L; blocks["src_R"] = src_R; blocks["head_L"] = head_L; blocks["head_R"] = head_R; r.set_pyb2(blocks); r.tb = tb.to_top_block(); return r;
def test_factory_cb(index): print "test_factory_cb called with index = %d"%(index); r = es.es_pyhandler(); r.set_b2( {} ); return r;
def test_factory_cb(index): print "test_factory_cb called with index = %d" % (index) r = es.es_pyhandler() r.set_b2({}) return r