Sun Sep 4 20:59:56 2016 options author Aaron Scher window_size 1000,1150 category [GRC Hier Blocks] comment description Audio modem FSK loop back test _enabled True _coordinate (8, 20) _rotation 0 generate_options qt_gui hier_block_src_path .: id top_block max_nouts 0 qt_qss_theme realtime_scheduling run_command {python} -u {filename} run_options prompt run True thread_safe_setters title Audio modem FSK loop back test variable comment _enabled True _coordinate (592, 20) _rotation 0 id EBW value .05 variable_rrc_filter_taps comment Root raised cosine definition. _enabled 1 alpha EBW _coordinate (464, 20) _rotation 0 gain nfilts id RRC_filter_taps ntaps 5*SPS*nfilts/RX_decimation samp_rate nfilts sym_rate 1.0 variable comment receiver decimation factor _enabled True _coordinate (88, 124) _rotation 0 id RX_decimation value 49 variable comment Samples per signal _enabled True _coordinate (8, 124) _rotation 0 id SPS value 147 variable comment Audio carrier frequency _enabled True _coordinate (336, 20) _rotation 0 id carrier_freq value 1.75E3 variable comment Frequency deviation of GFSK modulation _enabled True _coordinate (320, 132) _rotation 0 id fsk_deviation_hz value 100 variable comment _enabled True _coordinate (672, 20) _rotation 0 id nfilts value 32 variable comment Sample rate - determines BW of transmitter and receiver. This should be larger than BW of signal itself. _enabled True _coordinate (184, 20) _rotation 0 id samp_rate value 44.1E3 analog_const_source_x alias comment const 0 affinity _enabled True _coordinate (32, 756) _rotation 0 id analog_const_source_x_0 maxoutbuf 0 minoutbuf 0 type float analog_feedforward_agc_cc alias comment Optional AGC affinity _enabled 1 _coordinate (704, 796) _rotation 180 id analog_feedforward_agc_cc_0 maxoutbuf 0 minoutbuf 0 num_samples 1024 reference 1.0 analog_pwr_squelch_xx alpha .01 alias comment Optional power squelch affinity _enabled 1 _coordinate (744, 664) _rotation 0 gate True id analog_pwr_squelch_xx_0 maxoutbuf 0 minoutbuf 0 ramp 0 threshold -60 type complex analog_quadrature_demod_cf alias comment FSK demod affinity _enabled 1 _coordinate (512, 804) _rotation 180 gain samp_rate/(2*math.pi*fsk_deviation_hz/8.0)/(RX_decimation) id analog_quadrature_demod_cf_0 maxoutbuf 0 minoutbuf 0 analog_sig_source_x amp 1 alias comment local oscillator affinity _enabled 1 freq -carrier_freq _coordinate (240, 748) _rotation 0 id analog_sig_source_x_1 maxoutbuf 0 minoutbuf 0 offset 0 type complex samp_rate samp_rate waveform analog.GR_COS_WAVE audio_sink alias comment Send data to speakers affinity device_name _enabled 1 _coordinate (856, 444) _rotation 0 id audio_sink_0 num_inputs 1 ok_to_block True samp_rate 44100 audio_source alias comment Microphone affinity device_name _enabled 1 _coordinate (32, 668) _rotation 0 id audio_source_0 maxoutbuf 0 minoutbuf 0 num_outputs 1 ok_to_block True samp_rate 44100 blocks_float_to_complex alias comment affinity _enabled True _coordinate (248, 672) _rotation 0 id blocks_float_to_complex_0 maxoutbuf 0 minoutbuf 0 vlen 1 blocks_message_debug alias comment Display the message that was sent. affinity _enabled 1 _coordinate (760, 976) _rotation 0 id blocks_message_debug_0_0 blocks_multiply_xx alias comment Perform frequency translation (down convert) affinity _enabled 1 _coordinate (440, 672) _rotation 0 id blocks_multiply_xx_1 type complex maxoutbuf 0 minoutbuf 0 num_inputs 2 vlen 1 blocks_pdu_to_tagged_stream alias comment affinity _enabled 1 _coordinate (108, 392) _rotation 270 id blocks_pdu_to_tagged_stream_1 type byte tag len_key maxoutbuf 0 minoutbuf 0 blocks_repack_bits_bb k 8 l 1 alias comment affinity _enabled True endianness gr.GR_MSB_FIRST _coordinate (432, 420) _rotation 0 id blocks_repack_bits_bb_0 len_tag_key len_key maxoutbuf 0 minoutbuf 0 align_output False blocks_repack_bits_bb k 1 l 8 alias comment Tagged Stream to PDU block up ahead needs packed bytes affinity _enabled 1 endianness gr.GR_MSB_FIRST _coordinate (344, 1036) _rotation 0 id blocks_repack_bits_bb_0_0_0_0 len_tag_key len_key2 maxoutbuf 0 minoutbuf 0 align_output False blocks_repeat alias comment Establish number of samples per symbol affinity _enabled 1 _coordinate (560, 564) _rotation 0 id blocks_repeat_0 interp SPS-1 maxoutbuf 0 minoutbuf 0 type float vlen 1 blocks_stream_to_tagged_stream alias comment Determine length of preamble. affinity _enabled 1 _coordinate (392, 292) _rotation 0 id blocks_stream_to_tagged_stream_0 len_tag_key len_key maxoutbuf 0 minoutbuf 0 packet_len 200 type byte vlen 1 blocks_tagged_stream_mux alias comment Append header to payload affinity _enabled 1 _coordinate (232, 520) _rotation 0 id blocks_tagged_stream_mux_0 type byte lengthtagname len_key maxoutbuf 0 minoutbuf 0 ninputs 2 tag_preserve_head_pos 0 vlen 1 blocks_tagged_stream_mux alias comment Append preamble to main message. affinity _enabled True _coordinate (616, 288) _rotation 0 id blocks_tagged_stream_mux_1 type byte lengthtagname len_key maxoutbuf 0 minoutbuf 0 ninputs 2 tag_preserve_head_pos 0 vlen 1 blocks_tagged_stream_to_pdu alias comment affinity _enabled 1 _coordinate (520, 972) _rotation 0 id blocks_tagged_stream_to_pdu_0_0 type byte tag len_key2 maxoutbuf 0 minoutbuf 0 blocks_vco_f amplitude 1 alias comment FSK modulation affinity _enabled True _coordinate (720, 544) _rotation 0 id blocks_vco_f_0 maxoutbuf 0 minoutbuf 0 samp_rate samp_rate sensitivity 1 blocks_vector_source_x alias comment Create 1,0,1,0,... repeate preamble affinity _enabled 1 _coordinate (256, 272) _rotation 0 id blocks_vector_source_x_0 maxoutbuf 0 minoutbuf 0 type byte repeat True tags [] vlen 1 vector (1,0) digital_binary_slicer_fb alias comment Decision affinity _enabled 1 _coordinate (88, 976) _rotation 180 id digital_binary_slicer_fb_0_0 maxoutbuf 0 minoutbuf 0 digital_chunks_to_symbols_xx alias comment Binary 1's and 0's to symbols. affinity dimension 1 _enabled 1 _coordinate (624, 428) _rotation 0 id digital_chunks_to_symbols_xx_0_0 in_type byte maxoutbuf 0 minoutbuf 0 num_ports 1 out_type float symbol_table (2*3.14*carrier_freq-2*3.14*fsk_deviation_hz,2*3.14*carrier_freq+2*3.14*fsk_deviation_hz) digital_correlate_access_code_xx_ts access_code digital.packet_utils.default_access_code alias comment Correlates with access code to extract the payload. affinity _enabled 1 _coordinate (64, 1032) _rotation 0 id digital_correlate_access_code_xx_ts_1_0_0 type byte maxoutbuf 0 minoutbuf 0 tagname len_key2 threshold 2 digital_pfb_clock_sync_xxx alias comment Clock sync affinity _enabled 1 filter_size nfilts _coordinate (232, 880) _rotation 180 id digital_pfb_clock_sync_xxx_0 init_phase nfilts/2 loop_bw 6.28/400.0*2/70 maxoutbuf 0 max_dev 2 minoutbuf 0 osps 1 sps SPS/RX_decimation taps RRC_filter_taps type fff digital_protocol_formatter_bb alias comment Generate header affinity _enabled 1 format hdr_format _coordinate (200, 380) _rotation 0 id digital_protocol_formatter_bb_0 len_tag_key len_key maxoutbuf 0 minoutbuf 0 epy_block alias _io_cache ('Embedded Python Block', 'msg_block', [], [('msg_in', 'message')], [('msg_out', 'message')], 'Convert strings to uint8 vectors', []) _source_code """ Embedded Python Blocks: Each time this file is saved, GRC will instantiate the first class it finds to get ports and parameters of your block. The arguments to __init__ will be the parameters. All of them are required to have default values! """ import numpy as np import pylab from gnuradio import gr import pmt class msg_block(gr.basic_block): # other base classes are basic_block, decim_block, interp_block """Convert strings to uint8 vectors""" def __init__(self): # only default arguments here """arguments to this function show up as parameters in GRC""" gr.basic_block.__init__( self, name='Embedded Python Block', # will show up in GRC in_sig=None, out_sig=None ) self.message_port_register_out(pmt.intern('msg_out')) self.message_port_register_in(pmt.intern('msg_in')) self.set_msg_handler(pmt.intern('msg_in'), self.handle_msg) def handle_msg(self, msg): nvec = pmt.to_python(msg) self.message_port_pub(pmt.intern('msg_out'), pmt.cons(pmt.make_dict(), pmt.pmt_to_python.numpy_to_uvector(np.array([ord(c) for c in nvec], np.uint8)))) def work(self, input_items, output_items): pass comment Convert strings from previous block to uint8 vectors _enabled 1 _coordinate (64, 264) _rotation 0 id epy_block_0 parameter alias comment Header format definition _enabled 1 _coordinate (560, 152) _rotation 0 id hdr_format label Header Formatter short_id type value digital.header_format_default(digital.packet_utils.default_access_code, 0) import alias comment Custom Embedded Python Block uses this library. _enabled True _coordinate (456, 156) _rotation 0 id import_0 import import numpy qtgui_edit_box_msg alias comment affinity _enabled 1 _coordinate (12, 392) gui_hint _rotation 90 id qtgui_edit_box_msg_0 key label maxoutbuf 0 minoutbuf 0 is_pair False is_static False type string value qtgui_freq_sink_x autoscale False average 1.0 axislabels True bw samp_rate/RX_decimation alias fc 0 comment ctrlpanel False affinity _enabled 1 fftsize 1024 _coordinate (896, 752) gui_hint _rotation 270 grid False id qtgui_freq_sink_x_0 legend True alpha1 1.0 color1 "blue" label1 width1 1 alpha10 1.0 color10 "dark blue" label10 width10 1 alpha2 1.0 color2 "red" label2 width2 1 alpha3 1.0 color3 "green" label3 width3 1 alpha4 1.0 color4 "black" label4 width4 1 alpha5 1.0 color5 "cyan" label5 width5 1 alpha6 1.0 color6 "magenta" label6 width6 1 alpha7 1.0 color7 "yellow" label7 width7 1 alpha8 1.0 color8 "dark red" label8 width8 1 alpha9 1.0 color9 "dark green" label9 width9 1 maxoutbuf 0 minoutbuf 0 name "" nconnections 1 showports True freqhalf True tr_chan 0 tr_level 0.0 tr_mode qtgui.TRIG_MODE_FREE tr_tag "" type complex update_time 0.10 wintype firdes.WIN_BLACKMAN_hARRIS label Relative Gain ymax 10 ymin -140 units dB qtgui_time_sink_x autoscale False axislabels True alias comment ctrlpanel False affinity entags True _enabled True _coordinate (536, 888) gui_hint _rotation 0 grid False id qtgui_time_sink_x_0 legend True alpha1 1.0 color1 "blue" label1 marker1 -1 style1 1 width1 1 alpha10 1.0 color10 "blue" label10 marker10 -1 style10 1 width10 1 alpha2 1.0 color2 "red" label2 marker2 -1 style2 1 width2 1 alpha3 1.0 color3 "green" label3 marker3 -1 style3 1 width3 1 alpha4 1.0 color4 "black" label4 marker4 -1 style4 1 width4 1 alpha5 1.0 color5 "cyan" label5 marker5 -1 style5 1 width5 1 alpha6 1.0 color6 "magenta" label6 marker6 -1 style6 1 width6 1 alpha7 1.0 color7 "yellow" label7 marker7 -1 style7 1 width7 1 alpha8 1.0 color8 "dark red" label8 marker8 -1 style8 1 width8 1 alpha9 1.0 color9 "dark green" label9 marker9 -1 style9 1 width9 1 name "" nconnections 1 size 1024 srate samp_rate/RX_decimation tr_chan 0 tr_delay 0 tr_level 0.0 tr_mode qtgui.TRIG_MODE_FREE tr_slope qtgui.TRIG_SLOPE_POS tr_tag "" type float update_time 0.10 ylabel Amplitude yunit "" ymax 1 ymin -1 rational_resampler_xxx alias comment Downsample and low-pass filter affinity decim RX_decimation _enabled 1 fbw 0 _coordinate (584, 664) _rotation 0 id rational_resampler_xxx_1 interp 1 maxoutbuf 0 minoutbuf 0 taps type ccc analog_const_source_x_0 blocks_float_to_complex_0 0 1 analog_feedforward_agc_cc_0 analog_quadrature_demod_cf_0 0 0 analog_pwr_squelch_xx_0 analog_feedforward_agc_cc_0 0 0 analog_pwr_squelch_xx_0 qtgui_freq_sink_x_0 0 0 analog_quadrature_demod_cf_0 digital_pfb_clock_sync_xxx_0 0 0 analog_quadrature_demod_cf_0 qtgui_time_sink_x_0 0 0 analog_sig_source_x_1 blocks_multiply_xx_1 0 1 audio_source_0 blocks_float_to_complex_0 0 0 blocks_float_to_complex_0 blocks_multiply_xx_1 0 0 blocks_multiply_xx_1 rational_resampler_xxx_1 0 0 blocks_pdu_to_tagged_stream_1 blocks_tagged_stream_mux_0 0 1 blocks_pdu_to_tagged_stream_1 digital_protocol_formatter_bb_0 0 0 blocks_repack_bits_bb_0 blocks_tagged_stream_mux_1 0 1 blocks_repack_bits_bb_0_0_0_0 blocks_tagged_stream_to_pdu_0_0 0 0 blocks_repeat_0 blocks_vco_f_0 0 0 blocks_stream_to_tagged_stream_0 blocks_tagged_stream_mux_1 0 0 blocks_tagged_stream_mux_0 blocks_repack_bits_bb_0 0 0 blocks_tagged_stream_mux_1 digital_chunks_to_symbols_xx_0_0 0 0 blocks_tagged_stream_to_pdu_0_0 blocks_message_debug_0_0 pdus print blocks_vco_f_0 audio_sink_0 0 0 blocks_vector_source_x_0 blocks_stream_to_tagged_stream_0 0 0 digital_binary_slicer_fb_0_0 digital_correlate_access_code_xx_ts_1_0_0 0 0 digital_chunks_to_symbols_xx_0_0 blocks_repeat_0 0 0 digital_correlate_access_code_xx_ts_1_0_0 blocks_repack_bits_bb_0_0_0_0 0 0 digital_pfb_clock_sync_xxx_0 digital_binary_slicer_fb_0_0 0 0 digital_protocol_formatter_bb_0 blocks_tagged_stream_mux_0 0 0 epy_block_0 blocks_pdu_to_tagged_stream_1 msg_out pdus qtgui_edit_box_msg_0 epy_block_0 msg msg_in rational_resampler_xxx_1 analog_pwr_squelch_xx_0 0 0