Skip to content

Commit

Permalink
Fix subscripts
Browse files Browse the repository at this point in the history
  • Loading branch information
muhd-umer committed Feb 6, 2024
1 parent ffdb25a commit 6a63ded
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions docs/source/examples/siso_dl_noma.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"\n",
"$$\n",
"\\begin{align*}\n",
"R_{f\\,\\rightarrow\\,n} &= \\log_2 \\left(1 + \\frac{\\alpha_f P_t |h_n|^2}{\\alpha_n P_t |h_n|^2 + N_0}\\right),\\\\\n",
"R_{n\\,\\rightarrow\\,f} &= \\log_2 \\left(1 + \\frac{\\alpha_f P_t |h_n|^2}{\\alpha_n P_t |h_n|^2 + N_0}\\right),\\\\\n",
"R_n &= \\log_2 \\left(1 + \\frac{\\alpha_n P_t |h_n|^2}{N_0}\\right),\n",
"\\end{align*}\n",
"$$\n",
Expand Down Expand Up @@ -270,7 +270,7 @@
" UEn.sinr[i, :] = (BS.allocations[\"UEn\"] * p * gain_n) / N0_lin\n",
"\n",
"\n",
"rate_fn = np.log2(1 + UEn.sinr_pre)\n",
"rate_nf = np.log2(1 + UEn.sinr_pre)\n",
"rate_n = np.log2(1 + UEn.sinr)\n",
"rate_f = np.log2(1 + UEf.sinr)\n",
"\n",
Expand All @@ -280,20 +280,20 @@
"\n",
"# JIT compiled as mc can be very large (>> 10000)\n",
"@jit(nopython=True)\n",
"def get_outage(rate_fn, rate_n, rate_f, thresh_n, thresh_f):\n",
"def get_outage(rate_nf, rate_n, rate_f, thresh_n, thresh_f):\n",
" outage_n = np.zeros((len(Pt), 1))\n",
" outage_f = np.zeros((len(Pt), 1))\n",
"\n",
" for i in range(len(Pt)):\n",
" for k in range(mc):\n",
" if rate_fn[i, k] < thresh_f or rate_n[i, k] < thresh_n:\n",
" if rate_nf[i, k] < thresh_f or rate_n[i, k] < thresh_n:\n",
" outage_n[i] += 1\n",
" if rate_f[i, k] < thresh_f:\n",
" outage_f[i] += 1\n",
"\n",
" return outage_n, outage_f\n",
"\n",
"UEn.outage, UEf.outage = get_outage(rate_fn, rate_n, rate_f, thresh_n, thresh_f)\n",
"UEn.outage, UEf.outage = get_outage(rate_nf, rate_n, rate_f, thresh_n, thresh_f)\n",
"UEn.outage /= mc\n",
"UEf.outage /= mc"
]
Expand Down
10 changes: 5 additions & 5 deletions docs/source/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Assuming perfect SIC, the achievable rates at $\mathrm{UE}_n$ and $\mathrm{UE}_f

$$
\begin{align*}
R_{f\,\rightarrow\,n} &= \log_2 \left(1 + \frac{\alpha_f P_t |h_n|^2}{\alpha_n P_t |h_n|^2 + N_0}\right),\\
R_{n\,\rightarrow\,f} &= \log_2 \left(1 + \frac{\alpha_f P_t |h_n|^2}{\alpha_n P_t |h_n|^2 + N_0}\right),\\
R_n &= \log_2 \left(1 + \frac{\alpha_n P_t |h_n|^2}{N_0}\right), \\
\end{align*}
$$
Expand Down Expand Up @@ -179,7 +179,7 @@ for i, p in enumerate(Pt_lin):
UEn.sinr[i, :] = (BS.allocations["UEn"] * p * gain_n) / N0_lin


rate_fn = np.log2(1 + UEn.sinr_pre)
rate_nf = np.log2(1 + UEn.sinr_pre)
rate_n = np.log2(1 + UEn.sinr)
rate_f = np.log2(1 + UEf.sinr)

