本文整理汇总了Python中gnuradio.gr.sizeof_gr_complex方法的典型用法代码示例。如果您正苦于以下问题:Python gr.sizeof_gr_complex方法的具体用法?Python gr.sizeof_gr_complex怎么用?Python gr.sizeof_gr_complex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnuradio.gr
的用法示例。
在下文中一共展示了gr.sizeof_gr_complex方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, OSR=4, fc=939.4e6, samp_rate=0.4e6):
gr.hier_block2.__init__(
self, "Wideband receiver",
gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
gr.io_signature(0, 0, 0),
)
self.message_port_register_hier_out("bursts")
self.message_port_register_hier_out("msgs")
self.__init(OSR, fc, samp_rate)
示例2: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gain, bandwidth, port):
gr.top_block.__init__(self, "Top Block")
self.sample_rate = sample_rate
self.rf_gain = rf_gain
self.port = port
self.if_gain = if_gain
self.frequency = frequency
self.freq_correction = freq_correction
self.bb_gain = bb_gain
self.bandwidth = bandwidth
self.osmosdr_source_0 = osmosdr.source(
args="numchan=" + str(1) + " " + 'uhd'
)
self.osmosdr_source_0.set_time_unknown_pps(osmosdr.time_spec_t())
self.osmosdr_source_0.set_sample_rate(sample_rate)
self.osmosdr_source_0.set_center_freq(frequency, 0)
self.osmosdr_source_0.set_freq_corr(freq_correction, 0)
self.osmosdr_source_0.set_gain(rf_gain, 0)
self.osmosdr_source_0.set_if_gain(if_gain, 0)
self.osmosdr_source_0.set_bb_gain(bb_gain, 0)
self.osmosdr_source_0.set_antenna('', 0)
self.osmosdr_source_0.set_bandwidth(bandwidth, 0)
self.blocks_tcp_server_sink_0 = blocks.tcp_server_sink(gr.sizeof_gr_complex*1, '127.0.0.1', port, False)
self.connect((self.osmosdr_source_0, 0), (self.blocks_tcp_server_sink_0, 0))
示例3: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gain, bandwidth, port):
gr.top_block.__init__(self, "Top Block")
self.sample_rate = sample_rate
self.rf_gain = rf_gain
self.port = port
self.if_gain = if_gain
self.frequency = frequency
self.freq_correction = freq_correction
self.bb_gain = bb_gain
self.bandwidth = bandwidth
self.osmosdr_sink_0 = osmosdr.sink(
args="numchan=" + str(1) + " " + 'uhd'
)
self.osmosdr_sink_0.set_time_unknown_pps(osmosdr.time_spec_t())
self.osmosdr_sink_0.set_sample_rate(sample_rate)
self.osmosdr_sink_0.set_center_freq(frequency, 0)
self.osmosdr_sink_0.set_freq_corr(freq_correction, 0)
self.osmosdr_sink_0.set_gain(rf_gain, 0)
self.osmosdr_sink_0.set_if_gain(if_gain, 0)
self.osmosdr_sink_0.set_bb_gain(bb_gain, 0)
self.osmosdr_sink_0.set_antenna('', 0)
self.osmosdr_sink_0.set_bandwidth(bandwidth, 0)
self.blocks_udp_source_0 = blocks.udp_source(gr.sizeof_gr_complex * 1, '127.0.0.1', port, 65536, False)
self.connect((self.blocks_udp_source_0, 0), (self.osmosdr_sink_0, 0))
示例4: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gain, bandwidth, port):
gr.top_block.__init__(self, "Top Block")
self.sample_rate = sample_rate
self.rf_gain = rf_gain
self.port = port
self.if_gain = if_gain
self.frequency = frequency
self.freq_correction = freq_correction
self.bb_gain = bb_gain
self.bandwidth = bandwidth
self.osmosdr_source_0 = osmosdr.source(
args="numchan=" + str(1) + " " + 'bladerf'
)
self.osmosdr_source_0.set_time_unknown_pps(osmosdr.time_spec_t())
self.osmosdr_source_0.set_sample_rate(sample_rate)
self.osmosdr_source_0.set_center_freq(frequency, 0)
self.osmosdr_source_0.set_freq_corr(freq_correction, 0)
self.osmosdr_source_0.set_gain(rf_gain, 0)
self.osmosdr_source_0.set_if_gain(if_gain, 0)
self.osmosdr_source_0.set_bb_gain(bb_gain, 0)
self.osmosdr_source_0.set_antenna('', 0)
self.osmosdr_source_0.set_bandwidth(bandwidth, 0)
self.blocks_tcp_server_sink_0 = blocks.tcp_server_sink(gr.sizeof_gr_complex * 1, '127.0.0.1', port, False)
self.connect((self.osmosdr_source_0, 0), (self.blocks_tcp_server_sink_0, 0))
示例5: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gain, bandwidth, port):
gr.top_block.__init__(self, "Top Block")
self.sample_rate = sample_rate
self.rf_gain = rf_gain
self.port = port
self.if_gain = if_gain
self.frequency = frequency
self.freq_correction = freq_correction
self.bb_gain = bb_gain
self.bandwidth = bandwidth
self.osmosdr_source_0 = osmosdr.source(
args="numchan=" + str(1) + " " + 'hackrf'
)
self.osmosdr_source_0.set_time_unknown_pps(osmosdr.time_spec_t())
self.osmosdr_source_0.set_sample_rate(sample_rate)
self.osmosdr_source_0.set_center_freq(frequency, 0)
self.osmosdr_source_0.set_freq_corr(freq_correction, 0)
self.osmosdr_source_0.set_gain(rf_gain, 0)
self.osmosdr_source_0.set_if_gain(if_gain, 0)
self.osmosdr_source_0.set_bb_gain(bb_gain, 0)
self.osmosdr_source_0.set_antenna('', 0)
self.osmosdr_source_0.set_bandwidth(bandwidth, 0)
self.blocks_tcp_server_sink_0 = blocks.tcp_server_sink(gr.sizeof_gr_complex * 1, '127.0.0.1', port, False)
self.connect((self.osmosdr_source_0, 0), (self.blocks_tcp_server_sink_0, 0))
示例6: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gain, bandwidth, port):
gr.top_block.__init__(self, "Top Block")
self.sample_rate = sample_rate
self.rf_gain = rf_gain
self.port = port
self.if_gain = if_gain
self.frequency = frequency
self.freq_correction = freq_correction
self.bb_gain = bb_gain
self.bandwidth = bandwidth
self.osmosdr_source_0 = osmosdr.source(
args="numchan=" + str(1) + " " + 'sdrplay'
)
self.osmosdr_source_0.set_time_unknown_pps(osmosdr.time_spec_t())
self.osmosdr_source_0.set_sample_rate(sample_rate)
self.osmosdr_source_0.set_center_freq(frequency, 0)
self.osmosdr_source_0.set_freq_corr(freq_correction, 0)
self.osmosdr_source_0.set_gain(rf_gain, 0)
self.osmosdr_source_0.set_if_gain(if_gain, 0)
self.osmosdr_source_0.set_bb_gain(bb_gain, 0)
self.osmosdr_source_0.set_antenna('', 0)
self.osmosdr_source_0.set_bandwidth(bandwidth, 0)
self.blocks_tcp_server_sink_0 = blocks.tcp_server_sink(gr.sizeof_gr_complex * 1, '127.0.0.1', port, False)
self.connect((self.osmosdr_source_0, 0), (self.blocks_tcp_server_sink_0, 0))
示例7: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gain, bandwidth, port):
gr.top_block.__init__(self, "Top Block")
self.sample_rate = sample_rate
self.rf_gain = rf_gain
self.port = port
self.if_gain = if_gain
self.frequency = frequency
self.freq_correction = freq_correction
self.bb_gain = bb_gain
self.bandwidth = bandwidth
self.osmosdr_source_0 = osmosdr.source(
args="numchan=" + str(1) + " " + 'fcd'
)
self.osmosdr_source_0.set_time_unknown_pps(osmosdr.time_spec_t())
self.osmosdr_source_0.set_sample_rate(sample_rate)
self.osmosdr_source_0.set_center_freq(frequency, 0)
self.osmosdr_source_0.set_freq_corr(freq_correction, 0)
self.osmosdr_source_0.set_gain(rf_gain, 0)
self.osmosdr_source_0.set_if_gain(if_gain, 0)
self.osmosdr_source_0.set_bb_gain(bb_gain, 0)
self.osmosdr_source_0.set_antenna('', 0)
self.osmosdr_source_0.set_bandwidth(bandwidth, 0)
self.blocks_tcp_server_sink_0 = blocks.tcp_server_sink(gr.sizeof_gr_complex * 1, '127.0.0.1', port, False)
self.connect((self.osmosdr_source_0, 0), (self.blocks_tcp_server_sink_0, 0))
示例8: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gain, bandwidth, port):
gr.top_block.__init__(self, "Top Block")
self.sample_rate = sample_rate
self.rf_gain = rf_gain
self.port = port
self.if_gain = if_gain
self.frequency = frequency
self.freq_correction = freq_correction
self.bb_gain = bb_gain
self.bandwidth = bandwidth
self.osmosdr_source_0 = osmosdr.source(
args="numchan=" + str(1) + " " + 'rtl'
)
self.osmosdr_source_0.set_time_unknown_pps(osmosdr.time_spec_t())
self.osmosdr_source_0.set_sample_rate(sample_rate)
self.osmosdr_source_0.set_center_freq(frequency, 0)
self.osmosdr_source_0.set_freq_corr(freq_correction, 0)
self.osmosdr_source_0.set_gain(rf_gain, 0)
self.osmosdr_source_0.set_if_gain(if_gain, 0)
self.osmosdr_source_0.set_bb_gain(bb_gain, 0)
self.osmosdr_source_0.set_antenna('', 0)
self.osmosdr_source_0.set_bandwidth(bandwidth, 0)
self.blocks_tcp_server_sink_0 = blocks.tcp_server_sink(gr.sizeof_gr_complex * 1, '127.0.0.1', port, False)
self.connect((self.osmosdr_source_0, 0), (self.blocks_tcp_server_sink_0, 0))
示例9: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gain, bandwidth, port):
gr.top_block.__init__(self, "Top Block")
self.sample_rate = sample_rate
self.rf_gain = rf_gain
self.port = port
self.if_gain = if_gain
self.frequency = frequency
self.freq_correction = freq_correction
self.bb_gain = bb_gain
self.bandwidth = bandwidth
self.osmosdr_sink_0 = osmosdr.sink(
args="numchan=" + str(1) + " " + 'hackrf'
)
self.osmosdr_sink_0.set_time_unknown_pps(osmosdr.time_spec_t())
self.osmosdr_sink_0.set_sample_rate(sample_rate)
self.osmosdr_sink_0.set_center_freq(frequency, 0)
self.osmosdr_sink_0.set_freq_corr(freq_correction, 0)
self.osmosdr_sink_0.set_gain(rf_gain, 0)
self.osmosdr_sink_0.set_if_gain(if_gain, 0)
self.osmosdr_sink_0.set_bb_gain(bb_gain, 0)
self.osmosdr_sink_0.set_antenna('', 0)
self.osmosdr_sink_0.set_bandwidth(bandwidth, 0)
self.blocks_udp_source_0 = blocks.udp_source(gr.sizeof_gr_complex * 1, '127.0.0.1', port, 65536, False)
self.connect((self.blocks_udp_source_0, 0), (self.osmosdr_sink_0, 0))
示例10: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gain, bandwidth, port):
gr.top_block.__init__(self, "Top Block")
self.sample_rate = sample_rate
self.rf_gain = rf_gain
self.port = port
self.if_gain = if_gain
self.frequency = frequency
self.freq_correction = freq_correction
self.bb_gain = bb_gain
self.bandwidth = bandwidth
self.osmosdr_sink_0 = osmosdr.sink(
args="numchan=" + str(1) + " " + 'bladerf'
)
self.osmosdr_sink_0.set_time_unknown_pps(osmosdr.time_spec_t())
self.osmosdr_sink_0.set_sample_rate(sample_rate)
self.osmosdr_sink_0.set_center_freq(frequency, 0)
self.osmosdr_sink_0.set_freq_corr(freq_correction, 0)
self.osmosdr_sink_0.set_gain(rf_gain, 0)
self.osmosdr_sink_0.set_if_gain(if_gain, 0)
self.osmosdr_sink_0.set_bb_gain(bb_gain, 0)
self.osmosdr_sink_0.set_antenna('', 0)
self.osmosdr_sink_0.set_bandwidth(bandwidth, 0)
self.blocks_udp_source_0 = blocks.udp_source(gr.sizeof_gr_complex * 1, '127.0.0.1', port, 65536, False)
self.connect((self.blocks_udp_source_0, 0), (self.osmosdr_sink_0, 0))
示例11: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, samp_rate_in, samp_rate_out, center_freq,
tune_freq, channel_width, transition_width, threshold,
iq_filename, dig_out_filename):
gr.top_block.__init__(self)
##################################################
# Variables
##################################################
self.cutoff_freq = channel_width/2
self.firdes_taps = firdes.low_pass(1, samp_rate_in,
self.cutoff_freq,
transition_width)
##################################################
# Blocks
##################################################
self.tuning_filter_0 = filter.freq_xlating_fir_filter_ccc(int(samp_rate_in/samp_rate_out),
(self.firdes_taps),
tune_freq-center_freq,
samp_rate_in)
self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb()
self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, iq_filename, False)
self.blocks_complex_to_mag_0 = blocks.complex_to_mag(1)
self.blocks_add_const_vxx_0 = blocks.add_const_vff((-1*threshold, ))
# message sink is primary method of getting baseband data into waveconverter
self.sink_queue = gr.msg_queue()
self.blocks_message_sink_0 = blocks.message_sink(gr.sizeof_char*1, self.sink_queue, False)
# if directed, we also dump the baseband data into a file
if len(dig_out_filename) > 0:
print "Outputing baseband to waveform to " + dig_out_filename
self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_char*1, dig_out_filename, False)
self.blocks_file_sink_0.set_unbuffered(False)
##################################################
# Connections
##################################################
self.connect((self.blocks_add_const_vxx_0, 0), (self.digital_binary_slicer_fb_0, 0))
self.connect((self.blocks_complex_to_mag_0, 0), (self.blocks_add_const_vxx_0, 0))
self.connect((self.blocks_file_source_0, 0), (self.tuning_filter_0, 0))
self.connect((self.tuning_filter_0, 0), (self.blocks_complex_to_mag_0, 0))
self.connect((self.digital_binary_slicer_fb_0, 0), (self.blocks_message_sink_0, 0))
if len(dig_out_filename) > 0:
self.connect((self.digital_binary_slicer_fb_0, 0), (self.blocks_file_sink_0, 0))
##############################################################
# This flowgraph consists of the following blocks:
# - a File Source that
# - a Frequency Translating FIR filter that tunes to the target signal
# - a quadrature demod block that demodules the FSK signal
# - an Add Const block that shifts the demodulated signal downwards, centering
# it around zero on the y-axis
# - a Binary Slicer that converts centered signal from floating point to binary
# - a File Sink that outputs
示例12: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, fc=937e6, input_file_name="input.cfile", samp_rate=100.0e6/174.0, osr=4):
gr.top_block.__init__(self, "Get Bcch Msgs From Cfile")
##################################################
# Parameters
##################################################
self.fc = fc
self.input_file_name = input_file_name
self.samp_rate = samp_rate
self.osr = osr
##################################################
# Blocks
##################################################
self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([]), False)
self.gsm_message_printer_0 = grgsm.message_printer(pmt.intern(""), False,
False, False)
self.gsm_input_0 = grgsm.gsm_input(
ppm=0,
osr=osr,
fc=fc,
samp_rate_in=samp_rate,
)
self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder()
self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc, samp_rate, osr)
self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper(
timeslot_nr=0,
)
self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000, False)
self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False)
self.blocks_message_debug_0 = blocks.message_debug()
self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, "/home/piotr/Odbiornik_gsm/gr-gsm/test_data/vf_call6_a725_d174_g5_Kc1EF00BAB3BAC7002.cfile", False)
##################################################
# Connections
##################################################
self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts'))
self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.blocks_message_debug_0, 'print'))
self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.gsm_input_0, 'ctrl_in'))
self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus'))
self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.gsm_message_printer_0, 'msgs'))
self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_demapper_0, 'bursts'))
self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements'))
self.connect((self.blocks_file_source_0, 0), (self.gsm_input_0, 0))
self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0))
示例13: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, osr=4):
gr.top_block.__init__(self, "Uplink decoding demo")
##################################################
# Parameters
##################################################
self.osr = osr
##################################################
# Variables
##################################################
self.samp_rate = samp_rate = 1e6
##################################################
# Blocks
##################################################
self.socket_pdu_server = blocks.socket_pdu("UDP_SERVER", '127.0.0.1', '4729', 10000, False)
self.gsm_sdcch8_demapper_0 = grgsm.gsm_sdcch8_demapper(
timeslot_nr=1,
)
self.gsm_receiver_with_uplink_0 = grgsm.receiver(4, ([22]), ([2]), True)
self.gsm_message_printer_0_0 = grgsm.message_printer(pmt.intern(""), False,
False, False)
self.gsm_input_0_0 = grgsm.gsm_input(
ppm=0,
osr=4,
fc=947.8e6-45e6,
samp_rate_in=samp_rate,
)
self.gsm_input_0 = grgsm.gsm_input(
ppm=0,
osr=4,
fc=947.8e6,
samp_rate_in=samp_rate,
)
self.gsm_decryption_0_3 = grgsm.decryption(([0x46,0x77,0x2d,0x54,0xa3,0xa3,0xc3,0x1c]), 1)
self.gsm_control_channels_decoder_0_1_0 = grgsm.control_channels_decoder()
self.gsm_control_channels_decoder_0_1 = grgsm.control_channels_decoder()
self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(947.8e6, samp_rate, osr)
self.blocks_socket_pdu_0_0_0 = blocks.socket_pdu("UDP_CLIENT", '127.0.0.1', '4729', 10000, False)
self.blocks_file_source_0_0 = blocks.file_source(gr.sizeof_gr_complex*1, 'sms_multirtl_uplink_tail.cfile', False)
self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, 'sms_multirtl_downlink_tail.cfile', False)
##################################################
# Connections
##################################################
self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.gsm_input_0, 'ctrl_in'))
self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.gsm_input_0_0, 'ctrl_in'))
self.msg_connect((self.gsm_control_channels_decoder_0_1, 'msgs'), (self.blocks_socket_pdu_0_0_0, 'pdus'))
self.msg_connect((self.gsm_control_channels_decoder_0_1, 'msgs'), (self.gsm_message_printer_0_0, 'msgs'))
self.msg_connect((self.gsm_control_channels_decoder_0_1_0, 'msgs'), (self.blocks_socket_pdu_0_0_0, 'pdus'))
self.msg_connect((self.gsm_control_channels_decoder_0_1_0, 'msgs'), (self.gsm_message_printer_0_0, 'msgs'))
self.msg_connect((self.gsm_decryption_0_3, 'bursts'), (self.gsm_control_channels_decoder_0_1_0, 'bursts'))
self.msg_connect((self.gsm_receiver_with_uplink_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements'))
self.msg_connect((self.gsm_receiver_with_uplink_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts'))
self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0_1, 'bursts'))
self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0_3, 'bursts'))
self.connect((self.blocks_file_source_0, 0), (self.gsm_input_0, 0))
self.connect((self.blocks_file_source_0_0, 0), (self.gsm_input_0_0, 0))
self.connect((self.gsm_input_0, 0), (self.gsm_receiver_with_uplink_0, 0))
self.connect((self.gsm_input_0_0, 0), (self.gsm_receiver_with_uplink_0, 1))
示例14: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sizeof_gr_complex [as 别名]
def __init__(self, OSR=4, chan_num=0, fc=939.4e6, osr=4, ppm=0, samp_rate=0.2e6):
gr.hier_block2.__init__(
self, "Receiver With Decoder",
gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
gr.io_signature(0, 0, 0),
)
self.message_port_register_hier_out("bursts")
self.message_port_register_hier_out("msgs")
##################################################
# Parameters
##################################################
self.OSR = OSR
self.chan_num = chan_num
self.fc = fc
self.osr = osr
self.ppm = ppm
self.samp_rate = samp_rate
##################################################
# Variables
##################################################
self.samp_rate_out = samp_rate_out = 1625000.0/6.0*OSR
##################################################
# Blocks
##################################################
self.gsm_receiver_0 = grgsm.receiver(OSR, ([chan_num]), ([]), False)
self.gsm_input_0 = grgsm.gsm_input(
ppm=ppm,
osr=OSR,
fc=fc,
samp_rate_in=samp_rate,
)
self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder()
self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc, samp_rate, osr)
self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper(
timeslot_nr=0,
)
##################################################
# Connections
##################################################
self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts'))
self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.gsm_input_0, 'ctrl_in'))
self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self, 'bursts'))
self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self, 'msgs'))
self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_demapper_0, 'bursts'))
self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements'))
self.connect((self.gsm_input_0, 0), (self.gsm_receiver_0, 0))
self.connect((self, 0), (self.gsm_input_0, 0))