Chapter 11: Transistor Amplifier Design

Example 11.1, Page 428

In [1]:
import math
import cmath

#Variable declaration
def mod(n):
    r=n.real
    i=n.imag
    x=math.sqrt(r**2+i**2)
    return x
    
S11=0.894*cmath.exp(complex(0,-60.6*math.pi/180))
S12=0.02*cmath.exp(complex(0,62.4*math.pi/180))
S21=3.122*cmath.exp(complex(0,123.6*math.pi/180))
S22=0.781*cmath.exp(complex(0,-27.6*math.pi/180))

#Calculations
deln=mod((S11*S22)-(S12*S21))
k=(1+mod(deln)**2-mod(S11)**2-mod(S22)**2)/2/mod(S12*S21)

#Results
print "|del|=%.4f"%deln
print "k=%.4f"%k
|del|=0.6964
k=0.6071

Example 11.2, Page 429

In [2]:
import math
import cmath

#Variable declaration
Zo=50   #ohms
S11=0.6*cmath.exp(complex(0,-155*math.pi/180))
S22=0.48*cmath.exp(complex(0,-20*math.pi/180))
S12=0
S21=6*cmath.exp(complex(0,180*math.pi/180))
Ss11=0.606*cmath.exp(complex(0,155*math.pi/180))
Ss22=0.48*cmath.exp(complex(0,20*math.pi/180))

def mod(n):
    r=n.real
    i=n.imag
    x=math.sqrt(r**2+i**2)
    return x
 
#Calculations&Results   
#k=(1-mod(S11)**2-mod(S22)**2+mod(del)**2)/(2*mod(S12*S21))
deln=mod(S11*S22-S12*S21)
print "mod(del)=%.3f"%mod(deln)
GTUmax=(1-mod(Ss11)**2)*mod(S21)**2/mod((1-mod(S11)**2))**2*(1-mod(Ss22)**2)/mod((1-mod(S22)**2))**2
print "GTUmax=%.4f"%GTUmax
print "GTUmax in dB=%.3f"%(10*math.log10(GTUmax))
mod(del)=0.288
GTUmax=72.2635
GTUmax in dB=18.589

Example 11.3, Page 435

In [3]:
import math
import cmath

#Variable declaration
S11=0.614*cmath.exp(complex(0,-167.4*math.pi/180))
S21=2.187*cmath.exp(complex(0,32.4*math.pi/180))
S12=0.046*cmath.exp(complex(0,65*math.pi/180))
S22=0.716*cmath.exp(complex(0,-83*math.pi/180))

def mod(n):
    r=n.real
    i=n.imag
    x=math.sqrt(r**2+i**2)
    return x
 
#Calculations&Results   
deln=(S11*S22-S12*S21)
B1=1+mod(S11)**2-mod(S22)**2-mod(deln)**2
B2=1+mod(S22)**2-mod(S11)**2-mod(deln)**2
C1=S11-S22*deln
C2=S22-S11*deln


print "del=%.4f"%mod(deln)
k=(1-mod(S11)**2-mod(S22)**2+mod(deln)**2)/(2*mod(S12*S21))
print "k=%.4f"%k
FMS=(B1-cmath.sqrt(B1**2-4*mod(C1)**2))/(2*C1)
print "FMS=",FMS
FML= (B2-cmath.sqrt(B2**2-4*mod(C2)**2))/(2*C2)
print "FML=",FML
GTmax=mod(S21)/mod(S12)*(k-math.sqrt(k**2-1))
print "GTmax=%.3f"%GTmax
print "GTmax in dB=%.2f dB"%(10*math.log10(GTmax))
del=0.3420
k=1.1296
FMS= (-0.147420203038+0.989073952612j)
FML= (0.2768408015+0.960915797885j)
GTmax=28.728
GTmax in dB=14.58 dB

Example 11.4, Page 438

In [4]:
import math
import cmath

#Variable declaration
#for transistor A
def mod(n):
    r=n.real
    i=n.imag
    x=math.sqrt(r**2+i**2)
    return x


