Advertisement
duggabe

ofdm_loopback_test.grc

Mar 29th, 2023
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.72 KB | None | 0 0
  1. options:
  2. parameters:
  3. author: Barry Duggan
  4. catch_exceptions: 'True'
  5. category: Custom
  6. cmake_opt: ''
  7. comment: ''
  8. copyright: ''
  9. description: ''
  10. gen_cmake: 'On'
  11. gen_linking: dynamic
  12. generate_options: qt_gui
  13. hier_block_src_path: '.:'
  14. id: ofdm_loopback_test
  15. max_nouts: '0'
  16. output_language: python
  17. placement: (0,0)
  18. qt_qss_theme: ''
  19. realtime_scheduling: ''
  20. run: 'True'
  21. run_command: '{python} -u {filename}'
  22. run_options: prompt
  23. sizing_mode: fixed
  24. thread_safe_setters: ''
  25. title: ofdm_loopback_test
  26. window_size: 1280, 1024
  27. states:
  28. bus_sink: false
  29. bus_source: false
  30. bus_structure: null
  31. coordinate: [16, 20.0]
  32. rotation: 0
  33. state: enabled
  34.  
  35. blocks:
  36. - name: fft_len
  37. id: variable
  38. parameters:
  39. comment: ''
  40. value: '64'
  41. states:
  42. bus_sink: false
  43. bus_source: false
  44. bus_structure: null
  45. coordinate: [504, 20.0]
  46. rotation: 0
  47. state: enabled
  48. - name: len_tag_key
  49. id: variable
  50. parameters:
  51. comment: ''
  52. value: '"packet_len"'
  53. states:
  54. bus_sink: false
  55. bus_source: false
  56. bus_structure: null
  57. coordinate: [392, 20.0]
  58. rotation: 0
  59. state: enabled
  60. - name: packet_len
  61. id: variable
  62. parameters:
  63. comment: ''
  64. value: '52'
  65. states:
  66. bus_sink: false
  67. bus_source: false
  68. bus_structure: null
  69. coordinate: [296, 20.0]
  70. rotation: 0
  71. state: enabled
  72. - name: samp_rate
  73. id: variable
  74. parameters:
  75. comment: ''
  76. value: 256e3
  77. states:
  78. bus_sink: false
  79. bus_source: false
  80. bus_structure: null
  81. coordinate: [200, 20.0]
  82. rotation: 0
  83. state: enabled
  84. - name: usrp_rate
  85. id: variable
  86. parameters:
  87. comment: ''
  88. value: '768000'
  89. states:
  90. bus_sink: false
  91. bus_source: false
  92. bus_structure: null
  93. coordinate: [200, 84.0]
  94. rotation: 0
  95. state: true
  96. - name: blocks_file_sink_0
  97. id: blocks_file_sink
  98. parameters:
  99. affinity: ''
  100. alias: ''
  101. append: 'False'
  102. comment: ''
  103. file: output.txt
  104. type: byte
  105. unbuffered: 'True'
  106. vlen: '1'
  107. states:
  108. bus_sink: false
  109. bus_source: false
  110. bus_structure: null
  111. coordinate: [912, 540.0]
  112. rotation: 0
  113. state: true
  114. - name: blocks_packed_to_unpacked_xx_0
  115. id: blocks_packed_to_unpacked_xx
  116. parameters:
  117. affinity: ''
  118. alias: ''
  119. bits_per_chunk: '1'
  120. comment: ''
  121. endianness: gr.GR_MSB_FIRST
  122. maxoutbuf: '0'
  123. minoutbuf: '0'
  124. num_ports: '1'
  125. type: byte
  126. states:
  127. bus_sink: false
  128. bus_source: false
  129. bus_structure: null
  130. coordinate: [912, 628.0]
  131. rotation: 0
  132. state: true
  133. - name: blocks_tag_gate_0
  134. id: blocks_tag_gate
  135. parameters:
  136. affinity: ''
  137. alias: ''
  138. comment: ''
  139. maxoutbuf: '0'
  140. minoutbuf: '0'
  141. propagate_tags: 'False'
  142. single_key: '"packet_len"'
  143. type: byte
  144. vlen: '1'
  145. states:
  146. bus_sink: false
  147. bus_source: false
  148. bus_structure: null
  149. coordinate: [704, 628.0]
  150. rotation: 0
  151. state: enabled
  152. - name: blocks_throttle_0
  153. id: blocks_throttle
  154. parameters:
  155. affinity: ''
  156. alias: ''
  157. comment: ''
  158. ignoretag: 'True'
  159. maxoutbuf: '0'
  160. minoutbuf: '0'
  161. samples_per_second: usrp_rate
  162. type: complex
  163. vlen: '1'
  164. states:
  165. bus_sink: false
  166. bus_source: false
  167. bus_structure: null
  168. coordinate: [1088, 244.0]
  169. rotation: 0
  170. state: enabled
  171. - name: blocks_uchar_to_float_1_0
  172. id: blocks_uchar_to_float
  173. parameters:
  174. affinity: ''
  175. alias: ''
  176. comment: ''
  177. maxoutbuf: '0'
  178. minoutbuf: '0'
  179. states:
  180. bus_sink: false
  181. bus_source: false
  182. bus_structure: null
  183. coordinate: [1112, 640.0]
  184. rotation: 0
  185. state: enabled
  186. - name: digital_ofdm_rx_0
  187. id: digital_ofdm_rx
  188. parameters:
  189. affinity: ''
  190. alias: ''
  191. comment: ''
  192. cp_len: fft_len//4
  193. fft_len: fft_len
  194. header_mod: '"BPSK"'
  195. log: 'False'
  196. maxoutbuf: '0'
  197. minoutbuf: '0'
  198. occupied_carriers: ((-4,-3,-2,-1,1,2,3,4),)
  199. packet_len_key: '"rx_len"'
  200. payload_mod: '"QPSK"'
  201. pilot_carriers: ((-6,-5,5,6),)
  202. pilot_symbols: ((-1,1,-1,1),)
  203. scramble_bits: 'False'
  204. sync_word1: None
  205. sync_word2: None
  206. states:
  207. bus_sink: false
  208. bus_source: false
  209. bus_structure: null
  210. coordinate: [464, 572.0]
  211. rotation: 0
  212. state: enabled
  213. - name: digital_ofdm_tx_0
  214. id: digital_ofdm_tx
  215. parameters:
  216. affinity: ''
  217. alias: ''
  218. comment: ''
  219. cp_len: fft_len//4
  220. fft_len: fft_len
  221. header_mod: '"BPSK"'
  222. log: 'False'
  223. maxoutbuf: '0'
  224. minoutbuf: '0'
  225. occupied_carriers: ((-4,-3,-2,-1,1,2,3,4),)
  226. packet_len_key: len_tag_key
  227. payload_mod: '"QPSK"'
  228. pilot_carriers: ((-6,-5,5,6),)
  229. pilot_symbols: ((-1,1,-1,1),)
  230. rolloff: '0'
  231. scramble_bits: 'False'
  232. sync_word1: None
  233. sync_word2: None
  234. states:
  235. bus_sink: false
  236. bus_source: false
  237. bus_structure: null
  238. coordinate: [664, 172.0]
  239. rotation: 0
  240. state: enabled
  241. - name: epy_block_0
  242. id: epy_block
  243. parameters:
  244. FileName: '"/home/barry/Documents/Gettysburg.txt"'
  245. Pkt_len: '52'
  246. _source_code: "\"\"\"\nEmbedded Python Block: File Source to Tagged Stream\n\"\
  247. \"\"\n\nimport numpy as np\nfrom gnuradio import gr\nimport pmt\nimport os.path\n\
  248. import sys\n\nclass blk(gr.sync_block):\n def __init__(self, FileName='None',\
  249. \ Pkt_len=256):\n gr.sync_block.__init__(\n self,\n \
  250. \ name='EPB: File Source to Tagged Stream',\n in_sig=None,\n\
  251. \ out_sig=[np.uint8])\n self.FileName = FileName\n \
  252. \ self.Pkt_len = Pkt_len\n self.state = 0\n self.pre_count = 0\n\
  253. \ self.indx = 0\n if (os.path.exists(self.FileName)):\n \
  254. \ # open input file\n self.f_in = open (self.FileName, 'rb')\n\
  255. \ self._eof = False\n else:\n print(FileName, 'does\
  256. \ 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,\
  257. \ 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\
  258. \ self.c_len = len (self.char_list)\n # print (self.c_len)\n\n\
  259. \ def work(self, input_items, output_items):\n if (self.state == 0):\n\
  260. \ # send phasing filler\n key1 = pmt.intern(\"packet_len\"\
  261. )\n val1 = pmt.from_long(self.c_len)\n self.add_item_tag(0,\
  262. \ # Write to output port 0\n self.indx, # Index of the tag\n\
  263. \ key1, # Key of the tag\n val1 # Value of\
  264. \ the tag\n )\n self.indx += self.c_len\n \
  265. \ i = 0\n while (i < self.c_len):\n output_items[0][i]\
  266. \ = self.char_list[i]\n i += 1\n self.pre_count +=\
  267. \ 1\n if (self.pre_count > 19):\n self.state = 1\n\
  268. \ return (self.c_len)\n elif (self.state == 1):\n \
  269. \ while (not (self._eof)):\n buff = self.f_in.read (self.Pkt_len)\n\
  270. \ b_len = len(buff)\n if b_len == 0:\n \
  271. \ print ('End of file')\n self._eof = True\n\
  272. \ self.f_in.close()\n self.state = 2\n\
  273. \ self.pre_count = 0\n break\n \
  274. \ key0 = pmt.intern(\"packet_len\")\n val0 = pmt.from_long(b_len)\n\
  275. \ self.add_item_tag(0, # Write to output port 0\n \
  276. \ self.indx, # Index of the tag\n key0, # Key\
  277. \ of the tag\n val0 # Value of the tag\n \
  278. \ )\n self.indx += b_len\n i = 0\n \
  279. \ while (i < b_len):\n output_items[0][i] = buff[i]\n\
  280. \ i += 1\n return (b_len)\n elif (self.state\
  281. \ == 2):\n # send idle filler\n key1 = pmt.intern(\"packet_len\"\
  282. )\n val1 = pmt.from_long(self.c_len)\n self.add_item_tag(0,\
  283. \ # Write to output port 0\n self.indx, # Index of the tag\n\
  284. \ key1, # Key of the tag\n val1 # Value of\
  285. \ the tag\n )\n self.indx += self.c_len\n \
  286. \ i = 0\n while (i < self.c_len):\n output_items[0][i]\
  287. \ = self.char_list[i]\n i += 1\n self.pre_count +=\
  288. \ 1\n if (self.pre_count > 19):\n self.state = 3\n\
  289. \ return (self.c_len)\n return (0)\n\n"
  290. affinity: ''
  291. alias: ''
  292. comment: ''
  293. maxoutbuf: '0'
  294. minoutbuf: '0'
  295. states:
  296. _io_cache: '(''EPB: File Source to Tagged Stream'', ''blk'', [(''FileName'', "''None''"),
  297. (''Pkt_len'', ''256'')], [], [(''0'', ''byte'', 1)], '''', [''FileName'', ''Pkt_len''])'
  298. bus_sink: false
  299. bus_source: false
  300. bus_structure: null
  301. coordinate: [376, 236.0]
  302. rotation: 0
  303. state: true
  304. - name: note_0
  305. id: note
  306. parameters:
  307. alias: ''
  308. comment: 'Pluto: use usrp_rate'
  309. note: Pluto xmt here
  310. states:
  311. bus_sink: false
  312. bus_source: false
  313. bus_structure: null
  314. coordinate: [1152, 180.0]
  315. rotation: 0
  316. state: true
  317. - name: note_1
  318. id: note
  319. parameters:
  320. alias: ''
  321. comment: 'Pluto: use usrp_rate'
  322. note: Pluto rcvr here
  323. states:
  324. bus_sink: false
  325. bus_source: false
  326. bus_structure: null
  327. coordinate: [80, 564.0]
  328. rotation: 0
  329. state: true
  330. - name: qtgui_time_sink_x_0
  331. id: qtgui_time_sink_x
  332. parameters:
  333. affinity: ''
  334. alias: ''
  335. alpha1: '1.0'
  336. alpha10: '1.0'
  337. alpha2: '1.0'
  338. alpha3: '1.0'
  339. alpha4: '1.0'
  340. alpha5: '1.0'
  341. alpha6: '1.0'
  342. alpha7: '1.0'
  343. alpha8: '1.0'
  344. alpha9: '1.0'
  345. autoscale: 'False'
  346. axislabels: 'True'
  347. color1: blue
  348. color10: dark blue
  349. color2: red
  350. color3: green
  351. color4: black
  352. color5: cyan
  353. color6: magenta
  354. color7: yellow
  355. color8: dark red
  356. color9: dark green
  357. comment: ''
  358. ctrlpanel: 'True'
  359. entags: 'True'
  360. grid: 'False'
  361. gui_hint: ''
  362. label1: ''
  363. label10: ''
  364. label2: ''
  365. label3: ''
  366. label4: ''
  367. label5: ''
  368. label6: ''
  369. label7: ''
  370. label8: ''
  371. label9: ''
  372. legend: 'True'
  373. marker1: '-1'
  374. marker10: '-1'
  375. marker2: '-1'
  376. marker3: '-1'
  377. marker4: '-1'
  378. marker5: '-1'
  379. marker6: '-1'
  380. marker7: '-1'
  381. marker8: '-1'
  382. marker9: '-1'
  383. name: Scope Plot
  384. nconnections: '1'
  385. size: '128'
  386. srate: samp_rate
  387. stemplot: 'False'
  388. style1: '1'
  389. style10: '1'
  390. style2: '1'
  391. style3: '1'
  392. style4: '1'
  393. style5: '1'
  394. style6: '1'
  395. style7: '1'
  396. style8: '1'
  397. style9: '1'
  398. tr_chan: '0'
  399. tr_delay: '0.0001'
  400. tr_level: '0'
  401. tr_mode: qtgui.TRIG_MODE_TAG
  402. tr_slope: qtgui.TRIG_SLOPE_POS
  403. tr_tag: '"rx_len"'
  404. type: float
  405. update_time: '0.10'
  406. width1: '1'
  407. width10: '1'
  408. width2: '1'
  409. width3: '1'
  410. width4: '1'
  411. width5: '1'
  412. width6: '1'
  413. width7: '1'
  414. width8: '1'
  415. width9: '1'
  416. ylabel: Amplitude
  417. ymax: '1.1'
  418. ymin: '-0.1'
  419. yunit: '""'
  420. states:
  421. bus_sink: false
  422. bus_source: false
  423. bus_structure: null
  424. coordinate: [1280, 612.0]
  425. rotation: 0
  426. state: enabled
  427. - name: rational_resampler_xxx_0
  428. id: rational_resampler_xxx
  429. parameters:
  430. affinity: ''
  431. alias: ''
  432. comment: ''
  433. decim: '1'
  434. fbw: '0'
  435. interp: int(usrp_rate/samp_rate)
  436. maxoutbuf: '0'
  437. minoutbuf: '0'
  438. taps: '[]'
  439. type: ccc
  440. states:
  441. bus_sink: false
  442. bus_source: false
  443. bus_structure: null
  444. coordinate: [896, 220.0]
  445. rotation: 0
  446. state: true
  447. - name: rational_resampler_xxx_1
  448. id: rational_resampler_xxx
  449. parameters:
  450. affinity: ''
  451. alias: ''
  452. comment: ''
  453. decim: int(usrp_rate/samp_rate)
  454. fbw: '0'
  455. interp: '1'
  456. maxoutbuf: '0'
  457. minoutbuf: '0'
  458. taps: '[]'
  459. type: ccc
  460. states:
  461. bus_sink: false
  462. bus_source: false
  463. bus_structure: null
  464. coordinate: [272, 612.0]
  465. rotation: 0
  466. state: true
  467. - name: virtual_sink_1
  468. id: virtual_sink
  469. parameters:
  470. alias: ''
  471. comment: ''
  472. stream_id: xmt_Pluto
  473. states:
  474. bus_sink: false
  475. bus_source: false
  476. bus_structure: null
  477. coordinate: [1264, 244.0]
  478. rotation: 0
  479. state: true
  480. - name: virtual_source_1
  481. id: virtual_source
  482. parameters:
  483. alias: ''
  484. comment: ''
  485. stream_id: xmt_Pluto
  486. states:
  487. bus_sink: false
  488. bus_source: false
  489. bus_structure: null
  490. coordinate: [80, 636.0]
  491. rotation: 0
  492. state: true
  493.  
  494. connections:
  495. - [blocks_packed_to_unpacked_xx_0, '0', blocks_uchar_to_float_1_0, '0']
  496. - [blocks_tag_gate_0, '0', blocks_file_sink_0, '0']
  497. - [blocks_tag_gate_0, '0', blocks_packed_to_unpacked_xx_0, '0']
  498. - [blocks_throttle_0, '0', virtual_sink_1, '0']
  499. - [blocks_uchar_to_float_1_0, '0', qtgui_time_sink_x_0, '0']
  500. - [digital_ofdm_rx_0, '0', blocks_tag_gate_0, '0']
  501. - [digital_ofdm_tx_0, '0', rational_resampler_xxx_0, '0']
  502. - [epy_block_0, '0', digital_ofdm_tx_0, '0']
  503. - [rational_resampler_xxx_0, '0', blocks_throttle_0, '0']
  504. - [rational_resampler_xxx_1, '0', digital_ofdm_rx_0, '0']
  505. - [virtual_source_1, '0', rational_resampler_xxx_1, '0']
  506.  
  507. metadata:
  508. file_format: 1
  509. grc_version: 3.10.5.1
  510.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement