import math
#Calculation
def calc(fL,fH,enw,fce):
En=enw*math.sqrt((fce*math.log(fH/fL))+fH-fL)
return En
#answer
print "a)\n Estimated RMS input voltage =",round(calc(0.1,100.0,20*10**(-9),200.0)*10**6,2),"micro volt"
print "b)\n Estimated RMS input voltage =",round(calc(20.0,20*10**3,20*10**(-9),200.0)*10**6,2),"micro volt"
print "c)\n Estimated RMS input voltage =",round(calc(0.1,1*10**6,20*10**(-9),200.0)*10**6,1),"micro volt"
from sympy import Symbol,integrate
import math
#Variable Declaration
fL1=1.0 # Hz
fH1=1*10**3 # Hz
fL2=fH1
fH2=10*10**3 # Hz
fL3=fH2
#Calculation
#fH3=infinity
enw=20*10**(-9)
fce=100.0 # Hz
Eno1=enw*math.sqrt((fce*math.log(fH1/fL1))+fH1-fL1)
eno=float(enw)/fL2
f=Symbol('f')
Eno2=eno*math.sqrt(integrate(f**2,(f,fL2,fH2))) # Integrating
f0=100*10**3 # Hz
enw3=200*10**(-9)
Eno3=enw3*math.sqrt((1.57*f0)-fL3)
Eno=math.sqrt((Eno1**2)+(Eno2**2)+(Eno3**2))
#answer
print "Estimated rms noise voltage =",round(Eno*10**6,1),"micro volt"
import math
#Variable Declaration
R=10*10**3 # ohm
#Calculation
k=1.38*10**(-23)
T=25+273 # Room Temperature in Kelvin
eR=math.sqrt(4*k*T*R)
iR=eR/R
fH=20*10**3 # Hz
fL=20 # Hz
ER=eR*math.sqrt(fH-fL)
#answer
print "a)\n Noise Voltage (eR) =",round(eR*10**9,1),"nV/(Hz)^0.5"
print "b)\n Noise Current (iR) =",round(iR*10**12,2),"pA/(Hz)^0.5"
print "c)\n Rms noise voltage over audio range =",round(ER*10**6,2),"micro volt"
import math
#Variable Declaration
fH=1*10**6 # Hz
q=1.602*10**(-19)
#Calculation
def calc(ID):
global fH,q
In=math.sqrt(2*q*ID*fH)
SNR=20*math.log10(ID/In)
return SNR
#answer
print "a)\n Signal to Noise Ratio =",round(calc(1*10**(-6)),1),"dB"
print "b)\n Signal to Noise Ratio =",round(calc(1*10**(-9)),1),"dB"
import math
#Variable Declaration
R1=100*10**3 # ohm
R2=200*10**3 # ohm
R3=68*10**3 # ohm
enw=20*10**(-9) # V/(Hz)^0.5
fce=200.0 # Hz
ft=1*10**6 # Hz
inw=0.5*10**(-12) # A/(Hz)^0.5
fci=2*10**3 # Hz
#Calculation
Rp=(R1*R2)/(R1+R2)
Ano=1+(R2/R1)
fB=ft/Ano
fL=0.1
Enoe=Ano*enw*math.sqrt((fce*math.log(fB/fL))+(1.57*fB)-fL)
Enoi=Ano*math.sqrt((R3**2)+(Rp**2))*inw*math.sqrt((fci*math.log(fB/ fL))+(1.57*fB))
k=1.38*10**(-23)
T=25+273 #Room temperature in Kelvin
EnoR=Ano*math.sqrt((4*k*T)*(R3+Rp)*1.57*fB)
Eno=math.sqrt((Enoe**2)+(Enoi**2)+(EnoR**2))
#answer
print "a)\n RMS Output Noise Voltage =",round(Eno*10**6),"micro volt"
print " Peak to Peak Noise Voltage =",round(6.6* Eno*10**3,2),"mV" # answer in book differs due to precision error
from sympy.solvers import solve
from sympy import Symbol
import math
#Variable Declaration
R1=100*10**3 # ohm
R2=200*10**3 # ohm
R3=68*10**3 # ohm
enw=20*10**(-9) # V/(Hz)^0.5
fce=200.0 # Hz
ft=1*10**6 # Hz
inw=0.5*10**(-12) # A/(Hz)^0.5
fci=2*10**3 # Hz
#Calculation
Rp=(R1*R2)/(R1+R2)
Ano=1+(R2/R1)
fB=ft/Ano
fL=0.1
Enoeold=Ano*enw*math.sqrt((fce*math.log(fB/fL))+(1.57*fB)-fL )
Enoiold=Ano*math.sqrt((R3**2)+(Rp**2))*inw*math.sqrt((fci*math.log(fB/fL))+(1.57*fB))
k=1.38*10**(-23)
T=25+273 #Room temperature in Kelvin
EnoRold=Ano*math.sqrt((4*k*T)*(R3+Rp)*1.57*fB)
Enoold=math.sqrt((Enoeold**2)+(Enoiold**2)+(EnoRold**2))
Enonew=50*10**(-6) #New Value of Eno mentioned in problem
Enoisum=(Enonew**2)-(Enoeold**2) #sum of ( Enoi ˆ2) and (EnoRˆ2)
Enoinewsq=(Ano**2)*(inw**2)*((fci*math.log(fB/fL))+(1.57*fB )) #( Enoinew ˆ2) /(Rˆ2)
EnoRnewsq=(Ano**2)*((4*k*T)*1.57*fB)
x=Symbol('x')
r1=solve((Enoinewsq*(x**2))+(EnoRnewsq*x)-Enoisum,x)
R=r1[1]
R3new=R/2
R1new=(3*R3new)/2
R2new=2*R1new
#answer
print "Resistances after scaling are : "
print "R1 =",round(R1new*10**(-3),2),"kilo ohm" # answer in book wrong due to precision error
print "R2 =",round(R2new*10**(-3),1),"kilo ohm"
print "R3 =",round(R3new*10**(-3),1),"kilo ohm"
import math
#Variable Declaration
R1=100*10**3 #ohm, From Example 7.7( a)
R2=200*10**3 #ohm, From Example 7.7( a)
Eno=154*10**(-6) # V, From Example 7.9
#Calculation
Aso=-(R2/R1)
Eni=Eno/abs(Aso)
Vipa=0.5 #Peak amplitude of input ac signal
Virms=Vipa/math.sqrt(2)
SNR=20*math.log10(Virms/Eni)
#answer
print "SNR of the c irc uit of Example 7.7 =",round(SNR,1),"dB"
import math
#Variable Declaration
z0=710*10**3 # ohm
fb=350*10**3 # Hz
rn=50.0 # ohm
enw=2.4*10**(-9) # V/(Hz)^0.5
fce=50*10**3 # Hz
inpw=3.8*10**(-12) # A/(Hz)^0.5
fcip=100*10**3 # Hz
innw=20*10**(-12) # A/(Hz)^0.5
fcin=100*10**3 # Hz
R1=166.7 # ohm
R2=1.5*10**3 # ohm
#Calculation
R3=100 # internal resistance
fL=0.1
Rp=(R1*R2)/(R1+R2)
ft=(z0*fb)/R2
fB=ft/(1+(rn/((R1*R2)/(R1+R2))))
Ano=1+(R2/R1)
Enoe=enw*math.sqrt((fce*math.log(fB/fL))+(1.57*fB)-fL)
Enoi=R3*inpw*math.sqrt(((fcip*math.log(fB/fL))+(1.57*fB)-fL))
Enop=Rp*innw*math.sqrt((fcin*math.log(fB/fL))+(1.57*fB)-fL)
k=1.38*10**(-23)
T=25+273 #/Room temperature in Kelvin
EnoR=math.sqrt((4*k*T)*(R3+Rp)*((1.57*fB)-fL))
Eno=Ano*math.sqrt((Enoe**2)+(Enoi**2)+(EnoR**2)+(Enop**2))
c=6.6*10**3 # F
Eno1=Eno*c
#answer
print "RMS Noise Voltage (Eno) =",round(Eno*10**6,2),"micro volt" #answer in textbook is wrong
print "Peak to Peak Noise Voltage (Eno) =",round(Eno1,2),"mV" #answer in textbook is wrong
import math
import numpy as np
#Variable Declaration
ft=16*10**6 # Hz
enw=4.5*10**(-9) # V/(Hz)^0.5
fce=100.0 # Hz
IB=1*10**(-12) # A
fL=0.01 # Hz
R1=100*10**(9) # ohm
C1=45*10**(-12) # F
R2=10*10**6 # ohm
C2=0.5*10**(-12) # F
#Calculation
b0rec=1.0
binfrec=91.0
fz=350.0 # Hz
fp=31.8*10**3 # Hz
fx=176*10**3 # Hz
k=1.38*10**(-23)
T=25+273
iR2=math.sqrt((4*k*T)/R2)
q=1.602*10**(-19)
In=math.sqrt(2*q*IB)
Enoe=binfrec*enw*math.sqrt(((np.pi/2)*fx)-fp)
EnoR=R2*iR2*math.sqrt((np.pi/2)*fp)
Eno=math.sqrt((Enoe**2)+(EnoR**2))
#answer
print "Total Output Noise =",round(Eno*10**6),"micro Volt"
import math
#Variable Declaration
ft=16*10**6 # Hz
enw=4.5*10**(-9) # V/(Hz)^0.5
fce=100.0 # Hz
IB=1*10**(-12) # A
fL=0.01 # Hz
R1=100*10**(9) # ohm
C1=45*10**(-12) # F
R2=10*10**6 # ohm
C2=0.5*10**(-12) # F
#Calculation
b0rec=1.0
binfrec=91.0
fz=350.0 # Hz
fp=31.8*10**3 # Hz
fx=176*10**3 # Hz
k=1.38*10**(-23)
T=25+273
Cc=0.5*10**(-12) # Assumed
C2=Cc
C3=10*10**(-9)
R3=(R2*Cc)/C3
#answer
print "Cc = C2 =",round(Cc*10**(12),2),"pF"
print "R3 =",round(R3,2),"ohm"
print "C3 =",round(C3*10**(9),2),"nF"
import math
import numpy as np
#Variable Declaration
C1=2*10**(-9) # F
binfrec=4000.0 # V/V
T=1*10**(9) # V/A
#Calculation
inw=0.566*10**(-15)
ft=16*10**6 # Hz
R1=100*10**(9) #ohm
C2=0.5*10**(-12) #F
fx=(1.0/binfrec)*ft
enw=4.5*10**(-9)
Enoe=binfrec*enw*math.sqrt((np.pi*fx)/2)
EnoRmax=Enoe/3
k=1.38*10**(-23)
Temp=25+273
ex=((EnoRmax**2)*C2)/(k*Temp)
R2=T/ex
R3=1*10**3 # Assumed
R4=(ex-1)*R3
fp=1/(2*np.pi*ex*R2*C2)
fB=fp
Rp=(R1*R2)/(R1+R2)
Enoi=math.sqrt(1.57*fB)*inw
Eno=math.sqrt((Enoe**2)+(Enoi**2)+(EnoRmax**2))
#answer
print "a) Designed T Network : "
print " R1 =",round(R1*10**(-9)),"giga ohm"
print " R2 =",round(R2*10**(-6)),"mega ohm" # precision error in book
print " R3 =",round(R3*10**(-3)),"kilo ohm"
print " R4 =",round(R4*10**(-3),1),"kilo ohm" # precision error in book
print " C1 =",round(C1*10**9),"nF"
print " C2 =",round(C2*10**12),"pF"
print "b)\n Total rms Output Noise =",round(Eno*10**3,2),"mV"
print " Bandwidth (fB) =",round(fB),"Hz"