Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

4-7

  • Loading branch information...
commit 4c1bb1f1a01d9bf01997e324399eebf9d857e416 1 parent d08ba81
Qiong Wu authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 courses/wireless_communication/4-7.py
10 courses/wireless_communication/4-7.py
View
@@ -1,8 +1,11 @@
from math import exp, log, e
from scipy.special import exp1
+#average SNR
+#average = 0.3162
+average = 10
def function(x):
- return 1/x*exp(-x/10)-exp1(x/10)/10
+ return 1/x*exp(-x/average)-exp1(x/average)/average
def question_a():
gamma = 0.0001
@@ -18,7 +21,7 @@ def question_a():
return result
def rxtx_csi(x, gamma_0):
- return log(x/gamma_0,2)*exp(-x/10)/10
+ return log(x/gamma_0,2)*exp(-x/average)/average
def question_b():
gamma_0 = question_a()
@@ -32,7 +35,7 @@ def question_b():
print "(b) The integral result is ", result*10
def rx_csi(x):
- return log((x+1),2)*exp(-x/10)/10
+ return log((x+1),2)*exp(-x/average)/average
def question_d():
limit = 100
@@ -44,7 +47,6 @@ def question_d():
delta += step
print "(d) The integral result is ", result*10
-
if __name__ == "__main__":
question_b()
question_d()
Please sign in to comment.
Something went wrong with that request. Please try again.