More BER curves, initial FEC experiements

This commit is contained in:
jaseg 2020-02-21 11:55:48 +00:00
parent 36951a5f19
commit 9b39be3180
5 changed files with 316 additions and 64 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
@ -29,7 +29,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
@ -38,7 +38,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
@ -47,7 +47,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
@ -73,7 +73,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
@ -90,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
@ -104,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 7,
"metadata": {},
"outputs": [
{
@ -124,7 +124,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
@ -139,7 +139,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
@ -153,13 +153,13 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8a090f2d31104ec695a0c68bf39555d9",
"model_id": "c5fba7c7cec24f09a4f23f7c7d87eb90",
"version_major": 2,
"version_minor": 0
},
@ -177,7 +177,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
@ -186,7 +186,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
@ -366,13 +366,13 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b961e7d9571748fd8a58a5579f95743d",
"model_id": "5106e62521e246a0b0766cce3f9e556f",
"version_major": 2,
"version_minor": 0
},
@ -386,10 +386,10 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7275b7807450>]"
"[<matplotlib.lines.Line2D at 0x7fc200d359d0>]"
]
},
"execution_count": 26,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
@ -397,6 +397,7 @@
"source": [
"fig, ax = plt.subplots(figsize=(12, 9))\n",
"\n",
"duration = 64\n",
"decimation = 100\n",
"extra_dec = 10\n",
"nbits = 5\n",
@ -443,7 +444,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
@ -453,13 +454,13 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "cebd805ecee34a05b229922af1abfe58",
"model_id": "15e67925b1bf47b5bbde289b353ed201",
"version_major": 2,
"version_minor": 0
},
@ -473,12 +474,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "981c5c08524e4b56b72df4ca01e724da",
"model_id": "6432dbccc7db43d7a227384bca772716",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(IntProgress(value=1, bar_style='info', max=1), HTML(value='')))"
"HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))"
]
},
"metadata": {},
@ -490,22 +491,22 @@
"text": [
"nbits=5\n",
"nbits=6\n",
"signal_amplitude=0.00010: ser=0.97396 ±0.00737, br=14.64844\n",
"signal_amplitude=0.00046: ser=0.97396 ±0.00737, br=14.64844\n",
"signal_amplitude=0.00015: ser=0.98958 ±0.00737, br=5.85938\n",
"signal_amplitude=0.00022: ser=0.96875 ±0.01276, br=17.57812\n",
"signal_amplitude=0.00010: ser=0.97396 ±0.00737, br=14.64844\n",
"signal_amplitude=0.00032: ser=0.97396 ±0.00737, br=14.64844\n",
"signal_amplitude=0.00046: ser=0.97396 ±0.00737, br=14.64844\n",
"signal_amplitude=0.00068: ser=0.94792 ±0.01949, br=29.29688\n",
"signal_amplitude=0.00100: ser=0.78125 ±0.02552, br=123.04688\n",
"signal_amplitude=0.00147: ser=0.28646 ±0.03683, br=401.36719\n",
"signal_amplitude=0.00215: ser=0.06250 ±0.03375, br=527.34375\n",
"signal_amplitude=0.00316: ser=0.00521 ±0.00737, br=559.57031\n",
"signal_amplitude=0.00010: ser=0.98958 ±0.00737, br=3.51562\n",
"signal_amplitude=0.00015: ser=0.97917 ±0.01473, br=7.03125\n",
"signal_amplitude=0.00010: ser=0.98958 ±0.00737, br=3.51562\n",
"signal_amplitude=0.00022: ser=0.98438 ±0.00000, br=5.27344\n",
"signal_amplitude=0.00032: ser=0.98438 ±0.00000, br=5.27344\n",
"signal_amplitude=0.00046: ser=0.97917 ±0.01949, br=7.03125\n",
"signal_amplitude=0.00068: ser=0.68229 ±0.09051, br=107.22656\n",
"signal_amplitude=0.00046: ser=0.97917 ±0.01949, br=7.03125\n",
"signal_amplitude=0.00100: ser=0.15104 ±0.05156, br=286.52344\n",
"signal_amplitude=0.00147: ser=0.01562 ±0.00000, br=332.22656\n",
"signal_amplitude=0.00215: ser=0.01562 ±0.00000, br=332.22656\n",
@ -518,10 +519,10 @@
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x7275bfe3b490>"
"<matplotlib.legend.Legend at 0x7fc23a223550>"
]
},
"execution_count": 28,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
@ -594,13 +595,13 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3e654922b013420d83e47b27c43e18dc",
"model_id": "bda9f8070b0142928936a7752f318e97",
"version_major": 2,
"version_minor": 0
},
@ -614,10 +615,10 @@
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x7275bd43da50>"
"<matplotlib.legend.Legend at 0x7fc20046b730>"
]
},
"execution_count": 29,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
@ -650,13 +651,13 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "23d3975515a0462e94a01e7b3c5dd1a6",
"model_id": "33b1f777dda149eda3a2f031087372c9",
"version_major": 2,
"version_minor": 0
},
@ -671,15 +672,95 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/lib64/python3.7/site-packages/numpy/core/fromnumeric.py:3118: RuntimeWarning: Mean of empty slice.\n",
" out=out, **kwargs)\n",
"/usr/lib64/python3.7/site-packages/numpy/core/_methods.py:85: RuntimeWarning: invalid value encountered in double_scalars\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3334: RuntimeWarning: Mean of empty slice.\n",
" return _methods._mean(a, axis=axis, dtype=dtype,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/usr/lib64/python3.7/site-packages/numpy/core/_methods.py:140: RuntimeWarning: Degrees of freedom <= 0 for slice\n",
" keepdims=keepdims)\n",
"/usr/lib64/python3.7/site-packages/numpy/core/_methods.py:110: RuntimeWarning: invalid value encountered in true_divide\n",
" arrmean, rcount, out=arrmean, casting='unsafe', subok=False)\n",
"/usr/lib64/python3.7/site-packages/numpy/core/_methods.py:132: RuntimeWarning: invalid value encountered in double_scalars\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:216: RuntimeWarning: Degrees of freedom <= 0 for slice\n",
" ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:185: RuntimeWarning: invalid value encountered in true_divide\n",
" arrmean = um.true_divide(\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3334: RuntimeWarning: Mean of empty slice.\n",
" return _methods._mean(a, axis=axis, dtype=dtype,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:216: RuntimeWarning: Degrees of freedom <= 0 for slice\n",
" ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:185: RuntimeWarning: invalid value encountered in true_divide\n",
" arrmean = um.true_divide(\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3334: RuntimeWarning: Mean of empty slice.\n",
" return _methods._mean(a, axis=axis, dtype=dtype,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:216: RuntimeWarning: Degrees of freedom <= 0 for slice\n",
" ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:185: RuntimeWarning: invalid value encountered in true_divide\n",
" arrmean = um.true_divide(\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3334: RuntimeWarning: Mean of empty slice.\n",
" return _methods._mean(a, axis=axis, dtype=dtype,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:216: RuntimeWarning: Degrees of freedom <= 0 for slice\n",
" ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:185: RuntimeWarning: invalid value encountered in true_divide\n",
" arrmean = um.true_divide(\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3334: RuntimeWarning: Mean of empty slice.\n",
" return _methods._mean(a, axis=axis, dtype=dtype,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:216: RuntimeWarning: Degrees of freedom <= 0 for slice\n",
" ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:185: RuntimeWarning: invalid value encountered in true_divide\n",
" arrmean = um.true_divide(\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3334: RuntimeWarning: Mean of empty slice.\n",
" return _methods._mean(a, axis=axis, dtype=dtype,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:216: RuntimeWarning: Degrees of freedom <= 0 for slice\n",
" ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:185: RuntimeWarning: invalid value encountered in true_divide\n",
" arrmean = um.true_divide(\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3334: RuntimeWarning: Mean of empty slice.\n",
" return _methods._mean(a, axis=axis, dtype=dtype,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:216: RuntimeWarning: Degrees of freedom <= 0 for slice\n",
" ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:185: RuntimeWarning: invalid value encountered in true_divide\n",
" arrmean = um.true_divide(\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3334: RuntimeWarning: Mean of empty slice.\n",
" return _methods._mean(a, axis=axis, dtype=dtype,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:216: RuntimeWarning: Degrees of freedom <= 0 for slice\n",
" ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:185: RuntimeWarning: invalid value encountered in true_divide\n",
" arrmean = um.true_divide(\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3334: RuntimeWarning: Mean of empty slice.\n",
" return _methods._mean(a, axis=axis, dtype=dtype,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:216: RuntimeWarning: Degrees of freedom <= 0 for slice\n",
" ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:185: RuntimeWarning: invalid value encountered in true_divide\n",
" arrmean = um.true_divide(\n",
"/home/user/safety-reset/lab-windows/env/lib/python3.8/site-packages/numpy/core/_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n"
]
}
@ -780,7 +861,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
@ -789,13 +870,13 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "62259928c3a24739a4b03c9b9a83859a",
"model_id": "406505452bb84597a6c39bc12267dcc6",
"version_major": 2,
"version_minor": 0
},
@ -810,7 +891,8 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/lib/python3.7/site-packages/ipykernel_launcher.py:20: RuntimeWarning: divide by zero encountered in log10\n"
"<ipython-input-25-50856f807a2a>:20: RuntimeWarning: divide by zero encountered in log10\n",
" cm_func = lambda x: cmap(np.log10(x - min(decimations)) / (np.log10(max(decimations)) - np.log10(min(decimations))))\n"
]
}
],
@ -877,7 +959,7 @@
" for amp, ser, std in sorted(sers):\n",
" if last_ser > SER_TH and ser < SER_TH:\n",
" icp = last_amp + (SER_TH - last_ser) / (ser - last_ser) * (amp - last_amp)\n",
" ic_std = abs(last_amp - amp) / 2# np.sqrt(np.mean(last_std**2 + std**2))\n",
" ic_std = (abs(last_amp - amp) / 2) + np.sqrt(np.mean(last_std**2 + std**2))\n",
" intercepts[dec] = (icp, ic_std)\n",
" break\n",
" last_amp, last_ser = amp, ser\n",
@ -892,7 +974,6 @@
" data = np.array([ intercepts[dec] for dec in x ])\n",
" y = data[:,0]\n",
" std = data[:,1]\n",
" \n",
" ax.set_xlim([min(x), max(x)])\n",
" y = [ v*1000 if v is not None else v for v in y ]\n",
" l = ax.plot(x, y, label='Amplitude at SER=0.5 [mHz]', color='orange')\n",
@ -930,20 +1011,9 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"41.6"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"13 * 2**5 / 10"
]
@ -951,9 +1021,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "winlabenv",
"display_name": "labenv",
"language": "python",
"name": "winlabenv"
"name": "labenv"
},
"language_info": {
"codemirror_mode": {
@ -965,7 +1035,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.8.1"
}
},
"nbformat": 4,

