diff options
Diffstat (limited to 'receive_tcp.ipynb')
-rw-r--r-- | receive_tcp.ipynb | 80 |
1 files changed, 74 insertions, 6 deletions
diff --git a/receive_tcp.ipynb b/receive_tcp.ipynb index f6df54a..8c2cb79 100644 --- a/receive_tcp.ipynb +++ b/receive_tcp.ipynb @@ -19,8 +19,10 @@ "import src.dab_util as du\n", "import src.signal_gen as sg\n", "import src.tcp_sync as ts\n", + "import src.dab_tuning_lib as dt\n", "reload(sg)\n", - "reload(du)" + "reload(du)\n", + "reload(dt)" ] }, { @@ -56,7 +58,7 @@ }, "outputs": [], "source": [ - "sender = sdt.SendDictTcp('127.0.0.1', 1111)" + "sender = sdt.SendDictTcp('127.0.0.1', 1112)" ] }, { @@ -67,6 +69,16 @@ "editable": true }, "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "deletable": true, + "editable": true + }, + "outputs": [], "source": [ "sender.send({\"txgain\":60})" ] @@ -86,7 +98,55 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "deletable": true, + "editable": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "deletable": true, + "editable": true + }, + "outputs": [], + "source": [ + "def measure_sholders():\n", + " for i in range(10):\n", + " t1.has_msg()\n", + " msgs = t1.get_msgs(20)\n", + " sholders = [dt.calc_signal_sholder_ratio(np.array(msg), 8000000) for msg in msgs]\n", + " std = np.std(sholders)\n", + " mean = np.mean(sholders)\n", + " if std/mean < 0.05:\n", + " continue\n", + " else:\n", + " return np.mean(sholders)\n", + " raise Exception(\"Variance of measurement to high\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "deletable": true, + "editable": true + }, + "outputs": [], + "source": [ + "measure_sholders()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "deletable": true, + "editable": true + }, "outputs": [], "source": [] }, @@ -99,9 +159,7 @@ }, "outputs": [], "source": [ - "a = t1.has_msg()\n", - "a = np.fft.fftshift(np.sum(np.array(t1.get_msgs(10)), axis=0))\n", - "plt.plot(a)" + "t1.has_msg()" ] }, { @@ -132,6 +190,16 @@ "editable": true }, "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "deletable": true, + "editable": true + }, + "outputs": [], "source": [ "#top.stop()\n", "#top.wait()" |