NumPy_Matplolib_Python
Budget: ₹1,500 – ₹2,250 INR
numpy as np import matplotlib
See attached Zipped file also and the BID if confident to do in 3 days
project title is tunable slope switched capacitor for campanding ADC kindly justify this title. for more technical discussion kindly call me
# initialise the varibles
import numpy as np
import matplotlib.pyplot as plt
#capacitor values
c1= float(input("enter the value of capacitor1 value \n"))
c2=float(input('enter the value of capacitor2 value \n'))
c3=float(input('enter the value of capacitor3 value \n'))
c4=float(input('enter the value of capacitor4 value \n'))
cintp=float(input('enter the value of capacitorintp value \n'))
cintm=float(input('enter the value of capacitorintm value \n'))
ota_gain= float(input("enter the ota_gain : \n "))
# volatge formulas
'''vrefp= 1
vrefm= 1'''
vreff=1
vinrange=1
#vi=float(1.8)
#sampling= 1e+6
vi=np.sin(np.arange(0, 1, (0.1)))
#sampling= 1e+6
resolution=10
vcm=float(input("enter the common mode volatge \n"))
vip= vcm + (vi/2.0)
print("vip=",vip)
#print(vip)
vim= vcm- (vi/2.0)
print("vim=",vim)
vi= vip-vim
print("vi=",vi)
#VREF= vrefp-vrefm
vrefp=vcm+ (vreff/2.0)
vrefm= vcm -(vreff/2.0)
print('vrefp=',vrefp)
print('vrefm=',vrefm)
# sampling command cycle 1
print("sampling command begins")
for i,x in enumerate (vip):
q1= c1*vrefp
q2= c2* x
q3= c3*vrefm
q4= c4*vim[i]
qcintp=0
qcintm=0
voutp=voutm=vcm
print("q1=",q1)
print("q2=",q2)
print("q3=",q3)
print("q4=",q4)
print("qcintp=",qcintp)
print("qcintm=",qcintm)
print("voutp=",voutp)
print("voutm=",voutm)
# first charge integrating cycle
print("charge integration command begins")
qcintm= q2
qcintp= q4
voutm=(qcintm/cintm)
voutp=(qcintp/cintp)
print("voutp=",voutp)
print("voutm=",voutm)
voutdiff= voutp-voutm
print("voutdiff=",voutdiff)
#CAMPARATOR
if voutdiff[0] > 0 :
voutc=1
elif voutdiff[0] < 0:
voutc=0
print("voutc=",voutc)
#reset c2 and c3
print("reset charge in c2 and c4")
q2=0
q4=0
print("q2=",q2)
print("q4=",q4)
#chage sharing
print("chage sharing action begins \n ")
vtop= ((c1/(c1+c2))*vrefp)
vbot= ((c3/(c3+c4))*vrefm)
print("vtop=",vtop)
print("vbot=",vbot)
#second charge integrating phase
print("second charge integrating phase \n")
if voutc==1: #this means chagre on the left plate is negative. so need to add positve charge
voutp=((c2/cintp)*((vi/2.0)-(vreff/4.0)))
voutm=((c4/cintm)*((-vi/2.0)+(vreff/4.0)))
elif voutc==0:
voutp=((c4/cintp)*((vi/2.0)-(vreff/4.0)))
voutm=((c2/cintm)*((-vi/2.0)+(vreff/4.0)))
print("voutp=",voutp)
print("voutm=",voutm)
voutdiff= voutp-voutm
print("voutdiff=",voutdiff)
# dff
plt.plot(vi,color='red')
plt.xlabel('time')
plt.ylabel(' vi ')
plt.title('input analog signal')
plt.grid()
plt.show()
plt.plot(voutdiff,color='orange')
plt.xlabel('time')
plt.ylabel('voutdiff')
plt.title('voutdiff')
plt.grid()
plt.show()
plt.plot(vip,color='block')
plt.xlabel('time')
plt.ylabel('input analog signal')
plt.title('VIP')
plt.grid()
plt.show()
plt.plot(vim)
plt.xlabel('time')
plt.ylabel('input analog signal')
plt.title('VIM')
plt.grid()
plt.show()
plt.plot(voutp)
plt.xlabel('time')
plt.ylabel('input analog signal')
plt.title('voutp')
plt.grid()
plt.show()
plt.plot(voutm)
plt.xlabel('time')
plt.ylabel('input analog signal')
plt.title('voutm')
plt.grid()
plt.show()
plt.plot(voutc)
plt.xlabel('time')
plt.ylabel('input analog signal')
plt.title('voutc')
plt.grid()
plt.show()
See attached Zipped file also and the BID if confident to do in 3 days
project title is tunable slope switched capacitor for campanding ADC kindly justify this title. for more technical discussion kindly call me
# initialise the varibles
import numpy as np
import matplotlib.pyplot as plt
#capacitor values
c1= float(input("enter the value of capacitor1 value \n"))
c2=float(input('enter the value of capacitor2 value \n'))
c3=float(input('enter the value of capacitor3 value \n'))
c4=float(input('enter the value of capacitor4 value \n'))
cintp=float(input('enter the value of capacitorintp value \n'))
cintm=float(input('enter the value of capacitorintm value \n'))
ota_gain= float(input("enter the ota_gain : \n "))
# volatge formulas
'''vrefp= 1
vrefm= 1'''
vreff=1
vinrange=1
#vi=float(1.8)
#sampling= 1e+6
vi=np.sin(np.arange(0, 1, (0.1)))
#sampling= 1e+6
resolution=10
vcm=float(input("enter the common mode volatge \n"))
vip= vcm + (vi/2.0)
print("vip=",vip)
#print(vip)
vim= vcm- (vi/2.0)
print("vim=",vim)
vi= vip-vim
print("vi=",vi)
#VREF= vrefp-vrefm
vrefp=vcm+ (vreff/2.0)
vrefm= vcm -(vreff/2.0)
print('vrefp=',vrefp)
print('vrefm=',vrefm)
# sampling command cycle 1
print("sampling command begins")
for i,x in enumerate (vip):
q1= c1*vrefp
q2= c2* x
q3= c3*vrefm
q4= c4*vim[i]
qcintp=0
qcintm=0
voutp=voutm=vcm
print("q1=",q1)
print("q2=",q2)
print("q3=",q3)
print("q4=",q4)
print("qcintp=",qcintp)
print("qcintm=",qcintm)
print("voutp=",voutp)
print("voutm=",voutm)
# first charge integrating cycle
print("charge integration command begins")
qcintm= q2
qcintp= q4
voutm=(qcintm/cintm)
voutp=(qcintp/cintp)
print("voutp=",voutp)
print("voutm=",voutm)
voutdiff= voutp-voutm
print("voutdiff=",voutdiff)
#CAMPARATOR
if voutdiff[0] > 0 :
voutc=1
elif voutdiff[0] < 0:
voutc=0
print("voutc=",voutc)
#reset c2 and c3
print("reset charge in c2 and c4")
q2=0
q4=0
print("q2=",q2)
print("q4=",q4)
#chage sharing
print("chage sharing action begins \n ")
vtop= ((c1/(c1+c2))*vrefp)
vbot= ((c3/(c3+c4))*vrefm)
print("vtop=",vtop)
print("vbot=",vbot)
#second charge integrating phase
print("second charge integrating phase \n")
if voutc==1: #this means chagre on the left plate is negative. so need to add positve charge
voutp=((c2/cintp)*((vi/2.0)-(vreff/4.0)))
voutm=((c4/cintm)*((-vi/2.0)+(vreff/4.0)))
elif voutc==0:
voutp=((c4/cintp)*((vi/2.0)-(vreff/4.0)))
voutm=((c2/cintm)*((-vi/2.0)+(vreff/4.0)))
print("voutp=",voutp)
print("voutm=",voutm)
voutdiff= voutp-voutm
print("voutdiff=",voutdiff)
# dff
plt.plot(vi,color='red')
plt.xlabel('time')
plt.ylabel(' vi ')
plt.title('input analog signal')
plt.grid()
plt.show()
plt.plot(voutdiff,color='orange')
plt.xlabel('time')
plt.ylabel('voutdiff')
plt.title('voutdiff')
plt.grid()
plt.show()
plt.plot(vip,color='block')
plt.xlabel('time')
plt.ylabel('input analog signal')
plt.title('VIP')
plt.grid()
plt.show()
plt.plot(vim)
plt.xlabel('time')
plt.ylabel('input analog signal')
plt.title('VIM')
plt.grid()
plt.show()
plt.plot(voutp)
plt.xlabel('time')
plt.ylabel('input analog signal')
plt.title('voutp')
plt.grid()
plt.show()
plt.plot(voutm)
plt.xlabel('time')
plt.ylabel('input analog signal')
plt.title('voutm')
plt.grid()
plt.show()
plt.plot(voutc)
plt.xlabel('time')
plt.ylabel('input analog signal')
plt.title('voutc')
plt.grid()
plt.show()