Avm=200 #mid band voltage gain
f1=20 #cutoff frequency1 (Hz)
f2=20*10**3 #cutoff frequency2 (Hz)
fi1=5 #input frequency1(Hz)
fi2=200*10**3 #input frequency2(Hz)
Av=0.707*Avm #voltage gain at either frequency
Av1=Avm/(1+(f1/fi1)**2)**0.5 #voltage gain for 5Hz
Av2=Avm/(1+(fi2/f2)**2)**0.5 #voltage gain for 200KHz
print 'voltage gain for 200KHz = ',round(Av1,2)
print 'voltage gain for 5Hz = ',round(Av2,2)
Avm=100000 #mid band voltage gain
f2=10 #cutoff frequency (Hz)
Av=0.707*Avm #voltage gain at cutoff frequency
print 'voltage gain for 10Hz = ',Av
import math # This will import math module
Avm=100000 #mid band voltage gain
fc=10.0 #cutoff frequency (Hz)
fi1=100.0 #input frequency1(Hz)
fi2=1*10**3 #input frequency2(Hz)
fi3=10*10**3 #input frequency3(Hz)
fi4=100*10**3 #input frequency4(Hz)
fi5=1*10**6 #input frequency5(Hz)
Av1=Avm/(1+(fi1/fc)**2)**0.5 #voltage gain for 100Hz
Av2=Avm/(1+(fi2/fc)**2)**0.5 #voltage gain for 1KHz
Av3=Avm/(1+(fi3/fc)**2)**0.5 #voltage gain for 10KHz
Av4=Avm/(1+(fi4/fc)**2)**0.5 #voltage gain for 100KHz
Av5=Avm/(1+(fi5/fc)**2)**0.5 #voltage gain for 1MHz
print 'voltage gain for 100Hz = ',math.ceil(Av1)
print 'voltage gain for 1KHz = ',math.ceil(Av2)
print 'voltage gain for 10KHz = ',math.ceil(Av3)
print 'voltage gain for 100KHz = ',math.ceil(Av4)
print 'voltage gain for 1MHz = ',math.ceil(Av5)
import math # This will import math module
Ap1=1 #power gain1
Ap2=2 #power gain2
Ap3=4 #power gain3
Ap4=8 #power gain4
Ap_db1=10*math.log10(Ap1) #decibel power gain(dB)
Ap_db2=10*math.log10(Ap2) #decibel power gain(dB)
Ap_db3=10*math.log10(Ap3) #decibel power gain(dB)
Ap_db4=10*math.log10(Ap4) #decibel power gain(dB)
print 'decibel power gain Ap1(dB) = ',Ap_db1,'dB'
print 'decibel power gain Ap2(dB) = ',round(Ap_db2,2),'dB'
print 'decibel power gain Ap3(dB) = ',round(Ap_db3,2),'dB'
print 'decibel power gain Ap4(dB) = ',round(Ap_db4,2),'dB'
print 'Each time Ap increase by factor 2, decibel power gain increases by 3 dB'
import math # This will import math module
Ap1=1 #power gain1
Ap2=0.5 #power gain2
Ap3=0.25 #power gain3
Ap4=0.125 #power gain4
Ap_db1=10*math.log10(Ap1) #decibel power gain(dB)
Ap_db2=10*math.log10(Ap2) #decibel power gain(dB)
Ap_db3=10*math.log10(Ap3) #decibel power gain(dB)
Ap_db4=10*math.log10(Ap4) #decibel power gain(dB)
print 'decibel power gain Ap1(dB) = ',Ap_db1,'dB'
print 'decibel power gain Ap2(dB) = ',round(Ap_db2,2),'dB'
print 'decibel power gain Ap3(dB) = ',round(Ap_db3,2),'dB'
print 'decibel power gain Ap4(dB) = ',round(Ap_db4,2),'dB'
print 'Each time Ap decreases by factor 2, decibel power gain decreases by 3 dB'
import math # This will import math module
Ap1=1 #power gain1
Ap2=10 #power gain2
Ap3=100 #power gain3
Ap4=1000 #power gain4
Ap_db1=10*math.log10(Ap1) #decibel power gain(dB)
Ap_db2=10*math.log10(Ap2) #decibel power gain(dB)
Ap_db3=10*math.log10(Ap3) #decibel power gain(dB)
Ap_db4=10*math.log10(Ap4) #decibel power gain(dB)
print 'decibel power gain Ap1(dB) = ',Ap_db1,'dB'
print 'decibel power gain Ap2(dB) = ',Ap_db2,'dB'
print 'decibel power gain Ap3(dB) = ',Ap_db3,'dB'
print 'decibel power gain Ap4(dB) = ',Ap_db4,'dB'
print 'Each time Ap increases by factor 10, decibel power gain increases by 10 dB'
import math # This will import math module
Ap1=1 #power gain1
Ap2=0.1 #power gain2
Ap3=0.01 #power gain3
Ap4=0.001 #power gain4
Ap_db1=10*math.log10(Ap1) #decibel power gain(dB)
Ap_db2=10*math.log10(Ap2) #decibel power gain(dB)
Ap_db3=10*math.log10(Ap3) #decibel power gain(dB)
Ap_db4=10*math.log10(Ap4) #decibel power gain(dB)
print 'decibel power gain Ap1(dB) = ',Ap_db1,'dB'
print 'decibel power gain Ap2(dB) = ',Ap_db2,'dB'
print 'decibel power gain Ap3(dB) = ',Ap_db3,'dB'
print 'decibel power gain Ap4(dB) = ',Ap_db4,'dB'
print 'Each time Ap decreases by factor 10, decibel power gain decreases by 10 dB'
import math # This will import math module
Av1=100 #voltage gain1
Av2=200 #voltage gain2
Av=Av1*Av2 #total voltage gain
Av_db=20*math.log10(Av) #decibel total voltage gain(dB)
Av_db1=20*math.log10(Av1) #decibel voltage gain(dB)
Av_db2=20*math.log10(Av2) #decibel voltage gain(dB)
Avt_db=Av_db1+Av_db2 #decibel total voltage gain(dB)
print 'decibel total voltage gain Av(dB) = ',round(Av_db,2),'dB'
print 'decibel voltage gain Av1(dB) = ',Av_db1,'dB'
print 'decibel voltage gain Av2(dB) = ',round(Av_db2,2),'dB'
print 'so, again, decibel total voltage gain by addition of both: Avt(dB) = ',round(Avt_db,2),'dB'
import math # This will import math module
Av_db1=23 #voltage gain1(dB)
Av_db2=36 #voltage gain2(dB)
Av_db3=31 #voltage gain3(dB)
Avt_db=Av_db1+Av_db2+Av_db3 #decibel total voltage gain(dB)
Ap=10**(Avt_db/10) #power gain by taking antilog
Avt=10**(Avt_db/20.0) #total voltage gain by taking antilog
print 'decibel total voltage gain Avt(dB) = ',Avt_db,'dB'
print 'power gain Ap = ',Ap
print 'total voltage gain Avt = ',math.ceil(Avt)
Av_db1=23 #voltage gain1(dB)
Av_db2=36 #voltage gain2(dB)
Av_db3=31 #voltage gain3(dB)
Av1=10**(Av_db1/20.0) #voltage gain of stage 1 by taking antilog
Av2=10**(Av_db2/20.0) #voltage gain of stage 2 by taking antilog
Av3=10**(Av_db3/20.0) #voltage gain of stage 3 by taking antilog
print 'voltage gain of stage 1 : Av1 = ',round(Av1,2)
print 'voltage gain of stage 1 : Av2 = ',round(Av2,2)
print 'voltage gain of stage 1 : Av3 = ',round(Av3,2)
Ap_dbm=24 #power gain(dBm)
P=10**(Ap_dbm/10.0) #Output power(mW)
print 'Output power P = ',round(P,2),'mW'
import math # This will import math module
Av_dbV=-34 #voltage gain(dBV)
V=10**(Av_dbV/20.0) #Output voltage(V)
print 'Output voltage V = ',math.ceil(V*1000),'mV'
Avm=100000 #mid band voltage gain
f2=10 #cutoff frequency (Hz)
Av_db=20*math.log10(Avm) #decibel total voltage gain(dB)
print 'voltage gain for 10Hz = ',Av_db1,'dB'
print 'At 1MHz, due to roll off factor of 20 dB, voltage gain reduce to 0 dB'
import math
R=5*10**3 #resistance(Ohm)
C=100*10**-12 #Capacitance (F)
f2=(2*math.pi*R*C)**-1 #cutoff frequency (Hz)
print 'cutoff frequency f2 = ',round((f2/1000),2),'KHz'
print 'After f2, response rolls off at rate of 20 dB/decade'
import math
R=2*10**3 #resistance(Ohm)
C=500*10**-12 #Capacitance (F)
f2=(2*math.pi*R*C)**-1 #cutoff frequency (Hz)
print 'cutoff frequency f2 = ',round((f2/1000),2),'KHz'
print 'After f2, response rolls off at rate of 20 dB/decade up to funity of 15.9 MHz'
import math
R=5.3*10**3 #resistance(Ohm)
C=30*10**-12 #Capacitance (F)
Av=100000 #voltage gain
Cout_M=C #input Miller Capacitance (F)
Cin_M=Av*C #input Miller Capacitance (F)
f2=(2*math.pi*R*Cin_M)**-1 #cutoff frequency (Hz)
print 'cutoff frequency f2 = ',round(f2,3),'Hz'
TR=1*10**-6 #rise time(s)
f2=0.35/TR #cutoff frequency (Hz)
print 'cutoff frequency f2 = ',f2/1000,'KHz'
import math
re=22.7 #from past dc calculation (example:9-5)(Ohm)
VCC=10 #collector voltage(V)
RC=3.6 #Collector resistance (KOhm)
RE=1 #Emitter resistance (KOhm)
R1=10 #Base resistance1 (KOhm)
R2=2.2 #Base resistance2 (KOhm)
VBE=0.7 #Base-emitter voltage drop(V)
RL=10 #Load resistance2 (KOhm)
B=150 #current gain
RG=0.6 #source resistance(KOhm)
C1=0.47*10**-6 #input capacitance(F)
C3=2.2*10**-6 #output capacitance(F)
C2=10*10**-6 #emitter capacitance(F)
Rinb=B*re/1000 #Rin(base) (KOhm)
Ri=RG+((R1**-1)+(Rinb**-1)+(R2**-1))**-1 #thevenin resistance facing i/p capacitor
f1i=((2*math.pi*Ri*C1)**-1)/1000 #input cutoff frequency (Hz)
Ro=RC+RL #thevenin resistance facing o/p capacitor
f1o=((2*math.pi*Ro*C3)**-1)/1000 #output cutoff frequency (Hz)
Zout=(((RE**-1)+((re/1000)**-1))**-1)+((((R1**-1)+(R2**-1)+(RG**-1))**-1)/B) #thevenin resistance facing emitter-bypass capacitor
f1z=((2*math.pi*Zout*C2)**-1)/1000 #cutoff frequency for bypass circuit (Hz)
print 'input cutoff frequency f1 = ',round(f1i,2),'Hz'
print 'output cutoff frequency f1 = ',round(f1o,2),'Hz'
print 'cutoff frequency for bypass circuit f1 = ',round(f1z,2),'Hz'
import math # This will import math module
re=22.7 #from past dc calculation (example:9-5)(Ohm)
VCC=10 #collector voltage(V)
RC=3.6 #Collector resistance (KOhm)
RE=1 #Emitter resistance (KOhm)
R11=10 #Base resistance1 (KOhm)
R12=2.2 #Base resistance2 (KOhm)
RL=10 #Load resistance2 (KOhm)
B=150 #current gain
RG=0.6 #source resistance(KOhm)
fT=300*10**6 #current gain bandwidth product(Hz)
CC1=2.1*10**-12 #Cc' capacitance(F)
Cs=10*10**-12 #stray capacitance(F)
Rinb=B*re/1000 #Rin(base) (KOhm)
Ce1=((2*math.pi*re*fT)**-1) #capacitance Ce'(F)
rc=RC*RL/(RC+RL) #collector resistance(KOhm)
rg=((R11**-1)+(RG**-1)+(R12**-1))**-1 #source resistance (Ohm)
Av=math.ceil(1000*rc/re) #voltage gain
Cin_M=CC1*(Av+1) #input Miller capacitance(F)
C1=Ce1+Cin_M #base bypass capacitance(F)
R1=int(1000*rg*Rinb/(rg+Rinb)) #resistance facing this capacitance(Ohm)
f2=((2*math.pi*R1*C1)**-1) #base bypass circuit cutoff frequency (Hz)
Cout_M=CC1*((Av+1)/Av) #output Miller capacitance(F)
C2=Cout_M+Cs #output bypass capacitance(F)
R2=1000*RC*RL/(RC+RL) #resistance facing this capacitance(Ohm)
f21=((2*math.pi*R2*C2)**-1) #collector bypass circuit cutoff frequency (Hz)
print 'base bypass circuit cutoff frequency f2 = ',round((f2/10**6),2),'MHz'
print 'collector bypass circuit cutoff frequency f21 = ',round((f21/10**6),2),'MHz'
import math
re=22.7 #from past dc calculation (example:9-5)(Ohm)
RC=3.6 #Collector resistance (KOhm)
R1=2*10**6 #Base resistance1 (Ohm)
R2=1*10**6 #Base resistance2 (Ohm)
RD=150 #drain resistance(Ohm)
RL=1*10**3 #Load resistance2 (Ohm)
RG=0.6*10**3 #source resistance(Ohm)
Cin=0.1*10**-6 #Cin capacitance(F)
Cout=10*10**-6 #Cout capacitance(F)
Rthi=RG+((R1**-1)+(R2**-1))**-1 #Thevenin resistance facing input coupling capacitor resistance (Ohm)
f1=((2*math.pi*Rthi*Cin)**-1) #base bypass circuit cutoff frequency (Hz)
Rtho=RD+RL #Thevenin resistance facing output coupling capacitor resistance (Ohm)
f2=((2*math.pi*Rtho*Cout)**-1) #base bypass circuit cutoff frequency (Hz)
print 'base bypass circuit cutoff frequency f1 = ',round(f1,2),'Hz'
print 'collector bypass circuit cutoff frequency f2 = ',round(f2,2),'Hz'
import math
Ciss=60 #Capacitance Ciss (pF)
Coss=25 #Capacitance Coss (pF)
Crss=5 #Capacitance Crss (pF)
gm=93*10**-3 #gm (S)
R1=2*10**6 #resiatance 1(Ohm)
R2=1*10**6 #resiatance 2(Ohm)
RG=600 #resiatance(Ohm)
RD=150 #resiatance(Ohm)
RL=1*10**3 #load resiatance(Ohm)
Cgd=Crss #Internal Capacitance Cgd (pF)
Cgs=Ciss-Crss #Internal Capacitance Cgs (pF)
Cds=Coss-Crss #Internal Capacitance Cds (pF)
rd=((RD**-1)+(RL**-1))**-1 #rd (Ohm)
Av=gm*rd #voltage gain
Cin_M=Cgd*(Av+1) #Cin(M) (pF)
C=Cgs+Cin_M #gate bypass capacitance (pF)
R=((R1**-1)+(R2**-1)+(RG**-1))**-1 #resistance (Ohm)
f2=((2*math.pi*R*C*10**-12)**-1) #gate bypass cutoff frequency (Hz)
Cout_M=Cgd*((Av+1)/Av) #Cout(M) (pF)
C1=Cds+Cout_M #drain bypass capacitance(pF)
f21=((2*math.pi*rd*C1*10**-12)**-1) #drain bypass cutoff frequency (Hz)
print 'Gate bypass cutoff frequency = ',round(f2*10**-6,2),'MHz'
print 'Drain bypass cutoff frequency = ',round(f21*10**-6,2),'MHz'