View file

@ -0,0 +1,179 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib\n",
"from matplotlib import pyplot as plt\n",
"import pyldpc"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib widget"
]
},
{
"cell_type": "code",
"execution_count": 92,
"metadata": {},
"outputs": [],
"source": [
"H, G = pyldpc.make_ldpc(1024, 6, 8, systematic=False)"
]
},
{
"cell_type": "code",
"execution_count": 95,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(1024, 261)"
]
},
"execution_count": 95,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"n, k = G.shape\n",
"G.shape"
]
},
{
"cell_type": "code",
"execution_count": 94,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"<ipython-input-94-bc8d2a92108c>: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(figsize=(15, 6))\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "96882c0b2fb3492a8fbcd68d4c1db371",
"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"
}
],
"source": [
"fig, ax = plt.subplots(figsize=(15, 6))\n",
"fig.tight_layout()\n",
"ax.matshow(H)\n",
"None"
]
},
{
"cell_type": "code",
"execution_count": 96,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"<ipython-input-96-9621d966b0c0>:6: 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(figsize=(15, 3))\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "961f48f481054e9da3c60ff5414e4ab8",
"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.image.AxesImage at 0x7f4bcd779e50>"
]
},
"execution_count": 96,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test_data = np.random.randint(0, 2, k)\n",
"\n",
"d = np.dot(G, test_data) % 2\n",
"x = (-1) ** d\n",
"\n",
"fig, ax = plt.subplots(figsize=(15, 3))\n",
"ax.matshow(x.reshape((-1, 64)))"
]
},
{
"cell_type": "code",
"execution_count": 97,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 97,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.all(np.equal(pyldpc.get_message(G, pyldpc.decode(H, x, 3)), test_data))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "labenv",
"language": "python",
"name": "labenv"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.1"
}
},
"nbformat": 4,
"nbformat_minor": 4
}