aboutsummaryrefslogtreecommitdiffstats
path: root/notebooks/FrameSynchronization.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'notebooks/FrameSynchronization.ipynb')
-rw-r--r--notebooks/FrameSynchronization.ipynb64
1 files changed, 36 insertions, 28 deletions
diff --git a/notebooks/FrameSynchronization.ipynb b/notebooks/FrameSynchronization.ipynb
index b9e3871..9902c18 100644
--- a/notebooks/FrameSynchronization.ipynb
+++ b/notebooks/FrameSynchronization.ipynb
@@ -188,49 +188,49 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 1,
"id": "b56d782d-fcea-4fb9-b0c1-9c3933d5ce6c",
"metadata": {},
"outputs": [],
"source": [
"def modulate_16qam(m):\n",
" sym = {\n",
- " # first column\n",
- " 0: -3 -3j,\n",
- " 1: -3 -1j,\n",
- " 2: -3 +3j,\n",
- " 3: -3 +1j,\n",
- " # second column\n",
- " 4: -1 -3j,\n",
- " 5: -1 -1j,\n",
- " 6: -1 +3j,\n",
- " 7: -1 +1j,\n",
- " # fourth column\n",
- " 8: 3 -3j,\n",
- " 9: 3 -1j,\n",
- " 10: 3 +3j,\n",
- " 11: 3 +1j,\n",
- " # third column\n",
- " 12: 3 -3j,\n",
- " 13: 3 -1j,\n",
- " 14: 3 +3j,\n",
- " 15: 3 +1j,\n",
+ " 0: 1 -1j,\n",
+ " 1: -1 -1j,\n",
+ " 2: 3 -3j,\n",
+ " 3: -3 -3j,\n",
+ " 4: -3 -1j,\n",
+ " 5: 3 -1j,\n",
+ " 6: -1 -3j,\n",
+ " 7: 1 -3j,\n",
+ " 8: -3 +3j,\n",
+ " 9: 3 +3j,\n",
+ " 10: -1 +1j,\n",
+ " 11: 1 +1j,\n",
+ " 12: 1 +3j,\n",
+ " 13: -1 +3j,\n",
+ " 14: 3 +1j,\n",
+ " 15: -3 +1j,\n",
+ " \n",
" }\n",
- " return map(lambda k: sym[k] if k in sym.keys() else None, m)"
+ " return map(lambda k: sym[k]*np.sqrt(0.1), m)\n"
]
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 2,
"id": "2fb687aa-0061-4626-bf6b-3ec7d628d739",
"metadata": {},
"outputs": [
{
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "[1, 10, 3, 4]\n",
- "[(-3-1j), (3+3j), (-3+1j), (-1-3j)]\n"
+ "ename": "NameError",
+ "evalue": "name 'np' is not defined",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/tmp/ipykernel_2456/3352720696.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# convert into chunks of 4 bits for QPSK\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mchunks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmatmul\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mac_pad\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreshape\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m4\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m4\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0msyms\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodulate_16qam\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchunks\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchunks\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mNameError\u001b[0m: name 'np' is not defined"
]
}
],
@@ -242,6 +242,14 @@
"print(chunks)\n",
"print(syms)"
]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "5951be43",
+ "metadata": {},
+ "outputs": [],
+ "source": []
}
],
"metadata": {