Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- parameters:
- author: Barry Duggan
- catch_exceptions: 'True'
- category: Custom
- cmake_opt: ''
- comment: ''
- copyright: ''
- description: ''
- gen_cmake: 'On'
- gen_linking: dynamic
- generate_options: qt_gui
- hier_block_src_path: '.:'
- id: ofdm_loopback_test
- max_nouts: '0'
- output_language: python
- placement: (0,0)
- qt_qss_theme: ''
- realtime_scheduling: ''
- run: 'True'
- run_command: '{python} -u {filename}'
- run_options: prompt
- sizing_mode: fixed
- thread_safe_setters: ''
- title: ofdm_loopback_test
- window_size: 1280, 1024
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [16, 20.0]
- rotation: 0
- state: enabled
- blocks:
- - name: fft_len
- id: variable
- parameters:
- comment: ''
- value: '64'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [504, 20.0]
- rotation: 0
- state: enabled
- - name: len_tag_key
- id: variable
- parameters:
- comment: ''
- value: '"packet_len"'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [392, 20.0]
- rotation: 0
- state: enabled
- - name: packet_len
- id: variable
- parameters:
- comment: ''
- value: '52'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [296, 20.0]
- rotation: 0
- state: enabled
- - name: samp_rate
- id: variable
- parameters:
- comment: ''
- value: 256e3
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [200, 20.0]
- rotation: 0
- state: enabled
- - name: usrp_rate
- id: variable
- parameters:
- comment: ''
- value: '768000'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [200, 84.0]
- rotation: 0
- state: true
- - name: blocks_file_sink_0
- id: blocks_file_sink
- parameters:
- affinity: ''
- alias: ''
- append: 'False'
- comment: ''
- file: output.txt
- type: byte
- unbuffered: 'True'
- vlen: '1'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [912, 540.0]
- rotation: 0
- state: true
- - name: blocks_packed_to_unpacked_xx_0
- id: blocks_packed_to_unpacked_xx
- parameters:
- affinity: ''
- alias: ''
- bits_per_chunk: '1'
- comment: ''
- endianness: gr.GR_MSB_FIRST
- maxoutbuf: '0'
- minoutbuf: '0'
- num_ports: '1'
- type: byte
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [912, 628.0]
- rotation: 0
- state: true
- - name: blocks_tag_gate_0
- id: blocks_tag_gate
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- propagate_tags: 'False'
- single_key: '"packet_len"'
- type: byte
- vlen: '1'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [704, 628.0]
- rotation: 0
- state: enabled
- - name: blocks_throttle_0
- id: blocks_throttle
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- ignoretag: 'True'
- maxoutbuf: '0'
- minoutbuf: '0'
- samples_per_second: usrp_rate
- type: complex
- vlen: '1'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [1088, 244.0]
- rotation: 0
- state: enabled
- - name: blocks_uchar_to_float_1_0
- id: blocks_uchar_to_float
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [1112, 640.0]
- rotation: 0
- state: enabled
- - name: digital_ofdm_rx_0
- id: digital_ofdm_rx
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- cp_len: fft_len//4
- fft_len: fft_len
- header_mod: '"BPSK"'
- log: 'False'
- maxoutbuf: '0'
- minoutbuf: '0'
- occupied_carriers: ((-4,-3,-2,-1,1,2,3,4),)
- packet_len_key: '"rx_len"'
- payload_mod: '"QPSK"'
- pilot_carriers: ((-6,-5,5,6),)
- pilot_symbols: ((-1,1,-1,1),)
- scramble_bits: 'False'
- sync_word1: None
- sync_word2: None
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [464, 572.0]
- rotation: 0
- state: enabled
- - name: digital_ofdm_tx_0
- id: digital_ofdm_tx
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- cp_len: fft_len//4
- fft_len: fft_len
- header_mod: '"BPSK"'
- log: 'False'
- maxoutbuf: '0'
- minoutbuf: '0'
- occupied_carriers: ((-4,-3,-2,-1,1,2,3,4),)
- packet_len_key: len_tag_key
- payload_mod: '"QPSK"'
- pilot_carriers: ((-6,-5,5,6),)
- pilot_symbols: ((-1,1,-1,1),)
- rolloff: '0'
- scramble_bits: 'False'
- sync_word1: None
- sync_word2: None
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [664, 172.0]
- rotation: 0
- state: enabled
- - name: epy_block_0
- id: epy_block
- parameters:
- FileName: '"/home/barry/Documents/Gettysburg.txt"'
- Pkt_len: '52'
- _source_code: "\"\"\"\nEmbedded Python Block: File Source to Tagged Stream\n\"\
- \"\"\n\nimport numpy as np\nfrom gnuradio import gr\nimport pmt\nimport os.path\n\
- import sys\n\nclass blk(gr.sync_block):\n def __init__(self, FileName='None',\
- \ Pkt_len=256):\n gr.sync_block.__init__(\n self,\n \
- \ name='EPB: File Source to Tagged Stream',\n in_sig=None,\n\
- \ out_sig=[np.uint8])\n self.FileName = FileName\n \
- \ self.Pkt_len = Pkt_len\n self.state = 0\n self.pre_count = 0\n\
- \ self.indx = 0\n if (os.path.exists(self.FileName)):\n \
- \ # open input file\n self.f_in = open (self.FileName, 'rb')\n\
- \ self._eof = False\n else:\n print(FileName, 'does\
- \ not exist')\n self._eof = True\n self.char_list = [85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,\
- \ 85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85, 85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85]\n\
- \ self.c_len = len (self.char_list)\n # print (self.c_len)\n\n\
- \ def work(self, input_items, output_items):\n if (self.state == 0):\n\
- \ # send phasing filler\n key1 = pmt.intern(\"packet_len\"\
- )\n val1 = pmt.from_long(self.c_len)\n self.add_item_tag(0,\
- \ # Write to output port 0\n self.indx, # Index of the tag\n\
- \ key1, # Key of the tag\n val1 # Value of\
- \ the tag\n )\n self.indx += self.c_len\n \
- \ i = 0\n while (i < self.c_len):\n output_items[0][i]\
- \ = self.char_list[i]\n i += 1\n self.pre_count +=\
- \ 1\n if (self.pre_count > 19):\n self.state = 1\n\
- \ return (self.c_len)\n elif (self.state == 1):\n \
- \ while (not (self._eof)):\n buff = self.f_in.read (self.Pkt_len)\n\
- \ b_len = len(buff)\n if b_len == 0:\n \
- \ print ('End of file')\n self._eof = True\n\
- \ self.f_in.close()\n self.state = 2\n\
- \ self.pre_count = 0\n break\n \
- \ key0 = pmt.intern(\"packet_len\")\n val0 = pmt.from_long(b_len)\n\
- \ self.add_item_tag(0, # Write to output port 0\n \
- \ self.indx, # Index of the tag\n key0, # Key\
- \ of the tag\n val0 # Value of the tag\n \
- \ )\n self.indx += b_len\n i = 0\n \
- \ while (i < b_len):\n output_items[0][i] = buff[i]\n\
- \ i += 1\n return (b_len)\n elif (self.state\
- \ == 2):\n # send idle filler\n key1 = pmt.intern(\"packet_len\"\
- )\n val1 = pmt.from_long(self.c_len)\n self.add_item_tag(0,\
- \ # Write to output port 0\n self.indx, # Index of the tag\n\
- \ key1, # Key of the tag\n val1 # Value of\
- \ the tag\n )\n self.indx += self.c_len\n \
- \ i = 0\n while (i < self.c_len):\n output_items[0][i]\
- \ = self.char_list[i]\n i += 1\n self.pre_count +=\
- \ 1\n if (self.pre_count > 19):\n self.state = 3\n\
- \ return (self.c_len)\n return (0)\n\n"
- affinity: ''
- alias: ''
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- states:
- _io_cache: '(''EPB: File Source to Tagged Stream'', ''blk'', [(''FileName'', "''None''"),
- (''Pkt_len'', ''256'')], [], [(''0'', ''byte'', 1)], '''', [''FileName'', ''Pkt_len''])'
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [376, 236.0]
- rotation: 0
- state: true
- - name: note_0
- id: note
- parameters:
- alias: ''
- comment: 'Pluto: use usrp_rate'
- note: Pluto xmt here
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [1152, 180.0]
- rotation: 0
- state: true
- - name: note_1
- id: note
- parameters:
- alias: ''
- comment: 'Pluto: use usrp_rate'
- note: Pluto rcvr here
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [80, 564.0]
- rotation: 0
- state: true
- - name: qtgui_time_sink_x_0
- id: qtgui_time_sink_x
- parameters:
- affinity: ''
- alias: ''
- alpha1: '1.0'
- alpha10: '1.0'
- alpha2: '1.0'
- alpha3: '1.0'
- alpha4: '1.0'
- alpha5: '1.0'
- alpha6: '1.0'
- alpha7: '1.0'
- alpha8: '1.0'
- alpha9: '1.0'
- autoscale: 'False'
- axislabels: 'True'
- color1: blue
- color10: dark blue
- color2: red
- color3: green
- color4: black
- color5: cyan
- color6: magenta
- color7: yellow
- color8: dark red
- color9: dark green
- comment: ''
- ctrlpanel: 'True'
- entags: 'True'
- grid: 'False'
- gui_hint: ''
- label1: ''
- label10: ''
- label2: ''
- label3: ''
- label4: ''
- label5: ''
- label6: ''
- label7: ''
- label8: ''
- label9: ''
- legend: 'True'
- marker1: '-1'
- marker10: '-1'
- marker2: '-1'
- marker3: '-1'
- marker4: '-1'
- marker5: '-1'
- marker6: '-1'
- marker7: '-1'
- marker8: '-1'
- marker9: '-1'
- name: Scope Plot
- nconnections: '1'
- size: '128'
- srate: samp_rate
- stemplot: 'False'
- style1: '1'
- style10: '1'
- style2: '1'
- style3: '1'
- style4: '1'
- style5: '1'
- style6: '1'
- style7: '1'
- style8: '1'
- style9: '1'
- tr_chan: '0'
- tr_delay: '0.0001'
- tr_level: '0'
- tr_mode: qtgui.TRIG_MODE_TAG
- tr_slope: qtgui.TRIG_SLOPE_POS
- tr_tag: '"rx_len"'
- type: float
- update_time: '0.10'
- width1: '1'
- width10: '1'
- width2: '1'
- width3: '1'
- width4: '1'
- width5: '1'
- width6: '1'
- width7: '1'
- width8: '1'
- width9: '1'
- ylabel: Amplitude
- ymax: '1.1'
- ymin: '-0.1'
- yunit: '""'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [1280, 612.0]
- rotation: 0
- state: enabled
- - name: rational_resampler_xxx_0
- id: rational_resampler_xxx
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- decim: '1'
- fbw: '0'
- interp: int(usrp_rate/samp_rate)
- maxoutbuf: '0'
- minoutbuf: '0'
- taps: '[]'
- type: ccc
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [896, 220.0]
- rotation: 0
- state: true
- - name: rational_resampler_xxx_1
- id: rational_resampler_xxx
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- decim: int(usrp_rate/samp_rate)
- fbw: '0'
- interp: '1'
- maxoutbuf: '0'
- minoutbuf: '0'
- taps: '[]'
- type: ccc
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [272, 612.0]
- rotation: 0
- state: true
- - name: virtual_sink_1
- id: virtual_sink
- parameters:
- alias: ''
- comment: ''
- stream_id: xmt_Pluto
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [1264, 244.0]
- rotation: 0
- state: true
- - name: virtual_source_1
- id: virtual_source
- parameters:
- alias: ''
- comment: ''
- stream_id: xmt_Pluto
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [80, 636.0]
- rotation: 0
- state: true
- connections:
- - [blocks_packed_to_unpacked_xx_0, '0', blocks_uchar_to_float_1_0, '0']
- - [blocks_tag_gate_0, '0', blocks_file_sink_0, '0']
- - [blocks_tag_gate_0, '0', blocks_packed_to_unpacked_xx_0, '0']
- - [blocks_throttle_0, '0', virtual_sink_1, '0']
- - [blocks_uchar_to_float_1_0, '0', qtgui_time_sink_x_0, '0']
- - [digital_ofdm_rx_0, '0', blocks_tag_gate_0, '0']
- - [digital_ofdm_tx_0, '0', rational_resampler_xxx_0, '0']
- - [epy_block_0, '0', digital_ofdm_tx_0, '0']
- - [rational_resampler_xxx_0, '0', blocks_throttle_0, '0']
- - [rational_resampler_xxx_1, '0', digital_ofdm_rx_0, '0']
- - [virtual_source_1, '0', rational_resampler_xxx_1, '0']
- metadata:
- file_format: 1
- grc_version: 3.10.5.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement