diff options
Diffstat (limited to 'Electronics_Circuits_and_Systems_by_Y._N._Bapat/Ch7.ipynb')
-rw-r--r-- | Electronics_Circuits_and_Systems_by_Y._N._Bapat/Ch7.ipynb | 622 |
1 files changed, 622 insertions, 0 deletions
diff --git a/Electronics_Circuits_and_Systems_by_Y._N._Bapat/Ch7.ipynb b/Electronics_Circuits_and_Systems_by_Y._N._Bapat/Ch7.ipynb new file mode 100644 index 00000000..af9fd2a9 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y._N._Bapat/Ch7.ipynb @@ -0,0 +1,622 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7 - Feedback Amplifiers and Sinusoidal Oscillators" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7_1 Page No. 204" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A= 60000.00\n", + "Af= 10000.00\n", + "N_dB=20*log10(Af/A)= -15.56 dB\n", + "B=(1/(Af))-(1/A)= 8.33e-05\n" + ] + } + ], + "source": [ + "from math import log10\n", + "from __future__ import division \n", + "A=60000\n", + "print \"A= %0.2f\"%(A) #Amplifier gain\n", + "Af=10000\n", + "print \"Af= %0.2f\"%(Af) #Feedback gain\n", + "N_dB=20*log10(Af/A)\n", + "print \"N_dB=20*log10(Af/A)= %0.2f\"%(N_dB),\"dB\" #Negative feedback gain\n", + "B=(1/(Af))-(1/A)# formulae using (Af=A/(1+A*B))\n", + "print \"B=(1/(Af))-(1/A)= %0.2e\"%(B) #Feedback factor" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7_2 Page No. 205" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A= 10000.00\n", + "B= 0.01\n", + "Af= (A/(1+A*B))=99.01\n", + "A1= 100000.00\n", + "Af1= (A1/(1+A1*B))=99.90\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "A=10000\n", + "print \"A= %0.2f\"%(A) #Amplifier gain\n", + "B=0.01\n", + "print \"B= %0.2f\"%(B) #Feedback factor\n", + "Af=(A/(1+A*B))\n", + "print \"Af= (A/(1+A*B))=%0.2f\"%(Af) #Feedback gain\n", + "A1=100000\n", + "print \"A1= %0.2f\"%(A1) #New amplifier gain value\n", + "Af1=(A1/(1+A1*B))\n", + "print \"Af1= (A1/(1+A1*B))=%0.2f\"%(Af1) #New feedback gain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7_3 Page No. 208" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Vo= 50.00 volts\n", + "Vi= 0.50 volts\n", + "part(i)\n", + "A= Vo/Vi=100.00\n", + "Harmonic_distortion=10.00 %\n", + "D= (10*Vo)/100 = 5.00 volts\n", + "Df= (1*Vo)/100 = 0.50 volts\n", + "B=(D/(Df*A))-(1/A) = 0.09\n", + "part(ii)\n", + "Af= (A/(1+A*B)) = 10.00\n", + "part(iii)\n", + "Vif= Vo/Af = 5.00 volts\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "Vo=(50)\n", + "print \"Vo= %0.2f\"%(Vo),\" volts\" # output voltage\n", + "Vi=(0.5)\n", + "print \"Vi= %0.2f\"%(Vi),\" volts\" # input voltage\n", + "print \"part(i)\" \n", + "A=Vo/Vi\n", + "print \"A= Vo/Vi=%0.2f\"%(A) #Amplifier gain\n", + "HD=10\n", + "print \"Harmonic_distortion=%0.2f\"%(HD),\"%\"# Percentage second harmonic distortion\n", + "D=(10*Vo)/100\n", + "print \"D= (10*Vo)/100 = %0.2f\"%(D),\" volts\" # Second Harmonic distortion \n", + "Df=(1*Vo)/100\n", + "print \"Df= (1*Vo)/100 = %0.2f\"%(Df),\" volts\" # Harmonic distortion with Feedback\n", + "B=(D/(Df*A))-(1/A) #Using formulae Df=(D/(1+A*B))\n", + "print \"B=(D/(Df*A))-(1/A) = %0.2f\"%(B) #Feedback factor\n", + "print \"part(ii)\" \n", + "Af=(A/(1+A*B))\n", + "print \"Af= (A/(1+A*B)) = %0.2f\"%(Af) #Feedback gain\n", + "print \"part(iii)\" \n", + "Vif=Vo/Af\n", + "print \"Vif= Vo/Af = %0.2f\"%(Vif),\" volts\" # New input voltage required" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7_4 Page No. 210" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "GBW= 1000000.00 Hz\n", + "AMf=100.00\n", + "fHF=GBW/AMf= 10000.00 Hz\n", + "f_10per cent=(10*fHF)/100= 1000.00 Hz\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "GBW=10**(6)\n", + "print \"GBW= %0.2f\"%(GBW),\" Hz\"# Gain-Bandwidth product\n", + "AMf=100\n", + "print \"AMf=%0.2f\"%(AMf) # Midband gain with feedback\n", + "fHF=GBW/AMf\n", + "print \"fHF=GBW/AMf= %0.2f\"%(fHF),\" Hz\"#Signal bandwidth\n", + "f_10percent=(10*fHF)/100\n", + "print \"f_10per cent=(10*fHF)/100= %0.2f\"%(f_10percent),\" Hz\"#Frequency below which AMf will not deviate by more than 10 percent" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7_5 Page No. 212" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "AM=50000.00\n", + "fH= 20000.00 Hz\n", + "fL= 30.00 Hz\n", + "B= 5.00e-05\n", + "AMf=AM/(1+B*AM)=14285.71\n", + "fHf=fH*(1+B*AM)= 70000.00 Hz\n", + "fLf=fL/(1+B*AM)= 8.57 Hz\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "AM=50000\n", + "print \"AM=%0.2f\"%(AM) # Midband gain \n", + "fH=20*10**(3)\n", + "print \"fH= %0.2f\"%(fH),\" Hz\"# Upper cut-off frequency\n", + "fL=30\n", + "print \"fL= %0.2f\"%(fL),\" Hz\"# Lower cut-off frequency\n", + "B=5*10**(-5)\n", + "print \"B= %0.2e\"%(B) #Feedback factor\n", + "AMf=AM/(1+B*AM)\n", + "print \"AMf=AM/(1+B*AM)=%0.2f\"%(AMf) # Midband gain with feedback\n", + "fHf=fH*(1+B*AM)\n", + "print \"fHf=fH*(1+B*AM)= %0.2f\"%(fHf),\" Hz\"#Upper cut-off frequency with feedback\n", + "fLf=fL/(1+B*AM)\n", + "print \"fLf=fL/(1+B*AM)= %0.2f\"%(fLf),\" Hz\"#Lower cut-off frequency with feedback\n", + "#NOTE: calculated value of AMf is AMf=14285.714 and fLF=8.5714286 but in book given as AMf=14286 and fLF=8.58 Hz" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7_6 Page No. 214" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "AM=100.00 dB\n", + "fc1= 10000.00 Hz\n", + "fc2= 100000.00 Hz\n", + "fc3= 1000000.00 Hz\n", + "part(i)\n", + "Af1=85.00 dB\n", + "f= 50000.00 Hz\n", + "theta_A=-108.12 degree\n", + "theta_pm=180-abs(theta_A)=71.88 degree\n", + "Amplifier stable\n", + "part(ii)\n", + "Af2=50.00 dB\n", + "f= 500000.00 Hz\n", + "theta_A= -194.11 degree\n", + "theta_pm=180-abs(theta_A)=-14.11 degree\n", + "Amplifier unstable\n", + "part(iii)\n", + "Af3=20.00 dB\n", + "f= 1100000.00 Hz\n", + "theta_A=-222.01 degree\n", + "theta_pm=180-abs(theta_A)=-42.01 degree\n", + "Amplifier unstable\n" + ] + } + ], + "source": [ + "from math import atan,pi\n", + "from __future__ import division \n", + "AM=100\n", + "print \"AM=%0.2f\"%(AM),\"dB\" # Midband gain \n", + "fc1=1*10**(4)\n", + "print \"fc1= %0.2f\"%(fc1),\" Hz\"# First Critical frequency\n", + "fc2=10**5\n", + "print \"fc2= %0.2f\"%(fc2),\" Hz\"# Second Critical frequency\n", + "fc3=10**6\n", + "print \"fc3= %0.2f\"%(fc3),\" Hz\"# Third Critical frequency\n", + "print \"part(i)\"\n", + "Af1=85\n", + "print \"Af1=%0.2f\"%(Af1),\"dB\" # gain at 50 kHz and -20dB/decade roll-off\n", + "f=50*10**(3)\n", + "print \"f= %0.2f\"%(f),\" Hz\"# operating frequency\n", + "theta_A=- atan(f/fc1)*180/pi- atan(f/fc2)*180/pi- atan(f/fc3)*180/pi#phase shift in radians\n", + "print \"theta_A=%0.2f\"%(theta_A),\" degree\"# Phase shift for feedback gain Af1\n", + "theta_pm=180-abs(theta_A)# formulae phase margin\n", + "print \"theta_pm=180-abs(theta_A)=%0.2f\"%(theta_pm),\" degree\"# Phase Margin for feedback gain Af1\n", + "print \"Amplifier stable\"# Since phase margin is (+)ive\n", + "print \"part(ii)\"\n", + "Af2=50\n", + "print \"Af2=%0.2f\"%(Af2),\" dB\" # gain at 500 kHz and -40dB/decade roll-off\n", + "f=500*10**(3)\n", + "print \"f= %0.2f\"%(f),\" Hz\"# frequency\n", + "theta_A=- atan(f/fc1)- atan(f/fc2)- atan(f/fc3)#phase shift in radians\n", + "theta_A=theta_A*180/pi # degree\n", + "print \"theta_A= %0.2f\"%(theta_A),\" degree\"# Phase shift for feedback gain Af2\n", + "theta_pm=180-abs(theta_A)# formulae phase margin\n", + "print \"theta_pm=180-abs(theta_A)=%0.2f\"%(theta_pm),\" degree\"# Phase Margin for feedback gain Af1\n", + "print \"Amplifier unstable\"# Since phase margin is (-)ive\n", + "print \"part(iii)\"\n", + "Af3=20\n", + "print \"Af3=%0.2f\"%(Af3),\"dB\" # gain at 1100 kHz and -60dB/decade roll-off\n", + "f=1100*10**(3)\n", + "print \"f= %0.2f\"%(f),\" Hz\"# frequency\n", + "theta_A=- atan(f/fc1)- atan(f/fc2)- atan(f/fc3)#phase shift in radians\n", + "theta_A=theta_A*180/pi # degree\n", + "print \"theta_A=%0.2f\"%(theta_A),\" degree\"# Phase shift for feedback gain Af3\n", + "theta_pm=180-abs(theta_A)# formulae phase margin\n", + "print \"theta_pm=180-abs(theta_A)=%0.2f\"%(theta_pm),\" degree\"# Phase Margin for feedback gain Af1\n", + "print \"Amplifier unstable\"# Since phase margin is (-)ive\n", + "#NOTE:Correct ans for part(i) phase margin ,theta_pm=71.882476 degree but in book given as 71.86 degree\n", + "# correct ans for part(iii) phase shift, theta_A=-222.01103 degree but in book given as -220.02 degree " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7_7 Page No. 216" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "AV=50000.00\n", + "Ri= 5.00e+07 ohm\n", + "R0= 1000.00 ohm\n", + "AVf=10.00\n", + "RSf= 50000.00 ohm\n", + "RF=AVf*(R1)= 5.00e+05 ohm\n", + "VS= 30.00 volts\n", + "Vomax=0.5*(VS)= -15.00 , +15.00 volts\n", + "Vsmax=Vomax/AVf= -1.50 , +1.50 volts\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "AV=50000\n", + "print \"AV=%0.2f\"%(AV) # Voltage gain \n", + "Ri=50*10**(6)\n", + "print \"Ri= %0.2e\"%(Ri),\" ohm\" #Input resistance of OP-AMP\n", + "R0=1*10**(3)\n", + "print \"R0= %0.2f\"%(R0),\" ohm\" #Output resistance\n", + "AVf=10\n", + "print \"AVf=%0.2f\"%(AVf) # Overall Voltage gain \n", + "RSf=50*10**(3)\n", + "print \"RSf= %0.2f\"%(RSf),\" ohm\" #Source resistance\n", + "R1=RSf\n", + "RF=AVf*(R1)\n", + "print \"RF=AVf*(R1)= %0.2e\"%(RF),\" ohm\" #Feedback resistance\n", + "VS=30\n", + "print \"VS= %0.2f\"%(VS),\" volts\" # Peak-peak output swing voltage\n", + "Vomax=0.5*(VS)\n", + "print \"Vomax=0.5*(VS)= -%0.2f\"%(Vomax),\", +%0.2f\"%(Vomax),\" volts\" # Maximum output voltage swing at negative and positive polarities respectively\n", + "Vsmax=Vomax/AVf\n", + "print \"Vsmax=Vomax/AVf= -%0.2f\"%(Vsmax),\", +%0.2f\"%(Vsmax),\" volts\" # Maximum output voltage without overload clipping at both polarities\n", + "\n", + "\n", + "#for overall voltage gain author has used two notations 'Avf' and 'Af' ... but I am working with 'Avf' only" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7_8 Page No. 218" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R1= 50000.00 ohm\n", + "RF= 500000.00 ohm\n", + "VS= 1.00 volts\n", + "part(i)\n", + "A = infinite\n", + "Vo1=-(RF/R1)= -10.00 volts\n", + "part(ii)\n", + "A=50000.00\n", + "B=R1/(R1+RF)= 0.09\n", + "Vo2=-((RF)*(B*A))/(R1*(1+A*B))= -10.00 volts\n", + "%Error,e= ((Vo2-Vo1)*100)/Vo1=0.02 % \n", + "part(iii)\n", + "%Error,e=0.01 % \n", + "Vo3=Vo1-(e*Vo1/100)= 10.00 volts\n", + "A=(Vo*R1)/(B*RF*(1-(Vo*RF/R1)))=1.10e+05\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "R1=50*10**(3)\n", + "print \"R1= %0.2f\"%(R1),\" ohm\" # resistance at input terminal of OP-AMP\n", + "RF=500*10**(3)\n", + "print \"RF= %0.2f\"%(RF),\" ohm\" #Feedback resistance\n", + "VS=1\n", + "print \"VS= %0.2f\"%(VS),\" volts\" # Peak-peak output swing voltage\n", + "print \"part(i)\" \n", + "print \"A = infinite\"# voltage gain\n", + "Vo1=-(RF/R1) #Output voltage when gain, A=infinite\n", + "print \"Vo1=-(RF/R1)= %0.2f\"%(Vo1),\" volts\"\n", + "print \"part(ii)\" \n", + "A=50000\n", + "print \"A=%0.2f\"%(A) # gain of OP-AMP\n", + "B=R1/(R1+RF)\n", + "print \"B=R1/(R1+RF)= %0.2f\"%(B) #Feedback factor\n", + "Vo2=-((RF)*(B*A))/(R1*(1+A*B))\n", + "print \"Vo2=-((RF)*(B*A))/(R1*(1+A*B))= %0.2f\"%(Vo2),\" volts\"# output voltage for A=50000\n", + "e=-((Vo2-Vo1)*100)/Vo1\n", + "print \"%%Error,e= ((Vo2-Vo1)*100)/Vo1=%0.2f\"%(e),\"% \"# calculation for percentage error in output voltage\n", + "print \"part(iii)\" \n", + "e=0.01\n", + "print \"%%Error,e=%0.2f\"%(e),\"% \"#Given percentage error in output voltage\n", + "Vo3=-(Vo1-(e*Vo1/100))\n", + "print \"Vo3=Vo1-(e*Vo1/100)= %0.2f\"%(Vo3),\" volts\"# output voltage for error 0.01%\n", + "x=Vo3*(R1/RF)\n", + "A=(x)/(B*(1-x)) #using formulae Vo=-(RF/R1)*((B*A)/1+A*B))\n", + "print \"A=(Vo*R1)/(B*RF*(1-(Vo*RF/R1)))=%0.2e\"%(A) # New Required gain for error less than 0.01%\n", + "\n", + "# while solving the problem I have used 'e' for the error as no varriable is given for the same in textbook by author\n", + "# in textbook author has used 'Vo' for output voltage in all parts.. but to remove any ambiguity in the programe I have used 'Vo1' 'Vo2' 'Vo3' for part i, ii, iii, respectively" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7_9 Page No. 218" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "AV=100000.00\n", + "Ri= 10000.00 ohm\n", + "Ro= 10.00 ohm\n", + "Rs= 1.00e+07 ohm\n", + "RL= 1000.00 ohm\n", + "B=(Rs-Ri)/(AV*Ri)= 0.01\n", + "AVf=AV/(1+B*AV)=100.00\n", + "Rof=Ro/(1+B*AV) =0.01 ohm\n", + "Rif=Ri/(1+B*AV) =1.00e+07 ohm\n", + "Ap=(AVf**2)*(Rif/RL)=1.00e+08\n", + "AP=10*log10(Ap)=80.00 dB\n" + ] + } + ], + "source": [ + "from math import log10\n", + "from __future__ import division \n", + "AV=100000\n", + "print \"AV=%0.2f\"%(AV) # Voltage gain \n", + "Ri=10*10**(3)\n", + "print \"Ri= %0.2f\"%(Ri),\" ohm\" #Input resistance of OP-AMP\n", + "Ro=10\n", + "print \"Ro= %0.2f\"%(Ro),\" ohm\" #Output resistance\n", + "Rs=10*10**(6)\n", + "print \"Rs= %0.2e\"%(Rs),\" ohm\" #Source resistance\n", + "RL=1*10**(3)\n", + "print \"RL= %0.2f\"%(RL),\" ohm\" #Load resistance\n", + "B=(Rs-Ri)/(AV*Ri)\n", + "print \"B=(Rs-Ri)/(AV*Ri)= %0.2f\"%(B) #Feedback factor\n", + "AVf=AV/(1+B*AV)\n", + "print \"AVf=AV/(1+B*AV)=%0.2f\"%(AVf) # Overall Voltage gain with feedback\n", + "Rof=Ro/(1+B*AV)\n", + "print \"Rof=Ro/(1+B*AV) =%0.2f\"%(Rof),\" ohm\" #output resistance with feedback\n", + "Rif=Ri*(1+B*AV)\n", + "print \"Rif=Ri/(1+B*AV) =%0.2e\"%(Rif),\" ohm\" #Input resistance with feedback\n", + "Ap=(AVf**2)*(Rif/RL)\n", + "print \"Ap=(AVf**2)*(Rif/RL)=%0.2e\"%(Ap) # Overall Power gain \n", + "AP=10*log10(Ap)\n", + "print \"AP=10*log10(Ap)=%0.2f\"%(AP),\"dB\" # Overall Power gain in dB " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7_10 Page No. 220" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gm = 0.01 A/V\n", + "Cgs= 5.00e-12 farad\n", + "Cds= 1.00e-12 farad\n", + "rd= 50000.00 ohm\n", + "RG= 1.00e+07 ohm\n", + "Rse= 1.00e+03 ohm\n", + "L= 0.50 H\n", + "C2= 5.00e-14 farad\n", + "C1= 1.00e-12 farad\n", + "part(i)\n", + "CT= 0.00 farad\n", + "part(ii)\n", + "fo= sqrt(2)/(2*pi*sqrt(L*CT))=1.44e+06 Hz\n", + "part(iii)\n", + "fp= 1.03e+06 Hz\n", + "fs= 1.01e+06 Hz\n", + "Q=(sqrt(L/C2))/(Rse)= 3162.28\n", + "part(iv)\n", + "AB=gm*rd*(Cds/Cgs)= 100.00\n", + "T_bias=RG*(Cgs+Cds)= 6.00e-05 s\n", + "T_r =1/(2*pi*fo)= 1.10e-07 s\n", + "for proper operation T_bias >> T_r\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,log10\n", + "from __future__ import division \n", + "gm=10*10**(-3)\n", + "print \"gm = %0.2f\"%(gm),\" A/V\"# transconductance \n", + "Cgs=5*10**(-12)\n", + "print \"Cgs= %0.2e\"%(Cgs),\" farad\" # capacitance between gate-source\n", + "Cds=1*10**(-12)\n", + "print \"Cds= %0.2e\"%(Cds),\" farad\" # capacitance between drain-source\n", + "rd=50*10**(3)\n", + "print \"rd= %0.2f\"%(rd),\" ohm\" #Drain resistance\n", + "RG=10*10**(6)\n", + "print \"RG= %0.2e\"%(RG),\" ohm\" #Gate resistance\n", + "Rse=1*10**(3)\n", + "print \"Rse= %0.2e\"%(Rse),\" ohm\" #Gate resistance\n", + "L=0.5\n", + "print \"L= %0.2f\"%(L),\" H\" #Inductance\n", + "C2=0.05*10**(-12)\n", + "print \"C2= %0.2e\"%(C2),\" farad\" # Crystal parameter \n", + "C1=1*10**(-12)\n", + "print \"C1= %0.2e\"%(C1),\" farad\" # Crystal parameter\n", + "print \"part(i)\" \n", + "x=C1+((Cds*Cgs)/(Cds+Cgs))\n", + "CT=1/((1/C2)+(1/x))\n", + "print \"CT= %0.2f\"%(CT),\" farad\" # Equivalent series-resonating capacitance\n", + "print \"part(ii)\" \n", + "fo=sqrt(2)/(2*pi*sqrt(L*CT))\n", + "print \"fo= sqrt(2)/(2*pi*sqrt(L*CT))=%0.2e\"%(fo),\" Hz\"# frequency of oscillations\n", + "print \"part(iii)\"\n", + "z=sqrt((L*C1*C2)/(C1+C2))\n", + "fp=1/(2*pi*z)\n", + "print \"fp= %0.2e\"%(fp),\" Hz\"# parallel-resonant frequency\n", + "p=sqrt(L*C2)\n", + "fs=1/(2*pi*p)\n", + "print \"fs= %0.2e\"%(fs),\" Hz\"# series-resonant frequency\n", + "Q=(sqrt(L/C2))/(Rse)\n", + "print \"Q=(sqrt(L/C2))/(Rse)= %0.2f\"%(Q) #Quality factor\n", + "print \"part(iv)\"\n", + "AB=gm*rd*(Cds/Cgs)\n", + "print \"AB=gm*rd*(Cds/Cgs)= %0.2f\"%(AB) #Loop gain\n", + "T_bias=RG*(Cgs+Cds)\n", + "print \"T_bias=RG*(Cgs+Cds)= %0.2e\"%(T_bias),\"s\"#Bias Time-Constant\n", + "T_r = 1/(2*pi*fo)\n", + "print \"T_r =1/(2*pi*fo)= %0.2e\"%(T_r),\"s\"#resonant Time-Constant for 'fo'\n", + "print \"for proper operation T_bias >> T_r\"\n", + "\n", + "\n", + "# in part (ii)... value calculated for series resonant frequecy 'fo' is wrong in textbook.\n", + "# NOTE: in part(iii)... there is a misprint in the calculated value of Quality factor 'Q' in the textbook.\n", + "#I have used T_r instead of 1/wo (given in the book)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |