def test_or_bb_2i (self):
     src1_data =       (1,  2,  3,  0x04,   0x50)
     src2_data =       (8,  2,  1 , 0x08,   0x05)
     expected_result = (9,  2,  3,  0x0C,   0x55)
     op = gr.or_bb (2)
     self.help_bb ((src1_data, src2_data),
                   expected_result, op, port_prefix='byte_in_')
Esempio n. 2
0
 def test_or_bb (self):
     src1_data =       (1,  2, 2,  3,  0x04,   0x50)
     src2_data =       (8,  2, 2,  1 , 0x08,   0x05)
     src3_data =       (8,  2, 1,  1 , 0x08,   0x05)
     expected_result = (9,  2, 3,  3,  0x0C,   0x55)
     op = gr.or_bb ()
     self.help_bb ((src1_data, src2_data, src3_data),
                   expected_result, op)
 def test_or_bb_2i(self):
     src1_data = (1, 2, 3, 0x04, 0x50)
     src2_data = (8, 2, 1, 0x08, 0x05)
     expected_result = (9, 2, 3, 0x0C, 0x55)
     op = gr.or_bb(2)
     self.help_bb((src1_data, src2_data),
                  expected_result,
                  op,
                  port_prefix='byte_in_')
 def test_or_bb_4i (self):
     src1_data =       (1,  2, 2,  3 , 0x04,   0x50)
     src2_data =       (8,  2, 2,  1 , 0x08,   0x05)
     src3_data =       (8,  2, 1,  1 , 0x18,   0x05)
     src4_data =       (8,  2, 1,  5 , 0x58,   0x15)
     expected_result = (9,  2, 3,  7,  0x5C,   0x55)
     op = gr.or_bb (4)
     self.help_bb ((src1_data, src2_data, src3_data, src4_data),
                   expected_result, op, port_prefix='byte_in_')
 def test_or_bb_4i(self):
     src1_data = (1, 2, 2, 3, 0x04, 0x50)
     src2_data = (8, 2, 2, 1, 0x08, 0x05)
     src3_data = (8, 2, 1, 1, 0x18, 0x05)
     src4_data = (8, 2, 1, 5, 0x58, 0x15)
     expected_result = (9, 2, 3, 7, 0x5C, 0x55)
     op = gr.or_bb(4)
     self.help_bb((src1_data, src2_data, src3_data, src4_data),
                  expected_result,
                  op,
                  port_prefix='byte_in_')
Esempio n. 6
0
	def __init__(self):
		grc_wxgui.top_block_gui.__init__(self, title="Top Block")

		##################################################
		# Variables
		##################################################
		self.samp_rate = samp_rate = 2000000
		self.dec_rate = dec_rate = 4

		##################################################
		# Blocks
		##################################################
		self.gr_throttle_1 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate/dec_rate)
		self.gr_or_xx_0 = gr.or_bb()
		self.gr_freq_xlating_fir_filter_xxx_0 = gr.freq_xlating_fir_filter_ccc(dec_rate, (firdes.low_pass(1,samp_rate,500000,100000)), -535000, samp_rate)
		self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*1, "/shampoo/sdr/capture/nrf-capture/2410500000-2M-1.cap", False)
		self.gr_file_sink_0_0 = gr.file_sink(gr.sizeof_char*1, "/shampoo/sdr/projects/gr-nordic/gmsk-correlate2.out")
		self.gr_file_sink_0_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,
		)
		self.digital_correlate_access_code_bb_0_0 = digital.correlate_access_code_bb("010101010", 0)
		self.digital_correlate_access_code_bb_0 = digital.correlate_access_code_bb("101010101", 0)

		##################################################
		# Connections
		##################################################
		self.connect((self.gr_file_source_0, 0), (self.gr_freq_xlating_fir_filter_xxx_0, 0))
		self.connect((self.gr_freq_xlating_fir_filter_xxx_0, 0), (self.gr_throttle_1, 0))
		self.connect((self.gr_throttle_1, 0), (self.digital_gmsk_demod_0, 0))
		self.connect((self.digital_gmsk_demod_0, 0), (self.digital_correlate_access_code_bb_0, 0))
		self.connect((self.digital_gmsk_demod_0, 0), (self.digital_correlate_access_code_bb_0_0, 0))
		self.connect((self.digital_correlate_access_code_bb_0_0, 0), (self.gr_or_xx_0, 1))
		self.connect((self.digital_correlate_access_code_bb_0, 0), (self.gr_or_xx_0, 0))
		self.connect((self.gr_or_xx_0, 0), (self.gr_file_sink_0_0, 0))