Add initial Makefile and figure print. Change the wifi_loopback to direct output to result/

This commit is contained in:
Diyu
2015-11-04 15:09:09 -08:00
committed by Bastian Bloessl
parent 6148463e61
commit 06c2e09234
5 changed files with 45 additions and 7 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/python
import glob, os, re
import matplotlib.pyplot as plt
x= []
y= []
path = "result/"
for filename in glob.glob(os.path.join(path, "*.log")):
pat = re.search(r"s(\d+.\d+)", filename)
pat2 = re.search(r"n(\d+)", filename)
if pat and pat2:
x.append(float(pat.group(1)))
receive = sum(1 for line in open(filename))
total = pat2.group(1)
y.append(receive/float(total))
plt.ylabel("PDR")
plt.xlabel("SNR")
plt.plot(x, y)
plt.show()