S11=0.45*cmath.exp(complex(0,math.pi/180*150))
S12=0.01*cmath.exp(complex(0,-math.pi/180*10))
S21=2.05*cmath.exp(complex(0,math.pi/180*10))
S22=0.4*cmath.exp(complex(0,-math.pi/180*150))

#Calculations&Results
UA=(mod(S12)*mod(S21)*mod(S11)*mod(S22))/(1-mod(S11)**2)/(1-mod(S22)**2)
print "UA=%.5f"%UA

#for transistor B
S11=0.641*cmath.exp(complex(0,-math.pi/180*171.3))
S12=0.057*cmath.exp(complex(0,math.pi/180*16.3))
S21=2.058*cmath.exp(complex(0,math.pi/180*28.5))
S22=0.572*cmath.exp(complex(0,-math.pi/180*95.7))
UB=(mod(S12)*mod(S21)*mod(S11)*mod(S22))/(1-mod(S11)**2)/(1-mod(S22)**2)
print "UB=%.4f"%UB
UA=0.00551
UB=0.1085

Example 11.5, Page 440

In [5]:
import math
import cmath

#Variable declaration
S11=0.75*cmath.exp(complex(0,-120*math.pi/180))
S22=0.6*cmath.exp(complex(0,-70*math.pi/180))
S21=2.5*cmath.exp(complex(0,80*math.pi/180))
def mod(n):
    r=n.real
    i=n.imag
    x=math.sqrt(r**2+i**2)
    return x
    
#Calculations&Results
GSmax=1/(1-mod(S11)**2)
GLmax=1/(1-mod(S22)**2)
Go=mod(S21)**2
print "GSmax=%.5f"%GSmax
print "GSmax in dB=%.2f"%(10*math.log10(GSmax))
print "GLmax=%.4f"%GLmax
print "GLmax in dB=%.2f"%(10*math.log10(GLmax))
print "Go=%.2f"%Go
print "Go in dB=%.2f"%(10*math.log10(Go))
GTUmax=10*math.log10(GSmax*GLmax*Go)
print "GTUmax=%.2f"%GTUmax
GSmax=2.28571
GSmax in dB=3.59
GLmax=1.5625
GLmax in dB=1.94
Go=6.25
Go in dB=7.96
GTUmax=13.49

Example 11.6, Page 444

In [6]:
import math
import cmath

#Variable declaration
Gs=10**0.5
S11=2.27*cmath.exp(complex(0,-math.pi/180*120))
S21=4*cmath.exp(complex(0,math.pi/180*50))
S12=0
S22=0.6*cmath.exp(complex(0,-math.pi/180*80))
Ss11=2.27*cmath.exp(complex(0,math.pi/180*120))
def mod(n):
    r=n.real
    i=n.imag
    x=math.sqrt(r**2+i**2)
    return x

#Calculations&Results
#(b)
gs=Gs*(1-mod(S11)**2)
Rs=(1-mod(S11)**2)*math.sqrt(1-gs)/(1-(1-gs)*mod(S11)**2)
ds=gs*(Ss11)/(1-(1-gs)*mod(S11)**2)
print "\nGs=%.4f\ngs=%.4f\nRs=%.4f"%(Gs,gs,Rs)
print "ds=",ds
Gs=10**.3
gs=Gs*(1-mod(S11)**2)
Rs=(1-mod(S11)**2)*math.sqrt(1-gs)/(1-(1-gs)*mod(S11)**2)
ds=gs*(Ss11)/(1-(1-gs)*mod(S11)**2)
print "\nGs=%.f\ngs=%.4f\nRs=%.4f"%(Gs,gs,Rs)
print "ds=",ds
GLmax=1./(1-mod(S22)**2)
print "GLmax=%.4f"%GLmax
Go=mod(S21)**2
print "Go=%.f"%Go
GTU=3+10*math.log10(GLmax*Go)
print "\nGTU=%.4f dB"%GTU
Gs=3.1623
gs=-13.1326
Rs=0.2174
ds= (-0.207528521651+0.359449943519j)

Gs=2
gs=-8.2861
Rs=0.2701
ds= (-0.200739739785+0.347691428406j)
GLmax=1.5625
Go=16

GTU=16.9794 dB