Chapter 1: Introductory Concepts and Fundamentals

Example 1.1, Page 14

In [1]:
import math

#Variable declaration
G=800;      

#Calculations
G1=10*math.log10(G);

#Result
print "The decibel power gain,G= %.2f dB\n"%G1; # Result
The decibel power gain,G= 29.03 dB

Example 1.2, Page 14

In [2]:
import math

#Variable declaration
G=1./10000;      

#Calculations
G1=10*math.log10(G);

#Result
print "The decibel power gain = %.0f dB\n"%G1;
The decibel power gain = -40 dB

Example 1.3, Page 15

In [6]:
#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;   
The ordinary power gain is 199.5
The output power is 199.5 mW 

Example 1.4, Page 15

In [7]:
#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; 
The ordinary power gain 40 

Example 1.5, Page 16

In [8]:
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;
The ordinary power gain 40
The power gain is 32.04 dB

Example 1.6, Page 17

In [9]:
#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;   
The ordinary power gain 19.95
The output voltage is 0.1995  V

Example 1.7, Page 17

In [10]:
import math

#Variable declaration
P=120;      #in Watt     

#Calculations
P1=10*math.log10(P);

#Result
print "The ordinary power gain %.1f dBW \n"%P1;
The ordinary power gain 20.8 dBW 

Example 1.8, Page 18

In [11]:
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;
The ordinary power gain -7 dBW
The ordinary power gain 23 dBm 

Example 1.9, Page 18

In [12]:
#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;    
The ordinary power gain 15.8 mW 

Example 1.10, Page 18

In [13]:
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;
The value in dBV is 6.02 dBV

Example 1.11, Page 19

In [14]:
#Variable declaration
Vin=-42;  # in dBV 
Av=35;      #in dBV

#Calculations
Vout=Vin+Av;

#Result
print "The output signal is %.0f dBV \n"%Vout;
The output signal is -7 dBV 

Example 1.12, Page 19

In [15]:
#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;
The gain of amplifer is 35 dB

Example 1.13, Page 23

In [16]:
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;
Gain lost is -12.3 dB

Example 1.14, Page 24

In [17]:
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);
W1 = 84.3 degrees one decade below fc
W2 = 5.71 degrees one decade below fc

Example 1.15, Page 26

In [18]:
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);
The Gain is -20.6 dB 
 
Phase value is  -84.6 degree

Example 1.16, Page 29

In [21]:
#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;
The rise time for 90 degree lag network is 3.5 u-sec

Example 1.18, Page 34

In [27]:
#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;
It =0.00465 Amp
Collector voltage is 13.025 V
Ib 23.25 u-Amp
Base Voltage -116.25 mV 

Example 1.19, Page 40

In [28]:
#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);
It =0.00073 Amp
re1 =71.2
Single output gain is 39.5
The diferential output gain is twice Av i.e. 79