import math
#Variable declaration
G=800;
#Calculations
G1=10*math.log10(G);
#Result
print "The decibel power gain,G= %.2f dB\n"%G1; # Result
import math
#Variable declaration
G=1./10000;
#Calculations
G1=10*math.log10(G);
#Result
print "The decibel power gain = %.0f dB\n"%G1;
#Variable declaration
G1=23.; #in dB
#Calculations&Results
G=10**(G1/10);
print "The ordinary power gain is %.1f"%G;
Pin=10**-3; #in mW
Pout=Pin*G*10**3;
print "The output power is %.1f mW \n"%Pout;
#Variable declaration
G1=10; #in dB
G2=16; #in dB
G3=14; #in dB
#Calculations
Gt=G1+G2+G3; #total gain
#Result
print "The ordinary power gain %.0f \n"%Gt;
import math
#Variable declaration
Ao=2; #in Volt
Ai=50; # in milliVolt
Ai1=0.05; #input in Volt
#Calculations&Results
Av=Ao/Ai1;
print "The ordinary power gain %.0f"%Av;
Av1=20*math.log10(Av);
print "The power gain is %.2f dB\n"%Av1;
#Variable declaration
G1=26.; #in dB
Vin=0.01; #in volt
#Calculations&Results
G=10**(G1/20);
print "The ordinary power gain %.2f"%G;
Vout=Vin*G;
print "The output voltage is %.4f V\n"%Vout;
import math
#Variable declaration
P=120; #in Watt
#Calculations
P1=10*math.log10(P);
#Result
print "The ordinary power gain %.1f dBW \n"%P1;
import math
#Calculations&Results
P=0.200; #in Watt
P1=10*math.log10(P/1);
print "The ordinary power gain %.0f dBW"%P1;
P=200.; #in mW
P1=10*math.log10(P/1);
print "The ordinary power gain %.0f dBm \n"%P1;
#Variable declaration
P1=12; # in dBw
Ref=1.; # in mW
#Calculations
P=10**(P1*Ref/10);
#Result
print "The ordinary power gain %.1f mW \n"%P;
import math
#Variable declaration
V=2; # in V
Ref=1; # in V
#Calculations
V1=20*math.log10(V/Ref);
#Result
print "The value in dBV is %.2f dBV\n"%V1;
#Variable declaration
Vin=-42; # in dBV
Av=35; #in dBV
#Calculations
Vout=Vin+Av;
#Result
print "The output signal is %.0f dBV \n"%Vout;
#Variable declaration
Pin1=20; #in dBm
Pin=-10; #in dBW
Pout=25; #in dBW
#Calculations
G=Pout-Pin;
#Result
print "The gain of amplifer is %.0f dB"%G;
import math
#Variable declaration
fc=40.; #in Hz
f=10.; #in Hz
#Calculations
Av=-10*math.log10(1+(fc**2)/(f**2));
#Result
print "Gain lost is %.1f dB"%Av;
import math
#Variable declaration
fc=120.; # in Hz
fc1=1200; # in Hz
fc2=12; # in Hz
#Calculations&Results
w1=math.atan(fc/fc2);
print "W1 = %.1f degrees one decade below fc"%(w1*180/math.pi);
w2=math.atan(fc/fc1);
print "W2 = %.2f degrees one decade below fc"%(w2*180/math.pi);
import math
#Variable declaration
f=1.6*10**6; #in Hz
fc=150*10**3; #in Hz
#Calculations&Results
Av=-10*math.log10(1+(f**2)/(fc**2));
print "The Gain is %.1f dB \n "%Av;
w=-(math.pi/2)+math.atan(fc/f);
print "Phase value is %.1f degree"%(w*180/math.pi);
#Variable declaration
#f2=0.35/Tr;
f2=100*10**3; #in kHz
#Calculations
Tr=0.35/f2*10**6;
#Result
print "The rise time for 90 degree lag network is %.1f u-sec"%Tr;
#Variable declaration
Vcc=20; #in Volt
Rc=3000; #in Ohm
Rb=5000; #in ohm
Rt=2000; #in Ohm
Vee=10; #in Volt
#Calculations&Results
It=(Vee-0.7)/Rt;
print "It =%.5f Amp"%It;# Result
#Ie1=Ie2=It/2
Ic=It/2;
Vc=Vcc-Ic*Rc;
print "Collector voltage is %.3f V"%Vc;
B=100; #Assumumption
Ib=Ic/B*10**6;
print "Ib %.2f u-Amp"%Ib;
Vb=-Ib*Rb*10**-3;
print "Base Voltage %.2f mV "%Vb;
#Variable declaration
Vcc=15; #in Volt
Rc=8000; #in Ohm
re=30; #in ohm
Rt=10000; #in Ohm
Vee=8; #in Volt
#Calculations&Results
It=(Vee-0.7)/Rt;
print "It =%.5f Amp"%It;
Ie=It/2;
re1=(26*10**-3)/Ie;
print "re1 =%.1f"%re1;
#for single ended output gain
Av=Rc/(2*(re1+re));
print "Single output gain is %.1f"%Av;
print "The diferential output gain is twice Av i.e. %.0f "%(2*Av);