diff options
Diffstat (limited to 'lab-windows/dsss_experiments.ipynb')
-rw-r--r-- | lab-windows/dsss_experiments.ipynb | 177 |
1 files changed, 68 insertions, 109 deletions
diff --git a/lab-windows/dsss_experiments.ipynb b/lab-windows/dsss_experiments.ipynb index f2bbc0b..ee35464 100644 --- a/lab-windows/dsss_experiments.ipynb +++ b/lab-windows/dsss_experiments.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -21,7 +21,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 105, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -39,7 +39,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -75,13 +75,13 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "01394154cc52483e9d4483f1178d94c3", + "model_id": "5081f9508a894fcf810e2d9c92c24a3e", "version_major": 2, "version_minor": 0 }, @@ -102,10 +102,10 @@ { "data": { "text/plain": [ - "<matplotlib.image.AxesImage at 0x7fcfd7369250>" + "<matplotlib.image.AxesImage at 0x7ff8d9616610>" ] }, - "execution_count": 5, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -117,7 +117,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -133,7 +133,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -157,7 +157,7 @@ " -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1])" ] }, - "execution_count": 7, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -178,7 +178,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -209,7 +209,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "182fd5ac86e74ad299a67e5f1d0b2b2b", + "model_id": "ec8de5680ba541938b7d1843b841c327", "version_major": 2, "version_minor": 0 }, @@ -230,10 +230,10 @@ { "data": { "text/plain": [ - "<matplotlib.image.AxesImage at 0x7fcfd6c90070>" + "<matplotlib.image.AxesImage at 0x7ff8d955afa0>" ] }, - "execution_count": 9, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -260,13 +260,13 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "4cb2661eebb84478b06d285166ec13bc", + "model_id": "bb32b5050ee14ddc8eb64697a8eb774b", "version_major": 2, "version_minor": 0 }, @@ -288,10 +288,10 @@ { "data": { "text/plain": [ - "<matplotlib.image.AxesImage at 0x7fcfd6c6cfa0>" + "<matplotlib.image.AxesImage at 0x7ff8d8eb9e20>" ] }, - "execution_count": 10, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -317,7 +317,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -330,7 +330,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "a2e2f747193b478bbfa792a0995ad4ed", + "model_id": "48b3ae259e8046a5b90a82c4e80bab2e", "version_major": 2, "version_minor": 0 }, @@ -352,10 +352,10 @@ { "data": { "text/plain": [ - "(2.0, 1.0234353995297893)" + "(2.0, 1.0121324810255907)" ] }, - "execution_count": 11, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -399,7 +399,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -419,7 +419,7 @@ }, { "cell_type": "code", - "execution_count": 145, + "execution_count": 27, "metadata": {}, "outputs": [ { @@ -431,17 +431,9 @@ ] }, { - "name": "stderr", - "output_type": "stream", - "text": [ - "<ipython-input-145-babcf8a4e867>:33: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).\n", - " fig, ((ax1, ax3), (ax2, ax4)) = plt.subplots(2, 2, figsize=(16, 9))\n" - ] - }, - { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "10aa67d294304f2ba26c8e6d5555d5e6", + "model_id": "73f4caf6a80f448183c41b711412a471", "version_major": 2, "version_minor": 0 }, @@ -455,10 +447,10 @@ { "data": { "text/plain": [ - "(0.002, 0.014074279)" + "(0.0020000000000000005, 0.014544699)" ] }, - "execution_count": 145, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } @@ -470,7 +462,7 @@ "\n", "#test_data = np.random.randint(0, 2, 100)\n", "#test_data = np.array([0, 1, 0, 0, 1, 1, 1, 0])\n", - "test_data = np.random.RandomState(seed=0).randint(0, 2 * (2**nbits), 64)\n", + "test_data = np.random.RandomState(seed=0xcbb3b8cf).randint(0, 2 * (2**nbits), 128)\n", "#test_data = np.random.RandomState(seed=0).randint(0, 8, 64)\n", "#test_data = np.array(list(range(8)) * 8)\n", "#test_data = np.array([0, 1] * 32)\n", @@ -542,13 +534,13 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "c08b2a1dbdef429eb22b598bd3dc0146", + "model_id": "9fa8fa6a6837412da95630c634a12e21", "version_major": 2, "version_minor": 0 }, @@ -569,10 +561,10 @@ { "data": { "text/plain": [ - "[<matplotlib.lines.Line2D at 0x7fcfd1635700>]" + "[<matplotlib.lines.Line2D at 0x7ff8ad6f3b50>]" ] }, - "execution_count": 14, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -592,13 +584,13 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "20117316e02548a99386c39e45e71ef1", + "model_id": "854dec05e45340ae91cf271b2facd7ed", "version_major": 2, "version_minor": 0 }, @@ -623,7 +615,7 @@ "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m<ipython-input-15-f158dfc14cca>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0msosh\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbutter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0.1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'highpass'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutput\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'sos'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdecimation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0msosl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbutter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0.8\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'lowpass'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutput\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'sos'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdecimation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 10\u001b[0;31m \u001b[0mcor2_pe_flt\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msosfilt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msosh\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcor2_pe\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 11\u001b[0m \u001b[0mcor2_pe_flt2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msosfilt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msosh\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msosfiltfilt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msosl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcor2_pe\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 12\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m<ipython-input-24-f158dfc14cca>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0msosh\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbutter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0.1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'highpass'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutput\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'sos'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdecimation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0msosl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbutter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0.8\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'lowpass'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutput\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'sos'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdecimation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 10\u001b[0;31m \u001b[0mcor2_pe_flt\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msosfilt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msosh\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcor2_pe\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 11\u001b[0m \u001b[0mcor2_pe_flt2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msosfilt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msosh\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msosfiltfilt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msosl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcor2_pe\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 12\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mNameError\u001b[0m: name 'cor2_pe' is not defined" ] } @@ -650,21 +642,13 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 25, "metadata": {}, "outputs": [ { - "name": "stderr", - "output_type": "stream", - "text": [ - "<ipython-input-57-3e7dc7c98d30>:1: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).\n", - " fig, ax = plt.subplots()\n" - ] - }, - { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "25fe274dea83415491fd7f86d38188d7", + "model_id": "b3f68635d3ad4863b990c0b6e742840b", "version_major": 2, "version_minor": 0 }, @@ -678,10 +662,10 @@ { "data": { "text/plain": [ - "[<matplotlib.lines.Line2D at 0x7fcf84cb4a60>]" + "[<matplotlib.lines.Line2D at 0x7ff8a9b7a820>]" ] }, - "execution_count": 57, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -695,21 +679,13 @@ }, { "cell_type": "code", - "execution_count": 146, + "execution_count": 28, "metadata": {}, "outputs": [ { - "name": "stderr", - "output_type": "stream", - "text": [ - "<ipython-input-146-badd40342f73>:11: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).\n", - " fig, (ax1, ax3) = plt.subplots(2, figsize=(12, 5))\n" - ] - }, - { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "509bf67d93b74741b48bca58529c4b9d", + "model_id": "e6e78aec5f92465fbda1d231f7123196", "version_major": 2, "version_minor": 0 }, @@ -724,22 +700,30 @@ "name": "stdout", "output_type": "stream", "text": [ - "cor_an (65, 40949)\n", - "cwt_res (65, 40949)\n", - "th (65, 40949)\n", + "cor_an (65, 81269)\n", + "cwt_res (65, 81269)\n", + "th (65, 81269)\n", "[((65,), (65,)), ((65,), (65,)), ((65,), (65,)), ((65,), (65,)), ((65,), (65,))]\n", - "peaks: 982\n", - "avg_peak 1.6673786030736735\n", - "skipped 2 symbols at 30238.5\n", + "peaks: 1852\n", + "avg_peak 1.6610203317347632\n", + "skipped 3 symbols at 42209.0\n", "decoding [ref|dec]:\n", - " 44| 44 ✔ 47| 47 ✔ 117|117 ✔ 64| 64 ✔ 67| 67 ✔ 123|123 ✔ 67| 67 ✔ 103|103 ✔ \n", - " 9| 9 ✔ 83| 83 ✔ 21| 21 ✔ 114|114 ✔ 36| 36 ✔ 87| 87 ✔ 70| 70 ✔ 88| 88 ✔ \n", - " 88| 88 ✔ 12| 12 ✔ 58| 58 ✔ 65| 65 ✔ 102|102 ✔ 39| 39 ✔ 87| 87 ✔ 46| 46 ✔ \n", - " 88| 88 ✔ 81| 81 ✔ 37| 37 ✔ 25| 25 ✔ 77| 77 ✔ 72| 72 ✔ 9| 9 ✔ 20| 20 ✔ \n", - "115|115 ✔ 80| 80 ✔ 115|115 ✔ 69| 69 ✔ 126|126 ✔ 79| 79 ✔ 47| 47 ✔ 64| 64 ✔ \n", - " 82| 82 ✔ 99| 99 ✔ 88| 88 ✔ 49| 49 ✔ 115|115 ✔ 29| 29 ✔ 19| -1 19| 19 ✔ \n", - " 14| 14 ✔ 39| 39 ✔ 32| 32 ✔ 65| 64 ✘ 9| 9 ✔ 57| 57 ✔ 127|127 ✔ 32| 32 ✔ \n", - " 31| 31 ✔ 74| 74 ✔ 116|116 ✔ 23| 23 ✔ 35| 35 ✔ 126|126 ✔ 75| 75 ✔ 114| 26 ✘ \n", + " 10| 10 ✔ 69| 69 ✔ 124|124 ✔ 102|102 ✔ 2| 2 ✔ 3| 3 ✔ 78| 78 ✔ 29| 29 ✔ \n", + "122|123 ✘ 73| 73 ✔ 98| 98 ✔ 34| 34 ✔ -1| -1 ✔ 97| 97 ✔ 7| 7 ✔ 97| 97 ✔ \n", + " 86| 86 ✔ 120|120 ✔ 95| 95 ✔ 90| 90 ✔ 49| 49 ✔ 89| 89 ✔ 83| 83 ✔ 19| 19 ✔ \n", + " 84| 84 ✔ 117|117 ✔ 92| 92 ✔ 119|119 ✔ 16| 16 ✔ 45| 45 ✔ 23| 23 ✔ 16| 16 ✔ \n", + "111|111 ✔ 9| 9 ✔ 89| 89 ✔ 18| 18 ✔ 36| 36 ✔ 2| 2 ✔ 115|115 ✔ 40| 40 ✔ \n", + "100|100 ✔ 105|105 ✔ 93| 93 ✔ 85| 85 ✔ 107|107 ✔ 90| 90 ✔ 62| 62 ✔ 116|116 ✔ \n", + " 42| 42 ✔ 123|123 ✔ 40| 40 ✔ -1| -1 ✔ 77| 77 ✔ 40| 40 ✔ 57| 57 ✔ 110|110 ✔ \n", + " 29| 29 ✔ 94| 94 ✔ 1| 1 ✔ 29| 29 ✔ 71| 71 ✔ 119|119 ✔ 15| 15 ✔ 115|115 ✔ \n", + "120| -1 70| -1 50| 50 ✔ 71| 71 ✔ 50| 50 ✔ 61| 61 ✔ 38| 38 ✔ 4| 4 ✔ \n", + " 3| 3 ✔ 124|124 ✔ 95| 95 ✔ 27| 27 ✔ 48| 48 ✔ 116|116 ✔ 3| 3 ✔ 63| 63 ✔ \n", + " 19| 19 ✔ 79| 79 ✔ 2| 2 ✔ 43| 43 ✔ 92| 92 ✔ 8| 8 ✔ 65| 65 ✔ 35| 35 ✔ \n", + " 30| 30 ✔ 73| 73 ✔ 73| 73 ✔ 38| 38 ✔ 58| 58 ✔ 49| 49 ✔ 45| 45 ✔ 58| 58 ✔ \n", + " 46| 46 ✔ 116|116 ✔ 101|101 ✔ 5| 5 ✔ 78| 78 ✔ 126|126 ✔ 105| 76 ✘ 108|108 ✔ \n", + " 59| 59 ✔ 46| 46 ✔ 27| 27 ✔ 14| 14 ✔ 57| 57 ✔ 81| 81 ✔ 3| 3 ✔ 9| 9 ✔ \n", + "126|126 ✔ 18| 55 ✘ 76| 76 ✔ 101|101 ✔ 124|124 ✔ 4| 4 ✔ 3| 3 ✔ 102|102 ✔ \n", + " 79| 79 ✔ 121|121 ✔ 103|103 ✔ 92| 92 ✔ 30| 30 ✔ 4| 4 ✔ 103|103 ✔ 59| 58 ✘ \n", "Symbol error rate e=0.046875\n", "maximum bitrate r=321.6796875 b/h\n" ] @@ -896,34 +880,9 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "987be038c1b34e6e9509f7f224bbb620", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/plain": [ - "[<matplotlib.lines.Line2D at 0x7f8fcb61c850>]" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "fig, axs = plt.subplots(2, 1, figsize=(9, 7))\n", "fig.tight_layout()\n", |