Commit 48c53100 authored by Jean-Romain Garnier's avatar Jean-Romain Garnier
Browse files

Increase number of points when plotting model/theory comparison

parent 6495a3f8
......@@ -5,7 +5,7 @@ import Model_N_receivers as NOMAStat
import Theory_N_receivers as NOMATh
def compLogLog(N=2, n=1, xlog=True, ylog=True, it=10000):
def compLogLog(N=2, n=1, xlog=True, ylog=True, it=10000, npoints=100):
"""
Graph of the Bit Error Rate depending on the noise value for a given user
N: number of users
......@@ -30,7 +30,7 @@ def compLogLog(N=2, n=1, xlog=True, ylog=True, it=10000):
# Find, depending on the value of sigma for the noise, the BER for the nth-user
Errors = []
Probas = []
Sigmas = np.linspace(math.sqrt(Pn / 50), math.sqrt(Pn), 50)
Sigmas = np.linspace(math.sqrt(Pn / 50), math.sqrt(Pn), npoints)
for sigma in Sigmas:
probas = NOMATh.theory(g, sigma, P, N)
errors = NOMAStat.stats(g, sigma, P, N, it)
......@@ -46,7 +46,7 @@ def compLogLog(N=2, n=1, xlog=True, ylog=True, it=10000):
ax.set_xscale("log")
plt.xlabel("SNR user {} (log)".format(n))
else:
plt.xlabel("SNR user {}".format(n))
plt.xlabel("SNR user {}".format(n))
if ylog:
ax.set_yscale("log")
......@@ -100,5 +100,4 @@ def compPowerRepartitions(N=2, sigma=0.25, g=1, Pmax=1, it=2000):
if __name__ == '__main__':
# compLogLog(N=3, n=1)
compPowerRepartitions()
compLogLog(N=3, n=1, it=50000, npoints=150)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment