aboutsummaryrefslogtreecommitdiffstats
path: root/sync-measurement-while-sending.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'sync-measurement-while-sending.ipynb')
-rw-r--r--sync-measurement-while-sending.ipynb117
1 files changed, 25 insertions, 92 deletions
diff --git a/sync-measurement-while-sending.ipynb b/sync-measurement-while-sending.ipynb
index 5e9ef00..e1f7ba9 100644
--- a/sync-measurement-while-sending.ipynb
+++ b/sync-measurement-while-sending.ipynb
@@ -120,7 +120,7 @@
},
"outputs": [],
"source": [
- "receiver = rdt.ReceiveDictTcp('127.0.0.1', 1111)"
+ "receiver = rdt.ReceiveDictTcp('127.0.0.1', 1112)"
]
},
{
@@ -162,30 +162,6 @@
"editable": true
},
"outputs": [],
- "source": [
- "top.uhd_usrp_source_0.set_gain(20)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "deletable": true,
- "editable": true
- },
- "outputs": [],
- "source": [
- "top.uhd_usrp_sink_0_0.set_gain(40)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "deletable": true,
- "editable": true
- },
- "outputs": [],
"source": []
},
{
@@ -198,33 +174,31 @@
"outputs": [],
"source": [
"while True:\n",
- " time.sleep(1)\n",
- " if not receiver.queue.empty():\n",
- " d = receiver.queue.get()\n",
- " \n",
+ " d = receiver.queue.get()\n",
+ " \n",
+ " print(d)\n",
+ " k = d.keys()[0]\n",
+ " if k == \"a1\":\n",
" print(d)\n",
- " k = d.keys()[0]\n",
- " if k == \"a1\":\n",
- " print(d)\n",
- " top.dpd_memless_poly_0.set_a1(d[k])\n",
- " if k == \"a2\":\n",
- " top.dpd_memless_poly_0.set_a2(d[k])\n",
- " if k == \"a3\":\n",
- " top.dpd_memless_poly_0.set_a3(d[k])\n",
- " if k == \"a4\":\n",
- " top.dpd_memless_poly_0.set_a4(d[k])\n",
- " if k == \"a5\":\n",
- " top.dpd_memless_poly_0.set_a5(d[k])\n",
- " if k == \"a6\":\n",
- " top.dpd_memless_poly_0.set_a6(d[k])\n",
- " if k == \"a7\":\n",
- " top.dpd_memless_poly_0.set_a7(d[k])\n",
- " if k == \"a8\":\n",
- " top.dpd_memless_poly_0.set_a8(d[k])\n",
- " if k == \"txgain\":\n",
- " top.uhd_usrp_sink_0_0.set_gain(d[k])\n",
- " if k == \"rxgain\":\n",
- " top.uhd_usrp_source_0.set_gain(d[k])"
+ " top.dpd_memless_poly_0.set_a1(d[k])\n",
+ " if k == \"a2\":\n",
+ " top.dpd_memless_poly_0.set_a2(d[k])\n",
+ " if k == \"a3\":\n",
+ " top.dpd_memless_poly_0.set_a3(d[k])\n",
+ " if k == \"a4\":\n",
+ " top.dpd_memless_poly_0.set_a4(d[k])\n",
+ " if k == \"a5\":\n",
+ " top.dpd_memless_poly_0.set_a5(d[k])\n",
+ " if k == \"a6\":\n",
+ " top.dpd_memless_poly_0.set_a6(d[k])\n",
+ " if k == \"a7\":\n",
+ " top.dpd_memless_poly_0.set_a7(d[k])\n",
+ " if k == \"a8\":\n",
+ " top.dpd_memless_poly_0.set_a8(d[k])\n",
+ " if k == \"txgain\":\n",
+ " top.uhd_usrp_sink_0_0.set_gain(d[k])\n",
+ " if k == \"rxgain\":\n",
+ " top.uhd_usrp_source_0.set_gain(d[k])"
]
},
{
@@ -256,47 +230,6 @@
},
"outputs": [],
"source": [
- "# reload(du)\n",
- "res = []\n",
- "\n",
- "\n",
- "t = time.time()\n",
- "for txgain, rxgain in zip(txgains, rxgains):\n",
- " print (txgain, rxgain)\n",
- " res_tmp = None\n",
- " for i in range(30):\n",
- " \n",
- " #top.file_sink_out.close()\n",
- " #top.blocks_file_source_0.close()\n",
- " \n",
- " #top.file_sink_out.open(path_out)\n",
- " #top.file_sink_out.open(\"/tmp/\" + str(i))\n",
- " #top.blocks_file_source_0.open(path_in, False)\n",
- " \n",
- " time.sleep(1)\n",
- " \n",
- " \n",
- " #a_in = np.fromfile(path_in, dtype=np.complex64)\n",
- " #a_out = np.fromfile(path_out, dtype=np.complex64)\n",
- " \n",
- " #extract_measurement(a_in, a_out, rxgain, 0.95, 64, debug = True)\n",
- " #\n",
- " #plt.plot(a_in[:1000])\n",
- " #plt.show()\n",
- " \n",
- " res.append(res_tmp)\n",
- "time.time() - t"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "deletable": true,
- "editable": true
- },
- "outputs": [],
- "source": [
"#top.stop()\n",
"#top.wait()"
]