import math
# Variables
c = 3.*10**8; #speed of light
Pt = 5. #W
GtdB = 13.; #dB
GrdB = 17.; #dB
d = 80.*10**3; #metre
f = 3.*10**9; #frequency
# Calculations and Results
lembda = c/f; #wavelength
print 'The wavelength is, = %.1f m'%(lembda);
Gt = 10**(GtdB/10);
Gr = 10**(GrdB/10);
print ' Gt = %.2f '%(Gt);
print ' Gr = %.2f '%(Gr);
Pr = lembda**2*Gt*Gr*Pt/((4*math.pi)**2*d**2);
print ' Pr = %.1f pW '%(Pr*10**12);
import math
# Variables
c = 3.*10**8; #speed of light
Pt = 5. #W
GtdB = 13.; #dB
GrdB = 17.; #dB
d = 80.; #in km
f = 3.; #frequency in GHz
# Calculations and Results
PtdBW = 10*math.log10(Pt);
alfa1_dB = 20*math.log10(f)+20*math.log10(d)+92.44; #dB
print 'The path loss is, (alfa_1dB) = %.2f dB'%(alfa1_dB);
PrdBW = PtdBW+GtdB+GrdB-alfa1_dB; #calculation of recieved power in dB
print ' PrdBW) = %.2f dBW'%(PrdBW)
Pr = 10**(PrdBW/10); #recieved power in Watts
print ' Pr = %.1f pW '%(Pr*10**12);
import math
# Variables
d = 240000.*1.609; #in km
#part a
f = 100.; #frequency in MHz
# Calculations and Results
alfa1_dB = 20*math.log10(f)+20*math.log10(d)+32.44; #dB
print 'a) The path loss is %.2f dB'%(alfa1_dB);
#part b
f = 1; #frequency in GHz
alfa1_dB = 20*math.log10(f)+20*math.log10(d)+92.44; #dB
print ' b) The path loss is %.2f dB'%(alfa1_dB);
#part c
f = 10; #frequency in GHz
alfa1_dB = 20*math.log10(f)+20*math.log10(d)+92.44; #dB
print ' c) The path loss is %.2f dB'%(alfa1_dB);
import math
# Variables
f = 1.; #in GHz
#part a
d = 1.; #in Km
# Calculations and Results
alfa1_dB = 20*math.log10(f)+20*math.log10(d)+92.44; #dB
print 'a) The path loss is %.2f dB'%(alfa1_dB);
#part b
d = 10; #in km
alfa1_dB = 20*math.log10(f)+20*math.log10(d)+92.44; #dB
print ' b) The path loss is %.2f dB'%(alfa1_dB);
#part c
d = 100; #in km
alfa1_dB = 20*math.log10(f)+20*math.log10(d)+92.44; #dB
print ' c) The path loss is %.2f dB'%(alfa1_dB);
import math
# Variables
Pr = 50*10**-12; #in Watts
GtdB = 3; #dB
GrdB = 4; #dB
d = 80; #kilo-metre
f = 500; #frequency in MHz
# Calculations and Results
PrdBW = 10*math.log10(Pr); #in dB conversion
print 'PrdBW) = %.2f dBW'%(PrdBW)
alfa1_dB = 20*math.log10(f)+20*math.log10(d)+32.44; #path loss in dB
print ' The path loss is, %.2f dB'%(alfa1_dB);
PtdBW = PrdBW+alfa1_dB-GtdB-GrdB; #calculation of transmitted power in dB
print ' PtdBW) = %.2f dBW'%(PtdBW)
Pt = 10**(PtdBW/10); #transmitted power in Watts
print ' Pt = %.1f W '%(Pt);
import math
# Variables
Pr = 200.; #in f-Watts
GtdB = 30.; #dB
GrdB = 20.; #dB
d = 40000.; #kilo-metre
f = 4.; #frequency in GHz
# Calculations and Results
PrdBf = 10*math.log10(Pr); #in dBf conversion
print 'PrdBf) = %.2f dBf'%(PrdBf)
alfa1_dB = 20*math.log10(f)+20*math.log10(d)+92.44; #path loss in dB
print ' The path loss is, %.2f dB'%(alfa1_dB);
PtdBf = PrdBf+alfa1_dB-GtdB-GrdB; #calculation of transmitted power in dBf
PtdBW = PtdBf-150; #calculation of transmitted power in dBW
print ' PtdBf) = %.2f dBf OR %.2f dBW'%(PtdBf,PtdBW)
Pt = 10**(PtdBW/10); #transmitted power in Watts
print ' Pt = %.2f W '%(Pt);
import math
# Variables
hT = 50.; #m
hR = 5.; #m
# Calculations
d_km = math.sqrt(17*hT)+math.sqrt(17*hR); #in km
# Results
print ' dkm) = %.2f Km '%(d_km);
import math
# Variables
Pt = 10000.; #Watts
Gt = 25.; #dB
f = 3; #GHz
d = 50; #km
sigma = 20 #radar cross section in m**2
# Calculations and Results
alfa2_dB = 20*math.log10(f)+40*math.log10(d)+163.43-10*math.log10(sigma); #alfa2(dB) calculation
print ' The two way path loss is (alfa2dB) = %.2f dB'%(alfa2_dB);
PtdBW = 10*math.log10(Pt); #transmitted power in dB
print ' PtdBW) = %i dBW'%(PtdBW)
PrdBW = PtdBW+2*Gt-alfa2_dB #dBW
print ' PrdBW) = %.2f dBW '%(PrdBW);
Pr = 10**(PrdBW/10);
print ' Pr = %.2f fW'%(Pr*10**15);
# Variables
c = 3*10**8; #speed of light in m/s
Td = 400*10**-6 #s
# Calculations
d = c*Td/2. #in m
# Results
print ' d = %.0f Km '%(d*10**-3);
# Variables
c = 3.*10**8; #speed of light in m/s
fp = 2.*10**3; #Hz
# Calculations and Results
T = 1./fp #s
dmax = c*T/2 #in m
print 'a) d max = %.0f Km '%(dmax*10**-3);
tau = 6.*10**-6; #s
dmin = c*tau/2 #m
print 'b) d min = %.0f m '%(dmin);
# Variables
c = 3.*10**8; #speed of light in m/s
fc = 15.*10**9; #Hz
v = 25. # speed in m/s
# Calculations
fD = 2*v/c*fc; #Hz
# Results
print 'Doppler shift , fD = %.0f Hz '%(fD);
# Variables
c = 186000.; #speed of light in mi/s
fc = 10.*10**9; #Hz
fD = 2.*10**3; #frequency shift in Hz
# Calculations and Results
v = c*fD/(2*fc); #speed in mi/s
print 'Speed of automobile , v = %.2f*10**-3 mi/s '%(v*10**3);
v = 3600*v;
print ' v = %.1f mi/hr '%(v);
import math
# Variables
n1 = 1.; #refraction index of air
E2 = 4. #material dielectric consmath.tant
theta_i = 50. #angle of incidence in degree (misprinted in the solution)
# Calculations
n2 = math.sqrt(E2);
theta_r = math.asin(n1/n2*math.sin(theta_i*math.pi/180));
# Results
print ' The angle of refraction is %.2f using angle of incidence = 50)'%(theta_r*180/math.pi);
#misprinted angle