Expand All @@ -189,20 +189,20 @@ thresh_f = 1

# JIT compiled as mc can be very large (>> 10000)
@jit(nopython=True)
def get_outage(rate_fn, rate_n, rate_f, thresh_n, thresh_f):
def get_outage(rate_nf, rate_n, rate_f, thresh_n, thresh_f):
outage_n = np.zeros((len(Pt), 1))
outage_f = np.zeros((len(Pt), 1))

for i in range(len(Pt)):
for k in range(mc):
if rate_fn[i, k] < thresh_f or rate_n[i, k] < thresh_n:
if rate_nf[i, k] < thresh_f or rate_n[i, k] < thresh_n:
outage_n[i] += 1
if rate_f[i, k] < thresh_f:
outage_f[i] += 1

return outage_n, outage_f

UEn.outage, UEf.outage = get_outage(rate_fn, rate_n, rate_f, thresh_n, thresh_f)
UEn.outage, UEf.outage = get_outage(rate_nf, rate_n, rate_f, thresh_n, thresh_f)
UEn.outage /= mc
UEf.outage /= mc
```
Expand Down
10 changes: 5 additions & 5 deletions examples/siso_dl_noma.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"\n",
"$$\n",
"\\begin{align*}\n",
"R_{f\\,\\rightarrow\\,n} &= \\log_2 \\left(1 + \\frac{\\alpha_f P_t |h_n|^2}{\\alpha_n P_t |h_n|^2 + N_0}\\right),\\\\\n",
"R_{n\\,\\rightarrow\\,f} &= \\log_2 \\left(1 + \\frac{\\alpha_f P_t |h_n|^2}{\\alpha_n P_t |h_n|^2 + N_0}\\right),\\\\\n",
"R_n &= \\log_2 \\left(1 + \\frac{\\alpha_n P_t |h_n|^2}{N_0}\\right),\n",
"\\end{align*}\n",
"$$\n",
Expand Down Expand Up @@ -263,7 +263,7 @@
" UEn.sinr[i, :] = (BS.allocations[\"UEn\"] * p * gain_n) / N0_lin\n",
"\n",
"\n",
"rate_fn = np.log2(1 + UEn.sinr_pre)\n",
"rate_nf = np.log2(1 + UEn.sinr_pre)\n",
"rate_n = np.log2(1 + UEn.sinr)\n",
"rate_f = np.log2(1 + UEf.sinr)\n",
"\n",
Expand All @@ -273,20 +273,20 @@
"\n",
"# JIT compiled as mc can be very large (>> 10000)\n",
"@jit(nopython=True)\n",
"def get_outage(rate_fn, rate_n, rate_f, thresh_n, thresh_f):\n",
"def get_outage(rate_nf, rate_n, rate_f, thresh_n, thresh_f):\n",
" outage_n = np.zeros((len(Pt), 1))\n",
" outage_f = np.zeros((len(Pt), 1))\n",
"\n",
" for i in range(len(Pt)):\n",
" for k in range(mc):\n",
" if rate_fn[i, k] < thresh_f or rate_n[i, k] < thresh_n:\n",
" if rate_nf[i, k] < thresh_f or rate_n[i, k] < thresh_n:\n",
" outage_n[i] += 1\n",
" if rate_f[i, k] < thresh_f:\n",
" outage_f[i] += 1\n",
"\n",
" return outage_n, outage_f\n",
"\n",
"UEn.outage, UEf.outage = get_outage(rate_fn, rate_n, rate_f, thresh_n, thresh_f)\n",
"UEn.outage, UEf.outage = get_outage(rate_nf, rate_n, rate_f, thresh_n, thresh_f)\n",
"UEn.outage /= mc\n",
"UEf.outage /= mc"
]
Expand Down

0 comments on commit 6a63ded

Please sign in to comment.