# Variables
c = 3*10**8; #in m/s
f = 1.*10**6; #in Hz
# Calculations
lembda = c/f;
# Results
print 'Wavelength (in m):',lembda
# Variables
c = 3*10**8; #in m/s
f = 100.*10**6; #in Hz
# Calculations
lembda = c/f;
# Results
print 'Wavelength (in m):',lembda
import math
# Variables
G = 175.; #absolute gain
# Calculations
Gdb = 10*math.log10(175); #decibell gain
# Results
print 'The decibell power gain is:',Gdb,'dB'
# Variables
Gdb = 28.; #decibell gain
# Calculations
G = 10**(Gdb/10); #Absolute power gain
# Results
print 'The absolute power gain is:',G
# Variables
Gdb = 28.; #decibell gain
# Calculations
G = 10**(Gdb/10); #Absolute power gain
Av = G**0.5; #Voltage gain
# Results
print 'The voltage gain is:',Av
import math
# Variables
G = 0.28; #Absolute gain
P1 = 1;
P2 = .28; #28 % of input power
# Calculations and Results
Gdb = 10*math.log10(G);
print 'Decibell gain is',Gdb,'dB'
Ldb = 10*math.log10(P1/P2); #dB loss
print 'Decibell loss is:',Ldb,'dB'
import math
# Variables
PmW = 100.; #power in mW
# Calculations and Results
PdBm = 10*math.log10(PmW/1); #P in dBm level
print '(a). Power in dBm level is:',PdBm,'dBm'
PdBW = PdBm-30; #P in dBW level
print '(b). Power in dBW level is:',PdBW,'dBW'
PdBf = PdBm+120; #Pin dBf level
print '(c) Power in dBf level is:',PdBf,'dBf'
import math
# Variables
G1 = 5000.;
L = 2000.;
G2 = 400.;
# Calculations and Results
G = G1*(1/L)*G2; #Absolute gain
print '(a) Net absolute gain is:',G
GdB = 10*math.log10(G); #System decibell gain
print '(b) System Decibel gain is:',GdB,'dB'
G1dB = 10*math.log10(G1);
LdB = 10*math.log10(L);
G2dB = 10*math.log10(G2);
print ('(c) Individual stage gains are:');
print 'G1dB = ',G1dB
print 'LdB = ',LdB
print 'G2dB = ',G2dB
GdB = G1dB-LdB+G2dB;
print 'The net dB gain is:',GdB,'dB'
import math
# Variables
G1 = 5000.;
L = 2000.;
G2 = 400.;
Ps = 0.1; #in mW
# Calculations and Results
P1 = G1*Ps; #in mW
print '(a) Power level P1 is:',P1,'mW'
P2 = P1/L; #in mW
print 'Line output power P2:',P2,'mW'
Po = G2*P2; #in mW
print 'System output power Po:',Po,'mW'
PsdBm = 10*math.log10(Ps/1);
G1dB = 10*math.log10(G1);
LdB = 10*math.log10(L);
G2dB = 10*math.log10(G2);
print ('(b) Output power power levels in dBm are');
P1dBm = PsdBm+G1dB;
print 'P1(dBm) = ',P1dBm,'dBm'
P2dBm = P1dBm-LdB;
print 'P2(dBm) = ',P2dBm,'dBm'
PodBm = P2dBm+G2dB;
print 'Po(dBm) = ',PodBm,'dBm'
import math
def voltage(PdBm):
P = 1*10**(-3)*(10**(PdBm/10));
return (75*P)**0.5;
# Variables
S = 10.; #dBm
G1 = 13.; #dB
L1 = 26.; #dB
G2 = 20.; #dB
L2 = 29.; #dB
# Calculations and Results
print '(a) The output levels are',
PdBm = S;
V = voltage(PdBm);
print PdBm,'1. Signal source in dBm:',PdBm,'in Volts : ',V
PdBm = S+G1;
V = voltage(PdBm);
print '2. Line Amplifier in dBm:',PdBm,'in Volts : ',V
PdBm = S+G1-L1;
V = voltage(PdBm);
print '3. Cable section A in dBm:',PdBm,'in Volts : ',V
PdBm = S+G1-L1+G2;
V = voltage(PdBm);
print '4. Booster amplifier in dBm:',PdBm,'in Volts : ',V
PdBm = S+G1-L1+G2-L2;
V = voltage(PdBm);
print '5. Cable section B in dBm:',PdBm,'in Volts : ',V
print ('(b). The output power to get a voltage of 6V'),
V = 6.; #volts
R = 75.; #ohm
Po = (V**2)/R;
print Po,'W';
PodBm = 10*math.log10(Po*1000/1);
print 'power in dBm',PodBm,'dBm'
GrdB = PodBm-PdBm;
print 'The required gain is',GrdB,'dB'
import math
# Variables
P = 5.; #In mW
N = 100.*10**-6; #in mW
# Calculations and Results
S2N = P/N;
print '(a) Absolute signal to noise ratio :',S2N
S2NdB = 10*math.log10(S2N);
print '(b) dB signal to noise ratio is:',S2NdB,'dB'
PdBm = 10*math.log10(P/1);
print '(c) Signal Power is',PdBm,'dBm'
NdBm = 10*math.log10(N/1);
print 'Noise power is',NdBm,'dBm'
S2NdB = PdBm-NdBm;
print 'Decinel S/N ratio is',S2NdB,'dB'