Add initial Makefile and figure print. Change the wifi_loopback to direct output to result/
This commit is contained in:
Executable
+27
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user