Skip to content

Commit

Permalink
4-7
Browse files Browse the repository at this point in the history
  • Loading branch information
creasyw committed Nov 2, 2012
1 parent d08ba81 commit 4c1bb1f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions courses/wireless_communication/4-7.py
@@ -1,8 +1,11 @@
from math import exp, log, e from math import exp, log, e
from scipy.special import exp1 from scipy.special import exp1
#average SNR
#average = 0.3162
average = 10


def function(x): 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(): def question_a():
gamma = 0.0001 gamma = 0.0001
Expand All @@ -18,7 +21,7 @@ def question_a():
return result return result


def rxtx_csi(x, gamma_0): 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(): def question_b():
gamma_0 = question_a() gamma_0 = question_a()
Expand All @@ -32,7 +35,7 @@ def question_b():
print "(b) The integral result is ", result*10 print "(b) The integral result is ", result*10


def rx_csi(x): 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(): def question_d():
limit = 100 limit = 100
Expand All @@ -44,7 +47,6 @@ def question_d():
delta += step delta += step
print "(d) The integral result is ", result*10 print "(d) The integral result is ", result*10



if __name__ == "__main__": if __name__ == "__main__":
question_b() question_b()
question_d() question_d()

0 comments on commit 4c1bb1f

Please sign in to comment.