Skip to content

Commit

Permalink
Fix outage condition
Browse files Browse the repository at this point in the history
  • Loading branch information
muhd-umer committed Feb 5, 2024
1 parent 216fa05 commit ffdb25a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Binary file modified docs/source/examples/figs/dl_noma_op.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/examples/figs/dl_noma_rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/source/examples/siso_dl_noma.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
"rate_f = np.log2(1 + UEf.sinr)\n",
"\n",
"# Rate thresholds\n",
"thresh_n = 3\n",
"thresh_n = 1\n",
"thresh_f = 1\n",
"\n",
"# JIT compiled as mc can be very large (>> 10000)\n",
Expand All @@ -286,7 +286,7 @@
"\n",
" for i in range(len(Pt)):\n",
" for k in range(mc):\n",
" if rate_fn[i, k] < thresh_f and rate_n[i, k] < thresh_n:\n",
" if rate_fn[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",
Expand Down
6 changes: 3 additions & 3 deletions docs/source/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ for i, p in enumerate(Pt_lin):
)
UEn.sinr[i, :] = (BS.allocations["UEn"] * p * gain_n) / N0_lin

# Shannon capacity

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

# Rate thresholds
thresh_n = 3
thresh_n = 1
thresh_f = 1

# JIT compiled as mc can be very large (>> 10000)
Expand All @@ -195,7 +195,7 @@ def get_outage(rate_fn, rate_n, rate_f, thresh_n, thresh_f):

for i in range(len(Pt)):
for k in range(mc):
if rate_fn[i, k] < thresh_f and rate_n[i, k] < thresh_n:
if rate_fn[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
Expand Down
8 changes: 4 additions & 4 deletions examples/siso_dl_noma.ipynb

Large diffs are not rendered by default.

0 comments on commit ffdb25a

Please sign in to comment.