aboutsummaryrefslogtreecommitdiffstats
path: root/receive_tcp.ipynb
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-03-11 18:18:34 +0000
committerandreas128 <Andreas>2017-03-11 18:18:34 +0000
commit3ee39e3ae187e76b252b5758c12bd35e5707e187 (patch)
treefaa71fde21f869a34eb69806661faf11c00f1adc /receive_tcp.ipynb
parent1200ad3e9bb166d2f2599f47e0503b37eb70c20f (diff)
downloadODR-StaticPrecorrection-3ee39e3ae187e76b252b5758c12bd35e5707e187.tar.gz
ODR-StaticPrecorrection-3ee39e3ae187e76b252b5758c12bd35e5707e187.tar.bz2
ODR-StaticPrecorrection-3ee39e3ae187e76b252b5758c12bd35e5707e187.zip
Add sholder analysis
Diffstat (limited to 'receive_tcp.ipynb')
-rw-r--r--receive_tcp.ipynb80
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()"