diff options
Diffstat (limited to 'Modern_Communication_Circuits_by_J_R_Smith')
12 files changed, 2939 insertions, 0 deletions
diff --git a/Modern_Communication_Circuits_by_J_R_Smith/1-Introduction_to_Radio_Communication_System.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/1-Introduction_to_Radio_Communication_System.ipynb new file mode 100644 index 0000000..fbd8083 --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/1-Introduction_to_Radio_Communication_System.ipynb @@ -0,0 +1,84 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1: Introduction to Radio Communication System" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.3: IRCS_Ex_1_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 1:Introduction to Radio Communication\n", +"//example 1.3 page no 3\n", +"//given\n", +"disp('The transfer function has no finite zeros ')\n", +"p=poly([1 0.5 1],'s','c')\n", +"x=roots(p)\n", +"disp('The poles ')\n", +"disp(x)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.4: IRCS_Ex_1_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 1:Introduction to Radio Communication Systems\n", +"//example 1.4 page no 8\n", +"//given\n", +"fIF=455*10^3//intermediate frequency\n", +"fO=1.455*10^6//oscillator frequency\n", +"fIM=fIF+fO//image frequency\n", +"mprintf('the image frequency is %f MHz',fIM*1e-6)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Modern_Communication_Circuits_by_J_R_Smith/10-Frequency_Synthesizers.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/10-Frequency_Synthesizers.ipynb new file mode 100644 index 0000000..4abacfa --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/10-Frequency_Synthesizers.ipynb @@ -0,0 +1,190 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 10: Frequency Synthesizers" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.11: FS_Ex_10_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 10:Frequency Synthesizers\n", +"//Example 10.11 page no 446\n", +"disp('A signal sideband power is -140dB/Hz ')\n", +"N=5*10^6//frequency of reference oscillator \n", +"M=5*10^3//count\n", +"No=-140+10*log10((N/M)^2)//the output noise power due to the reference oscillator \n", +"mprintf('The single sideband noise power at a frequency offset of 0.5KHz is %d dB/Hz ',No)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.3: FS_Ex_10_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 10:Frequency Synthesizers\n", +"//Example 10.3 page no 416\n", +"fr=1*10^6//reference frequency\n", +"f=100*10^6//given frequency\n", +"fi=1*10^6//increment in frequency\n", +"Dmin=fr*f/fi\n", +"mprintf('The value of Dmin is %d Hz',Dmin)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.4: FS_Ex_10_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 10:Frequency Synthesizers\n", +"//Example 10.4 page no 417\n", +"fo=185.6*10^6//required output frequency\n", +"fr=31.25*10^3//reference frequency\n", +"P=64\n", +"disp('To begin with the hopping bin channel spacing requirement of at least 20KHz,a 2MHz crystal is connected to the MC14512-2 with the reference address inputs(pins 4,5,6) connected such that the crystal is divided by 64(RA2=0,RA1=0,RA0=1) This gives a reference frequency of 31.25KHz; and the maximum number of hops is 5.2MHz/31.25KHz=166.4hops FOr 185.6MHZ the values of N and A are found as follows:')\n", +"N=(fo/fr)/P//finding N for A=0\n", +"disp('For this value of N,find A by ')\n", +"A=(fo/fr)-92*P\n", +"mprintf('N = %d \n A = %d ',N,A)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.5: FS_Ex_10_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 10:Frequency Synthesizers\n", +"//Example 10.5 page no 426\n", +"fr=100*10^3//reference frequency\n", +"f=10*10^6//given frequency\n", +"fi=1*10^3//increment in frequency\n", +"fo=fr*f/fi//required VCO operating frequency\n", +"mprintf('The value of VCO operating frequency is %3.2e Hz',fo)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.7: FS_Ex_10_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 10:Frequency Synthesizers\n", +"//Example 10.7 page no 429\n", +"N=4\n", +"M=1.8//count\n", +"fr=100*10^3//reference frequency\n", +"fo=fr*(N+M^-1)//output frequency\n", +"mprintf('The value of output frequency is %3.2e Hz',fo)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.8: FS_Ex_10_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 10:Frequency Synthesizers\n", +"//Example 10.8 page no 429\n", +"N=100\n", +"M=10//count\n", +"fr=10*10^3//reference frequency\n", +"fo=fr*(N+M^-1)//output frequency\n", +"mprintf('The value of output frequency is %f Hz',fo)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Modern_Communication_Circuits_by_J_R_Smith/11-Power_Amplifiers.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/11-Power_Amplifiers.ipynb new file mode 100644 index 0000000..275d887 --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/11-Power_Amplifiers.ipynb @@ -0,0 +1,236 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11: Power Amplifiers" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.1: PA_Ex_11_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 11:Power amplifiers\n", +"//example 11.1 page no 456\n", +"//given\n", +"Po=5//max power in watts\n", +"Rl=50//load resistance in ohm\n", +"Vp=sqrt(2*5*50)//peak voltage across Rl\n", +"Vcc=24//supply voltage\n", +"Ip=Vp/Rl//peak current corresponding to Vp\n", +"Iq=Vcc/50//Q point current value\n", +"Pcc=Vcc*Iq//power supplied\n", +"Eff=(Po/Pcc)*100//efficiency\n", +"mprintf('peak voltage across Rl is %f V \n the peak current is %f A \n the power supplied is %f W \n the efficiency is %f ',Vp,Ip,Pcc,Eff)\n", +"disp('the transistor that is selected must be able to dissipate 11.52W in case the input power drops to zero and the transistor Vce breakdown voltage must be at least 48V(2*Vcc)')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.2: PA_Ex_11_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 11:Power amplifiers\n", +"//example 11.2 page no 466\n", +"//given\n", +"Po=5//max power in watts\n", +"Rl=50//load resistance in ohm\n", +"//asumme'1:1 truns ratio transformer coupled push pull amplifier each supllying 2.5 watt'\n", +"disp('since a push pull amplifier is used, each class B amplifier will supply 2.5W')\n", +"Pomax=2.5\n", +"Vcc=sqrt(4*Rl*Po)//supply voltage\n", +"Ptmax=Pomax*(4/%pi^2)//maximum power handling requriment of the transistor\n", +"I=sqrt((4*Pomax)/Rl)//peak output current\n", +"mprintf('maximum power handling requriment of the transistor is %d W \n peak output current is %f A ',Ptmax,I)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.3: PA_Ex_11_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 11:Power amplifiers\n", +"//example 11.2 page no 474\n", +"//given\n", +"Po=5//max power in watts\n", +"Rl=50//load resistance in ohm\n", +"f=1e6//operating frequency in hertz\n", +"Vcc=sqrt(2*Rl*Po)\n", +"Ptmax=0.1*Po//allowable power dissipation\n", +"I_m=0.5\n", +"Im=(2*%pi*Vcc*I_m)/Rl//peak collector current\n", +"mprintf('required supply voltage is %f V \n max allowable power dissipation is %f W \n peak collector current is %f A',Vcc,Ptmax,Im)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.4: PA_Ex_11_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 11:Power amplifiers\n", +"//example 11.4 page no 475\n", +"//given\n", +"Pt=4//max power dissipation in watt\n", +"Idmax=1.5//max drain current in amp\n", +"Vcc=48//supply voltage\n", +"P_t=(4*%pi*Pt)/(Vcc*Idmax)//the normalised max transistor dissipation\n", +"disp('from figure 11.21 it is found that maximum possible conduction angle is =80degree without exceeding the maximum transistor dissipation')\n", +"Po=Pt/0.22//output power\n", +"Rl=Vcc^2/(2*Po)//load resistance\n", +"mprintf('the output power is %f W \n the load resistance is %f ohm ',Po,Rl)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.5: PA_Ex_11_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 11:Power amplifiers\n", +"//example 11.5 page no 477\n", +"//given\n", +"disp('from the figure 11.23 it is seen that the amplitude of the fourth harmonic has a maximum value for a conduction angle 2theta of approximately 60degree The output circuit would be tuned to the fourth harmonic of the input signal')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.6: PA_Ex_11_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 11:Power amplifiers\n", +"//example 11.6 page no 479\n", +"//given\n", +"Po=20//power delivered in watt\n", +"Rl=50//load resistance\n", +"Vcc=sqrt(%pi^2*Rl*Po/8)//suppy volatage\n", +"Idc=4*Vcc/(Rl*%pi^2)//direct current in each transistor\n", +"mprintf('the suppy volatage is %f V \n the direct current in each transistor is %f A',Vcc,Idc)\n", +"disp('the maximum voltage drop across each transistor will be 2Vcc,or 70.2V the load circuit would be tuned to resonant at the fundamental frequency of the input signal')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.7: PA_Ex_11_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 11:Power amplifiers\n", +"//example 11.7 page no 480\n", +"//given\n", +"Vg=8//get signal level for VMOS 2N6659\n", +"Rl=50//load resistance in ohms(it should have been given in the problem but its missing)\n", +"disp('The specification sheet for the 2N6659 indicates that yhe on resisitance is approximately 2 ohm for this drive level')\n", +"Ron=2\n", +"Poideal=20\n", +"Po=Poideal*((Rl/(Rl+Ron))^2)//actual output power\n", +"Eff=Rl*100/(Rl+Ron)//Efficiency\n", +"mprintf('actual output power is %f W \n the Efficiency is %f ',Po,Eff)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Modern_Communication_Circuits_by_J_R_Smith/12-Modulators_and_Demodulators.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/12-Modulators_and_Demodulators.ipynb new file mode 100644 index 0000000..543f16f --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/12-Modulators_and_Demodulators.ipynb @@ -0,0 +1,87 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12: Modulators and Demodulators" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.2: MD_Ex_12_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 12:Frequency mixers\n", +"//example 12.2 page no 504\n", +"//given\n", +"gm=14*10^-3//tranconductance\n", +"IDSS=40*10^-3\n", +"RL=50//load resistance\n", +"Vgs=0\n", +"Vp=2*IDSS/gm//pinch off voltage\n", +"gc=IDSS/(2*Vp)//conversion tranconductance\n", +"Av=gc*RL//voltage gain\n", +"mprintf('the conversion voltage gain is %f ',Av)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4: MD_Ex_12_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 12:Frequency mixers\n", +"//example 12.4\n", +"//given\n", +"f=1*10^3//maximum frequency of unknown signal\n", +"df=1//maximum error in signal\n", +"fs=f^2/df//sampling frequency\n", +"disp(fs,'the required sampling frequency is')" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Modern_Communication_Circuits_by_J_R_Smith/2-Small_Signal_Amplifiers.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/2-Small_Signal_Amplifiers.ipynb new file mode 100644 index 0000000..f9c228a --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/2-Small_Signal_Amplifiers.ipynb @@ -0,0 +1,428 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: Small Signal Amplifiers" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.10: SSA_Ex_2_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.10 page no 51\n", +"//given\n", +"Z1=1*10^3//asumming impedance value for required specification\n", +"Av=-50//voltage gain\n", +"Zf=-Av*Z1//feedback impedance\n", +"mprintf('Z1=%d K ohm \n feedback impedance (Zf)= %d K ohm',Z1*1e-3,Zf*1e-3)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.11: SSA_Ex_2_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.11 pag no 51\n", +"//given\n", +"wL=10^6//bandwidth\n", +"R1=1*10^3//taking resistance value for required specification\n", +"Av=-50//voltage gain\n", +"Rf=-Av*R1//feedback resistance\n", +"C=(wL*Rf)^-1//capacitance\n", +"mprintf('R1=%d K ohm \n feedback resistance= %d K ohm \n capacitance= %d pF',R1*1e-3,Rf*1e-3,C*1e12)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.12: SSA_Ex_2_12.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.12 page no 53\n", +"//given\n", +"Aa=10^4//open loop gain\n", +"Rf=10^4//feedback resistance\n", +"Ri=100//input resistance\n", +"Av=-(Rf/Ri)/(1+(Ri+Rf)*(Aa*Ri))//actual amplifier gain\n", +"disp(Av,'the actual amplifier gain is ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.13: SSA_Ex_2_13.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Bipolar transistor amplifiers\n", +"//example 2.13 page no 53\n", +"//given\n", +"G=90//low frequency gain in dB\n", +"Ao=(G/20)//low frequency open loop gain\n", +"wT=150*10^6//gain bandwidth product\n", +"wo=wT/Ao//bandwidth\n", +"disp('the transfer function is')\n", +"disp('Av=3.16*e4/(1+jw/(2*pi*4.7*e3))')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.14: SSA_Ex_2_14.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.14 page no 57\n", +"//given\n", +"Z1=1*10^3//assuming impedance value for required specification\n", +"Av=100//voltage gain\n", +"Z2=(Av-1)*Z1\n", +"mprintf('Z1=%d Kohm \n Z2=%d Kohm',Z1*1e-3,Z2*1e-3)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1: SSA_Ex_2_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.1 page no 17\n", +"//given\n", +"B=100//current gain\n", +"Ic=10^-3//collector bias current\n", +"//kT/q=0.026 where as k=Boltzmanns constant T=temperature q=charge on an electron\n", +"rpi=(0.026*B)/Ic//base emitter resistance\n", +"mprintf('the base emitter resistance is %d ohm',rpi)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2: SSA_Ex_2_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.2 page no 22\n", +"//given\n", +"Ic=10^-3//collector bias current\n", +"B=100//current gain\n", +"RL=4*10^3//load resistance\n", +"Rs=50//source resistance\n", +"gm=40*Ic//transconductance\n", +"rpi=B/gm//base emitter resistance\n", +"Av=(B*RL)/(rpi+Rs*(1+B))//voltage gain\n", +"disp(Av,'the voltage gain is ')\n", +"Ai=B/(1+B)//current gain\n", +"disp(Ai,'the current gain is ')\n", +"Zi=1/gm//input impedance\n", +"mprintf('the input impedance is %d ohm',Zi)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3: SSA_Ex_2_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.3 page no 25\n", +"//given\n", +"Ic=40*10^-3//collector bias current\n", +"B=40//current gain\n", +"RL=50//load resistance\n", +"Rs=50//source resistance\n", +"rpi=(0.026*B)/Ic//base emitter resistance\n", +"Av=(B*RL)/(rpi+Rs+(1+B)*RL)//voltage gain\n", +"Ai=(1+B)//current gain\n", +"Ap=Ai*Av//power gain\n", +"mprintf('the power gain is %f \n',Ap)\n", +"Zo=(rpi+Rs)/(1+B)//output impedance\n", +"mprintf('the amplifier output impedance as per seen by 50 ohm \nresistance is %f ohm',Zo)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4: SSA_Ex_2_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.4 page no 30\n", +"//given\n", +"VDS=15\n", +"IDSS=8*10^-3\n", +"gmo=4*10^-3\n", +"rd=13*10^3\n", +"ID=2*10^-3//drain current\n", +"Vs=0//source is grounded Vgs=Vg-Vs=Vi\n", +"RL=2*10^3//load resistance\n", +"R_L=(RL*rd)/(RL+rd)//equivalent load resistance\n", +"gm=gmo*sqrt(ID/IDSS)//transconductance\n", +"Av=-gm*R_L//voltage gain Av=Vo/Vi=-gm*R_L\n", +"mprintf('the midband voltage gain is %f ',Av)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.5: SSA_Ex_2_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.5 page no 32\n", +"//given\n", +"gm=60*10^-3//transconductance\n", +"Si=50//antenna source impedance\n", +"rd=2.5*10^3\n", +"Zo=rd/(1+gm*rd)//output impedance without load\n", +"RL=200//load resistance\n", +"zo1=200*Zo/(200+Zo)//output impedance with load\n", +"Av=gm*(rd*RL/rd+RL)/(1+gm*(rd*RL/rd+RL))//voltage gain\n", +"mprintf('the voltage gain is %f ',Av)\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.6: SSA_Ex_2_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.6 page no 36\n", +"//given\n", +"RL=50//load resistance\n", +"gm=0.2//tranceconductance\n", +"B=100//current gain\n", +"rpi=B/gm//transistor input resistance\n", +"disp(rpi,'the transistor input resistance is ')\n", +"disp('The load resistance seen bythe first stage will be the 2k ohm resistor in parallel with Rb2 and the input impedance of the second stage That is R_L=1.05*10^3')\n", +"R_L=1.05*10^3\n", +"Rs=500//source resistance\n", +"IC1=2*10^-3//collector bias current\n", +"gm1=40*IC1//tranceconductance\n", +"disp(gm1,'the tranceconductance is in ohm ')\n", +"rpi1=B/gm1//transistor input resistance\n", +"disp(rpi1,'the transistor input resistance is in ohm ')\n", +"Av1=-gm1*R_L*(rpi1/(rpi1+Rs))//the voltage gain of first \n", +"disp(Av1,'the voltage gain of second stage is closed to unity the voltage gain of first is ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.8: SSA_Ex_2_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.8 page no 42\n", +"//given\n", +"disp('Assuming Vi (input voltage)=1')\n", +"V1=(5+10^6)/(5+2*10^6)//voltage on the positive terminal\n", +"V2=10^6/(5+2*10^6)//the voltage on the inverting terminal\n", +"ed=V1-V2//differential voltage\n", +"ec=(V1+V2)/2//common-mode voltage\n", +"Ad=2*10^3//differentail gain\n", +"Ac=2*10^-3//common mode gain (here 20% of differentail gain)\n", +"Vo=Ad*ed+Ac*ec//actual amplifier output\n", +"mprintf('the voltage gain is %3.2e Volts',Vo)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.9: SSA_Ex_2_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 2:Small Signal Amplifiers\n", +"//example 2.9 page no 45\n", +"//given\n", +"ed=5*10^-3//differential voltage\n", +"ec=2.5*10^-3//common-mode voltage\n", +"gm=1.5*10^-3//tranceconductance\n", +"rd=500*10^3\n", +"Rs=150*10^3//source resistance\n", +"RL=10*10^3//load resistance\n", +"Ac=-gm*RL/(1+2*gm*Rs)//common mode gain \n", +"Ad=gm*RL/2//differential gain\n", +"Vo=ec*Ac+ed*Ad//actual amplifier output\n", +"mprintf('the output to the applied signal is %f mV',Vo*1e3)\n", +"" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Modern_Communication_Circuits_by_J_R_Smith/3-Network_Noise_and_Intermodulation_Distortion.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/3-Network_Noise_and_Intermodulation_Distortion.ipynb new file mode 100644 index 0000000..9fbf2bf --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/3-Network_Noise_and_Intermodulation_Distortion.ipynb @@ -0,0 +1,390 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: Network Noise and Intermodulation Distortion" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.10: NNID_Ex_3_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Design of low noise networks\n", +"//example 3.10 page no 86\n", +"//given\n", +"ensqr=8*10^-16//noise voltage\n", +"insqr=9*10^-25//rms noise current\n", +"Rs=10*10^4//sourse resistance\n", +"k=1.37*10^-23//Boltzmmans constant\n", +"T=290//tempreture\n", +"F=(ensqr+(insqr*Rs^2))/(4*k*T*Rs)//amplifier noise factor\n", +"disp(F,'the amplifier noise factor is ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.11: NNID_Ex_3_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Network noise and intermodulation distortion\n", +"//example 3.11 page no 88\n", +"//given\n", +"ensqr=8*10^-16//noise voltage\n", +"insqr=9*10^-25//rms noise current\n", +"Rs=sqrt(ensqr/insqr)//sourse resistance\n", +"k=1.38*10^-23//Boltzmmans constant\n", +"T=290//tempreture\n", +"F=(ensqr+insqr*Rs^2+4*k*T*Rs)/(4*k*T*Rs)//amplifier noise factor\n", +"NF=10*log10(F)//noise figure\n", +"mprintf('the minimum minimum noise figure is %f dB',round(NF*10)/10)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.12: NNID_Ex_3_12.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Network noise and intermodulation distortion\n", +"//example 3.12 page no 89\n", +"//given\n", +"ensqr=8*10^-16//noise voltage\n", +"insqr=9*10^-25//rms noise current\n", +"Rs=9.42*10^3//sourse resistance\n", +"k=1.38*10^-23//Boltzmmans constant\n", +"T=290//tempreture\n", +"N=ensqr+insqr*Rs^2+4*k*T*Rs//total noise\n", +"disp(N,'the total noise is ')\n", +"disp('If the sourse resistance is zero,the total noise is ')\n", +"disp('N=ensqr=8*10^-16')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.13: NNID_Ex_3_13.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Network noise and intermodulation distortion\n", +"//example 3.13 page no 96\n", +"//given\n", +"PI=20//intercept point in dBm\n", +"Pi=0//input signal power dBm\n", +"PIMR=-2*PI//intermodulation distortion ratio (by the rules of logaritham as values are already given in dBm)\n", +"mprintf('the intermodulation distortion ratio is %d dB',PIMR)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.14: NNID_Ex_3_14.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Network noise and intermodulation distortion\n", +"//example 3.14 page no 97\n", +"//given\n", +"PI=20//intercept point in dBm\n", +"Nf=-123//noise floor in dBm\n", +"DR=2/3*(PI-Nf)//dynamic range (by the rules of logarithms as value are already given in dBm)\n", +"mprintf('the dynamic range is %f dB',DR)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.3: NNID_Ex_3_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Network noise and intermodulation distortion\n", +"//example 3.3 page no 80\n", +"//given\n", +"NF1=2//first stage noise figure\n", +"NF2=6//second stage noise figure\n", +"F1=10^(NF1/10)//first stage noise factor\n", +"F2=10^(NF2/10)//second stage noise factor\n", +"G1=15.9//gain of first stage equivalent to 12dB\n", +"G2=10//gain of second stage equivalent to 10dB\n", +"F=F1+(F2-1)/G1//overall noise factor\n", +"NF=10*log10(F)//noise figure of the two-stage systemm\n", +"printf('the noise figure of the two-stage system is %f dB',round(NF*10)/10)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4: NNID_Ex_3_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Network noise and intermodulation distortion\n", +"//example 3.4 page no 81\n", +"//given\n", +"k=1.37*10^-23//boltzmann's onstant\n", +"T=290//operating tempreture\n", +"B=3*10^3//bandwidth\n", +"F=1.779//overall noise factor(from previous ex)\n", +"G1=15.9//gain of first stage(from previous ex)\n", +"G2=10//gain of second stage(from previous ex)\n", +"Ni_Na=F*k*T*B//noise at the input (addition of Ni and Na)\n", +"No=G1*G2*(Ni_Na)//the output noise\n", +"mprintf('the output noise is %3.2e W',No)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5: NNID_Ex_3_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Network noise and intermodulation distortion\n", +"//example 3.5 page no 82\n", +"//given\n", +"F=1.6//noise factor\n", +"T=290//referance temperture\n", +"Tr=(F-1)*T//system noise tempreture\n", +"mprintf('the system noise tempreture is %d K',Tr)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6: NNID_Ex_3_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Network noise and intermodulation distortion\n", +"//example 3.6 page no 82\n", +"//given\n", +"NF=8//noise figure in dB\n", +"B=2.1*10^3//bandwidth\n", +"Rs=50//sourse resistance\n", +"Si_dB=NF-144+log10(B)//available input power in dBm\n", +"Si_W=(10^(Si_dB/10))/10^3//available input power in W\n", +"Ei=sqrt(Si_W*4*Rs)//minimum detectable signal\n", +"mprintf('the minimum detectable signal is %f uV',round(Ei*1e6*100)/100)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7: NNID_Ex_3_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Network noise and intermodulation distortion\n", +"//example 3.7 page no 83\n", +"//given\n", +"NF=8//noise figure in dB\n", +"B=2.1*10^3//bandwidth\n", +"Rs=50//sourse resistance\n", +"Si_dB=NF-134+log10(B)//available input power in dBm\n", +"Si_W=(10^(Si_dB/10))/10^3//available input power in Watts\n", +"Ei=sqrt(Si_W*4*Rs)//minimum detectable signal\n", +"mprintf('the minimum detectable signal is %f uV',round(Ei*1e7*1000)/10000)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8: NNID_Ex_3_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Network noise and intermodulation distortion\n", +"//example 3.8 page no 83\n", +"//given\n", +"NF=4//noise figure in dB\n", +"B=3*10^3//bandwidth\n", +"Rs=50//sourse resistance\n", +"k=1.38*10^-23//Boltzmmans constant\n", +"T=290//tempreture\n", +"//For si of -125dBm the value of Ei is 0.245uV will produce a 10dB output to noise ratio. now consider the performance of this receiver when it is connected to an antenna with a noise figure of 20dB\n", +"N_ant=20//antenna noise figure\n", +"N_Fr=4//receiver noise figure\n", +"F_ant=10^(N_ant/10)//antenna noise factor\n", +"Fr=10^(N_Fr/10)//receiver noise factor\n", +"S_N=10//output signal to noise ratio\n", +"Si_W=(S_N)*(F_ant+Fr-1)*k*T*B//available input power in Watts\n", +"Ei=sqrt(Si_W*4*Rs)//minimum detectable signal\n", +"mprintf('the minimum detectable signal is %f uV',round(Ei*1e6*100)/100)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.9: NNID_Ex_3_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 3:Network noise and intermodulation distortion\n", +"//example 3.8 page no 84\n", +"//given\n", +"NF=4//noise figure in dB\n", +"B=3*10^3//bandwidth\n", +"Rs=50//sourse resistance\n", +"k=1.38*10^-23//Boltzmmans constant\n", +"T=290//tempreture\n", +"NFa=20//antenna noise figure\n", +"NFr=10//receiver noise figure\n", +"Fa=10^(NFa/10)//antenna noise factor\n", +"Fr=10^(NFr/10)//receiver noise factor\n", +"S_N=10//output signal to noise ratio\n", +"Si_W=(S_N)*(Fa+Fr-1)*k*T*B//available input power in Watts\n", +"Ei=sqrt(Si_W*4*Rs)//minimum detectable signal\n", +"mprintf('the minimum detectable signal is %f uV',round(Ei*1e6*10)/10)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Modern_Communication_Circuits_by_J_R_Smith/4-Frequency_Selective_Network_and_Transformers.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/4-Frequency_Selective_Network_and_Transformers.ipynb new file mode 100644 index 0000000..3334af2 --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/4-Frequency_Selective_Network_and_Transformers.ipynb @@ -0,0 +1,204 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4: Frequency Selective Network and Transformers" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1: FSNT_Ex_4_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 4:Frequency selective networks and transformers\n", +"//example 4.1 page no 108\n", +"//given\n", +"R=50//load resistance in ohm\n", +"B=100//bandwidth in KHz\n", +"Cf=5//filter center frequency in MHz\n", +"L=R/(2*%pi*10^5)//inductance in micro henry\n", +"C=((L)*(2*%pi*Cf*10^6)^2)^-1//capacitance\n", +"mprintf('the inductance is %f uH \n the capacitance is %f pF ',L*1e6,C*1e12)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.2: FSNT_Ex_4_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 4:Frequency selective networks and transformers\n", +"//example 4.2\n", +"//given\n", +"//Forty decibles corresponds to a voltage ratio of 100:1 therefore since A(jwo)=1\n", +"Ajwo=0.01\n", +"n=5//no. of harmonics\n", +"Q=n/(Ajwo*(n^2-1))//quality point\n", +"mprintf('the minimum circuit Q is =Qmin = %f ',Q)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3: FSNT_Ex_4_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 4:Frequency selective networks and transformers\n", +"//example 4.3 page no 115 \n", +"//given\n", +"L=10*10^-6//inductance\n", +"C=10*10^-12//capacitance\n", +"wo=(sqrt(L*C))^-1//resonant frequency(ignoring the finite resistance)\n", +"Q=100\n", +"rs=wo*L/Q//series resistance\n", +"Rp=(wo*L)^2/rs//parallel resistance\n", +"QL=50*10^3/(wo*L)//loaded Q\n", +"mprintf('the loaded Q is %f ',QL)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.4: FSNT_Ex_4_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 4:Frequency selective networks and transformers\n", +"//example 4.4 page no 121\n", +"//given\n", +"L1=25*10^-6//primary inductance\n", +"L2=400*10^-6//secondary inductane\n", +"n=(sqrt(L1/L2))//equivalent turns ratio\n", +"CT=(8+(2/n^2))*1e-12//total primary capacitance\n", +"RL=25*10^3//load resistance reflected to the primary\n", +"wo=(sqrt(L1*CT))^-1//resonant frequency\n", +"Q=RL/(wo*L1)//quality point\n", +"mprintf('the resonant frequency is %3.2e rad/s \n Q = %f',wo,Q)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.6: FSNT_Ex_4_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 4:Frequency selective networks and transformers\n", +"//example 4.6 paga no 130\n", +"//given\n", +"Rs=10//source resistance\n", +"L=0.2*10^-6//inductor \n", +"f=20*10^6//given frequency\n", +"XL=(2*%pi*f*L)//inductive reactance\n", +"Rp=50//input impedance\n", +"Xs=sqrt(Rp*Rs-Rs^2)//series reactance\n", +"Xcs=5.1//series capacitive reactance\n", +"CS=(2*%pi*f*Xcs)^-1//series capacitance\n", +"Xp=(Rs^2+Xs^2)/Xs//equivalent parallel reactance\n", +"mprintf('the value of series reactance is j%f ohm \n the value equivalent parallel reactance is j%f ohm ',Xs,Xp)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.7: FSNT_Ex_4_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 4:Frequency selective networks and transformers\n", +"//example 4.7 page no 132\n", +"//given\n", +"Rs=50//series resistance\n", +"Rp=100//parallel resistance\n", +"Xp=sqrt(Rs*Rp^2/(Rp-Rs))//equivalent parallel reactance\n", +"disp(Xp,'the equivalent parallel reactance in ohm is ')" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Modern_Communication_Circuits_by_J_R_Smith/5-High_Frequency_Amplifiers_and_Automatic_Gain_Control.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/5-High_Frequency_Amplifiers_and_Automatic_Gain_Control.ipynb new file mode 100644 index 0000000..1a3bdb4 --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/5-High_Frequency_Amplifiers_and_Automatic_Gain_Control.ipynb @@ -0,0 +1,510 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: High Frequency Amplifiers and Automatic Gain Control" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.10: HFAAGC_Ex_5_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.10 page no 178\n", +"//given\n", +"fp=10*10^6//upper corner frequency\n", +"n=2//no. of stages\n", +"f1=fp*sqrt(2^(1/n)-1)//overall bandwidth\n", +"disp('since each stage has a gain of 20dB,the overall low-frequency gain is 40dB ')\n", +"mprintf('the overall bandwidth is %f MHz',f1*1e-6)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.11: HFAAGC_Ex_5_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.11 page no 181\n", +"//given\n", +"rpi=237\n", +"CM=1166*10^-12//miller capacitance\n", +"Co=4*10^-12//equivalent miller capacitance reflected at output side\n", +"Rs=500//source resistance\n", +"RL=600//load resistance\n", +"Cs=rpi*CM/Rs//capacitance across source resistance\n", +"B=(RL*Co)^-1//total bandwidth\n", +"disp('the midfrequency voltage gain is -77.2')\n", +"mprintf('the total bandwidth is %3.2e rad/s \n the capacitance across source resistance is %3.2e F',B,Cs)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.12: HFAAGC_Ex_5_12.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.12\n", +"//given\n", +"B=10^7//amplifier bandwidth\n", +"Bf=10*B//closed loop bandwidth\n", +"disp('The closed loop gain has been reduced by 20dB (a factor of 10) so the banwidth increased proportionally')\n", +"mprintf('the closed-loop bandwidth is %3.2e rad/s',B)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.13: HFAAGC_Ex_5_13.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency amplifiers and automatic gain control\n", +"//Example 5.13 page no 184\n", +"//Example on emitter feedback\n", +"disp('The parallel combination of the two base biasing resistors is 2.66k ohm resistor. The parallel combination of this resistor and the 260ohm emitter resistance is 237ohm i.e.rpi=237ohm')\n", +"gm=0.4//transconductance\n", +"rpi=237//base emitter resistance\n", +"RL=600//load resistance (values of resistance are taken from the figure)\n", +"Rs=500//source resistance\n", +"Av=gm*RL*rpi/(rpi+Rs)//Voltage gain \n", +"B=0.84*10^6//Bandwidth (The value of Bandwidth is taken from the Graph firure 5.51)\n", +"GB=Av*B//Gain bandwidth product\n", +"mprintf('The gain bandwidth product is %3.2e Hz ',GB)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.14: HFAAGC_Ex_5_14.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency amplifiers and automatic gain control\n", +"//Example 5.14 page no 189\n", +"//Example on voltage to current feedback\n", +"gm=0.4//transconductance\n", +"RL=600//load resistance\n", +"Rs=500//source resistance (refer figure 5.54)\n", +"disp('Av=-gm*RL/(1+gf*RL+gm*RL*(Rs/RF))')//Voltage gain \n", +"disp('GB=Av*B')\n", +"disp('The gain bandwidth product varies from a low of 59.5*10^6 Hz for a gain of unity 265.1*10^6 Hz for a closed loop gain of 17.9 ')//(refer figure 5.55)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.15: HFAAGC_Ex_5_15.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency amplifiers and automatic gain control\n", +"//Example 5.15 page no 193\n", +"disp('Gain bandwidth product of a common base amplifier with lossless feedback ')\n", +"//All the Bandwidth values are taken by graph\n", +"m1=0//i.e. for no turns ratio \n", +"Av1=1//for no turns ratio voltage gain is approx unity \n", +"B1=79.4*10^6//bandwidth\n", +"GB1=Av1*B1//Gain bandwidth product\n", +"m2=4//i.e. for turns ratio is 4\n", +"Av2=m2/2//voltage gain\n", +"B2=11.22*10^6//bandwidth\n", +"GB2=Av2*B2//Gain bandwidth product\n", +"m3=6//i.e. for turns ratio is 6\n", +"Av3=m3/2//voltage gain \n", +"B3=4.67*10^6//bandwidth\n", +"GB3=Av3*B3//Gain bandwidth product\n", +"m4=10//i.e. for turns ratio is 10\n", +"Av4=m4/2//voltage gain \n", +"B4=1.6*10^6//bandwidth\n", +"GB4=Av4*B4//Gain bandwidth product\n", +"m5=20//i.e. for turns ratio is 20\n", +"Av5=m5/2//voltage gain \n", +"B5=4.22*10^5//bandwidth\n", +"GB5=Av5*B5//Gain bandwidth product\n", +"disp('The Gain Bandwidth product in Hz')\n", +"mprintf('GB1 = %3.2e \n GB2 = %3.2e \n GB3 = %3.2e \n GB4 = %3.2e \n GB5 = %3.2e ',GB1,GB2,GB3,GB4,GB5)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.18: HFAAGC_Ex_5_18.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.18\n", +"//given\n", +"Vr=1//reference voltage\n", +"Vc=0.5\n", +"Vo=Vr-Vc//output voltage\n", +"Vi=Vo/Vc^2//input voltage\n", +"mprintf('the dc voltage as function of input voltage is %d V',Vi)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1: HFAAGC_Ex_5_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.1 page no 147\n", +"//given\n", +"B=100\n", +"fT=3*10^8//transistor frequency\n", +"Cu=4*10^-12//output capacitance common baxe configuration\n", +"Ic=10*10^-3//collector direct current\n", +"rpi=0.026*B/Ic//base emitter resistance\n", +"gm=40*Ic//transconductance\n", +"wT=0.4/(2*%pi*3*10^8)//gain bandwidth product\n", +"Cpi=wT-Cu//base emitter capacitance\n", +"mprintf('the base emitter resistance is %d ohm \n the transconductance is %f S \n the base emitter capacitance is %3.2e pF',rpi,gm,Cpi)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2: HFAAGC_Ex_5_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.2 page no 148\n", +"//given\n", +"wT=3*10^8//gain bandwidth product\n", +"w=10*10^6//given frequency\n", +"Ai=wT/w//short circuit current gain\n", +"mprintf('the short circuit current gain is %d ',Ai)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3: HFAAGC_Ex_5_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.3 page no 153\n", +"//given\n", +"gm=2*10^-3//transconductance\n", +"Cgs=5*10^-12//equivalent Miller's input capacitance\n", +"Cgd=1*10^-12//equivalent Miller's output capacitance\n", +"Cds=1*10^-12\n", +"rd=13*10^3\n", +"R=5*10^3//source resistance\n", +"RL=(6*10^3*13*10^3)/(6*10^3+13*10^3)//total load resistance\n", +"Av=-gm*RL//voltage gain\n", +"R_L=RL*rd/(RL+rd)\n", +"CT=Cgs+Cgd*(1+gm*R_L)//total capacitance\n", +"Co=Cds+(Cgd*(1+gm*R_L)/(gm*R_L))//output capacitance\n", +"w1=(R*CT)^-1//pole due to input circuit\n", +"w2=(RL*Co)^-1//pole due to output circuit\n", +"mprintf('the voltage gain is %f \n the total capacitance is %3.2e pF \n the output capacitance is %3.2e pF \n the pole due to input circuit is %3.2e rad/s \n the pole due to output circuit is %3.2e rad/s ',Av,CT,Co,w1,w2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4: HFAAGC_Ex_5_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.4 page no 155\n", +"//given\n", +"gm=2*10^-3//transconductance\n", +"Cgs=5*10^-12//equivalent Miller's input capacitance\n", +"Cgd=10^-12//equivalent Miller's output capacitance\n", +"Cds=10^-12\n", +"R=5*10^3\n", +"R_L=4.1*10^3\n", +"wz=2*10^9\n", +"CT=Cgs+Cgd*(1+gm*R_L)//total capacitance\n", +"Co=Cds+(Cgd*(1+gm*R_L)/(gm*R_L))//output capacitance\n", +"w1=(R*CT)^-1//pole due to input circuit\n", +"w2=(R_L*Co)^-1//pole due to output circuit\n", +"mprintf('the transfer function is found to be located at %3.2e rad/s \n the pole due to input circuit is %3.2e rad/s \n the pole due to output circuit is %3.2e rad/s ',wz,w1,w2)\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.5: HFAAGC_Ex_5_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.5 page no 157\n", +"//given\n", +"gm=0.4//transconductance\n", +"rpi=260\n", +"Re=237//emitter resistance\n", +"RL=600//load resistance\n", +"Rs=500//source resistance\n", +"Vi=1//input voltage(asumme Vi=1)\n", +"R=rpi*Rs/(rpi+Rs)\n", +"Vo=-gm*RL*Re/(Re+Rs)//output voltage\n", +"Cgs=960*10^-12//equivalent Miller's input capacitance\n", +"Ci=206*10^-12//input capacitance\n", +"CT=Cgs+Ci//total capacitance\n", +"Co=4*10^-12//output capacitance\n", +"w1=(R*CT)^-1//pole due to input circuit\n", +"w2=(RL*Co)^-1//pole due to output circuit\n", +"disp('The high-frequency performance is determined by the input circuit The upper -3dB frequency of this amplifier is equal to w1')\n", +"mprintf('the upper 3dB frequency is %3.2e rad/s ',w1)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.6: HFAAGC_Ex_5_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.5 page no 159\n", +"//given\n", +"s=poly(0,'s')\n", +"Vo=-(0.4-s*4*10^-12)*(966*10^3)\n", +"Vth=s^2*(79.6*10^-18)+s*(190.2*10^-9)+1\n", +"disp(Vo/Vth,'the transfer function is ')\n", +"wz=10^11//transfer function zero\n", +"w1=-5.5*10^6//pole due to input circuit\n", +"w2=-2.41*10^9//pole due to output circuit\n", +"mprintf('the transfer function zero is found to be located at %3.2e rad/s \n the pole due to input circuit is %3.2e rad/s \n the pole due to output circuit is %3.2e rad/s ',wz,w1,w2)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.7: HFAAGC_Ex_5_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.7 page no 162\n", +"//given\n", +"gm=0.4//transconductance\n", +"RL=600//load resistance\n", +"Rs=500//source resistance\n", +"Avec=gm*RL//midband emitter to collector voltage gain\n", +"CM=(1-Avec)*10^-12//miller capacitance\n", +"C_M=CM/Avec//collector to ground miller capacitance\n", +"Ri=gm^-1\n", +"Av=Avec*(Ri/Rs)//midfrequency voltage gain\n", +"Co=(4+1)*10^-12//output capacitance\n", +"CT=(206+CM)*10^-12//toatl capacitance\n", +"R=(500^-1+300^-1+260^-1)^-1\n", +"w1=(R*CT)^-1//pole due to input circuit)\n", +"w2=(RL*Co)^-1//pole due to output circuit\n", +"mprintf('the mid frequency voltage gain %f \n the pole due to input circuit is %3.2e rad/s \n the pole due to output circuit is %3.2e rad/s ',Av,w1,w2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.8: HFAAGC_Ex_5_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 5:High Frequency Amplifiers and Automatic Gain Control\n", +"//example 5.8 page no 166\n", +"//given\n", +"Rs=500//source resistance\n", +"rpi=260\n", +"gm=0.4//transconductance\n", +"RL=600//load resistance\n", +"cpi=206*10^-12\n", +"wp=(Rs+rpi+(1+gm*rpi)*RL)/(rpi*cpi*(Rs+RL))//pole at the lower frequency\n", +"wz=(1+gm*rpi)/(rpi*cpi)//pole at the zero frequency\n", +"mprintf('the pole at the lower frequency is %3.2e rad/s \n the pole pole at the zero frequency is %3.2e rad/s ',wp,wz)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Modern_Communication_Circuits_by_J_R_Smith/6-Hybrid_and_Transmission_Line_Transforms.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/6-Hybrid_and_Transmission_Line_Transforms.ipynb new file mode 100644 index 0000000..cd925b1 --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/6-Hybrid_and_Transmission_Line_Transforms.ipynb @@ -0,0 +1,62 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Hybrid and Transmission Line Transforms" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2: HTLT_Ex_6_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 6:Three winding transformer\n", +"//example 6.2 page no 221\n", +"//given\n", +"k=1\n", +"R=50//resistor\n", +"R1=R*k\n", +"R2=R\n", +"R3=100\n", +"R4=R1/(1+k)\n", +"N=sqrt(R1/(2*R3))//turns ratio \n", +"mprintf('the turns ratio %f \n R4=%d ',N,R4)\n", +"disp('the output voltage Eo= -I3.RL = E1/2')" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Modern_Communication_Circuits_by_J_R_Smith/7-Oscillators.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/7-Oscillators.ipynb new file mode 100644 index 0000000..6f1006f --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/7-Oscillators.ipynb @@ -0,0 +1,344 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7: Oscillators" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.11: Oscillators_Ex_7_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 7:Oscillators\n", +"//Example 7.11 page no 292\n", +"disp('In order to convert the input waveform from 87.5MHz to 10.7MHz the local oscillator would need to be 76.8MHz(low side injection) or 98.2MHz (high side injection).To convert the input waveform from 108.0MHz the local oscilltor would need to be 97.3MHz (low side injection) or 118.7MHz (high side injection) ')\n", +"L=0.05*10^-6//choosing value of indicator \n", +"f1=76.8*10^6//starting frequency\n", +"f2=97.3*10^6//ending frequency\n", +"C1=((1/(2*%pi*f1))^2)/L//Capacitor value for starting frequency\n", +"C2=((1/(2*%pi*f2))^2)/L//Capacitor value for ending frequency\n", +"mprintf('The value of C is varies batween %3.2e F to %3.2e F ',C1,C2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.1: Oscillators_Ex_7_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 7:Conditions for Oscillation\n", +"//example 7.1 page no 247\n", +"//given\n", +"B=100//current gain \n", +"f=20*10^6//oscillator frequency\n", +"VT=26*10^-3\n", +"Ic=1*10^-3//dc bias current\n", +"ri=VT/Ic//common base inout resistance\n", +"gm=ri^-1//transconductance\n", +"GH=3//In oscillator design the loop gain is usually selected to be about 3,which allow for some error in the approximation so that (C1+C2)/C1=3\n", +"C2=(2*%pi*f*8)^-1//second capacitor\n", +"C1=C2/2//first capacitor\n", +"Req=ri*((C1+C2)/C1)^2//equivalent resistor\n", +"L=(((2*%pi*f)^2)*((C1*C2)/(C1+C2)))^-1//inductor\n", +"mprintf('the value of second capacitor is %f pF \n the value of first capacitor is %f pF \n the value of equivalent resistor is %d ohm \n the value of indicator is %f uH',C2*1e12,C1*1e12,Req,L*1e6)\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.2: Oscillators_Ex_7_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 7:Conditions for Oscillation\n", +"//example 7.2 page no 251 \n", +"//given\n", +"B=100\n", +"f=5*10^6//oscillator frequency\n", +"L=10*10^-6//inductor\n", +"X=(L*(2*%pi*f)^2)^-1//Taking X=C1'*C2/(C1'+C2)\n", +"r=3.14//series resistance of inductor \n", +"C1=200*10^-12//first capacitor(asumming values of capacitors)\n", +"C2=200*10^-12//second capacitor\n", +"Y=(1+B)/(((2*%pi*f)^2)*C1*C2)\n", +"Z=L/C1\n", +"rpi=(Y-Z)*r^-1//resistance \n", +"gm=rpi^-1//transconductance\n", +"I=gm/40//bias current\n", +"mprintf('the equivalent capacitance is %3.2e pF \n the resistance value is %3.2e ohm \n the bias current is %3.2e A',X,rpi,I)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.3: Oscillators_Ex_7_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 7:Conditions for Oscillation\n", +"//example 7.3\n", +"//given\n", +"rpi=1000\n", +"C1=200*10^-12\n", +"r=3.14//series resistance\n", +"C_1=C1/(1+(r/rpi))//capacitance\n", +"\n", +"mprintf('the capacitor value is %f pF',round(C_1*1e12))" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.4: Oscillators_Ex_7_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 7:Conditions for Oscillation\n", +"//example 7.4 page no 255\n", +"//given\n", +"gm=6*10^-3\n", +"r=4\n", +"f=10^6\n", +"disp('Assume (w*Cm)^-1=X')\n", +"X=sqrt(r/gm)//minimum permissible reactance\n", +"Cm=(2*%pi*f*X)^-1//maximum series capacitance\n", +"mprintf('the minimum permissible reactance is %f ohm \n the maximum series capacitance is %f pF',X,Cm*1e12)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.5: Oscillators_Ex_7_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 7:Conditions for Oscillation\n", +"//example 7.5 page no 265\n", +"//given\n", +"Co=3.2//shunt capacitance\n", +"C1=0.008\n", +"k=Co/C1//ratio\n", +"fa=10^6//crystai's antiresonant frequency\n", +"fs=1+(2*k)^-1//series resonant frequency\n", +"mprintf('the series resonant frequency is %f MHz',fs)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.6: Oscillators_Ex_7_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 7:Conditions for Oscillation\n", +"//example 7.6 page no 265\n", +"//given\n", +"f=5.7*10^6//given frequency\n", +"Xs=4654//shunt reactance for shunt capacitacne of 6pF\n", +"r=25//series resistance\n", +"Q1=Xs/r//equivalent to crystal Q for easily expressing\n", +"C1=21*10^-15\n", +"XC1=(C1*2*%pi*f)^-1//capacitive reactance\n", +"disp('C1 is much smaller than the shunt capacitance,so the inductive reactance is XL=1.3*10^6')\n", +"Q=XC1/r//crystal Q\n", +"mprintf('the crystal Q is %d ',Q)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.7: Oscillators_Ex_7_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//chapter 7:Crystal Oscillator Characteristics\n", +"//Example 7.7 page no 266\n", +"//given\n", +"f=20*10^6//given frequency\n", +"//If the crystal load capacitnace is specified to be 32pF, then the series combination of C1 and C2 must be 32pF. this could be satisfied by using 64pF capacitors for both C1 and C2.\n", +"gm=1.5*10^-3//transconductance\n", +"C1=64*10^-12\n", +"C2=64*10^-12\n", +"r1=gm/((2*%pi*f)^2*C1*C2)//series resistance of the crystal\n", +"mprintf('The series resistnce is approximately %f ohm ',r1)\n", +"disp('In order for oscillations to occur, the loop gain must still be greater than 1')\n", +"G=gm*((2*%pi*f*C1)^-1)^2/r1//loop gain\n", +"disp(G,'loop gain is ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.8: Oscillators_Ex_7_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 7:Conditions for Oscillation\n", +"//example 7.8 page no 270\n", +"//given\n", +"fa=5.7*10^6//parallel antiresonant frequency\n", +"C1=21*10^-15\n", +"Co=37.1*10^-12//here 32pF is parallel with 5.1pF so they get added\n", +"CL=22*10^-12\n", +"f_a=fa*((1+C1/(2*(Co+CL)))/(1+C1/(2*Co)))//new parallel antiresonant frequency\n", +"r1=25\n", +"Rp=r1*(1+((r1*2*%pi*f_a*(Co+CL))^-1)^2)//equivalent parallel resistance\n", +"mprintf('the new parallel antiresonant frequency is %f MHz \n the equivalent parallel resistance is %f Kohm',f_a*1e-6,Rp*1e-3)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.9: Oscillators_Ex_7_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 7:Conditions for Oscillation\n", +"//example 7.9 page no 284\n", +"//given\n", +"rd=50*10^3\n", +"gm=5*10^-3//transconductance\n", +"f=16*10^6//frequency of oscillation\n", +"Rs=15\n", +"XC1=1*10^3//capacitive reactance of first capacitor\n", +"XC2=Rs/(gm*XC1)//capacitive reactance of second capacitor\n", +"C1=(2*%pi*f*XC1)^-1//value of first capacitor\n", +"C2=(2*%pi*f*XC2)^-1//value of second capacitor\n", +"mprintf('the value of first capacitor is %3.2e pF\n the value of second capacitor is %3.2e pF\n ',C1,C2)\n", +"disp('This value of C1 may be so small that the transistor output capacitance has a effect. therefore it is desirable to incease C1.If C1 is increased by a factor of 10,so that XC1=100,then C2 must also be increased ')\n", +"XC_2=Rs/(gm*100)//new value of reactance\n", +"XL=100+XC_2//inductive reactance\n", +"L=XL/(2*%pi*f)//value of inductor\n", +"mprintf('the value of inductor is %3.2e H',L)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Modern_Communication_Circuits_by_J_R_Smith/8-Phase_Locked_Loops.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/8-Phase_Locked_Loops.ipynb new file mode 100644 index 0000000..c9212e4 --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/8-Phase_Locked_Loops.ipynb @@ -0,0 +1,134 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Phase Locked Loops" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1: PLL_Ex_8_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 8:Linear model of phase locked loop\n", +"//example 8.1 page no 314\n", +"//given\n", +"fo=1*10^6//output frequency\n", +"fr=25*10^3//reference frequency\n", +"N=fo/fr\n", +"Kd=2//phase detector gain factor\n", +"Ko=100//VCO gain factor\n", +"thetao=(2*100*2*%pi)//output phase\n", +"s=poly(0,'s')\n", +"thetar=s+(2*100*2*%pi)/N//input phase\n", +"Tf=thetao/thetar\n", +"disp(Tf,'the closed loop transfer function is ')\n", +"Kv=Kd*Ko/N//bandwidth\n", +"mprintf('the synthesizer bandwidth will be %d Hz',Kv)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2: PLL_Ex_8_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 8:Linear model of phase locked loop\n", +"//example 8.2 page no 316\n", +"//given\n", +"zeta=0.707//damping ratio for butterworth filter\n", +"Kv=10*%pi//bandwidth\n", +"wL=Kv*(2*zeta)^2//low pass filter bandwidth\n", +"wn=sqrt(Kv*wL)//bandwidth of closed loop system \n", +"tr=2.2/wn//rise time\n", +"mprintf('low pass filter bandwidth is %f rad/s \n bandwidth of closed loop system is %f rad/s \n the system rise time is %3.2e s',wL,wn,tr)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4: PLL_Ex_8_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 8:Linear model of phase locked loop\n", +"//example 8.6 page no 349\n", +"//given\n", +"//The VCO is designed to oscillate at 100kHz\n", +"R1=10.8*10^3\n", +"R2=10.8*10^3\n", +"C=1*10^-9\n", +"N=2//order of filter\n", +"fmin=(R2*(C+32*10^-12))^-1//minimum frequency\n", +"fmax=fmin+(R1*(C+32*10^-12))^-1//maximum frequency\n", +"VDD=9//regulated power supply\n", +"Kvco=(2*%pi*(fmax-fmin))/(VDD-2)\n", +"Kv=Kvco*(VDD/%pi)/N\n", +"zeta=0.707//damping ratio for butterworth filter\n", +"wL=Kv*(2*zeta)^2//low pass filter bandwidth\n", +"wn=sqrt(Kv*wL)//bandwidth of closed loop system \n", +"mprintf('low pass filter bandwidth is %3.2e rad/s \n bandwidth of closed loop system is %3.2e rad/s',wL,wn)\n", +"thetao=(10.6*10^9)//output phase\n", +"s=poly(0,'s')\n", +"thetar=s^2+s*2.3*10^4+2.66*10^8//input phase\n", +"Tf=thetao/thetar\n", +"disp(Tf,'the closed loop transfer function is ')" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Modern_Communication_Circuits_by_J_R_Smith/9-Phase_Locked_Loop_Analysis.ipynb b/Modern_Communication_Circuits_by_J_R_Smith/9-Phase_Locked_Loop_Analysis.ipynb new file mode 100644 index 0000000..4e9a1be --- /dev/null +++ b/Modern_Communication_Circuits_by_J_R_Smith/9-Phase_Locked_Loop_Analysis.ipynb @@ -0,0 +1,270 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: Phase Locked Loop Analysis" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.1: PLLA_Ex_9_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//chapter 9: Stability Analysis\n", +"//Example 9.1 page no 357\n", +"//given\n", +"Kv=50//DC gain\n", +"wL=100//corner frequency\n", +"disp('The system crossover frequecny is approximately 50 rad/s')\n", +"PhaseMargin=90-(atan(50/wL)*180/%pi)//phase margin of system\n", +"disp('At this frequency the phase shift of the open loop transfer function is -112.5')\n", +"disp(PhaseMargin,'The phase margin is ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.2: PLLA_Ex_9_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//chapter 9: Stability Analysis\n", +"//Example 9.2 page no 357\n", +"//given\n", +"Kv=50//DC gain\n", +"wL=10//corner frequency\n", +"disp('The system crossover frequecny is approximately 22 rad/s')\n", +"PhaseMargin=90-(atan(22/wL)*180/%pi)//phase margin of system\n", +"disp(PhaseMargin,'The phase margin is ')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.3: PLLA_Ex_9_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"close\n", +"//chapter 9: Stability Analysis\n", +"//Example 9.3 page no 361\n", +"//given\n", +"clear\n", +"wL=258\n", +"s=poly(0,'s')\n", +"h=syslin('c',(100/(s*(s/wL+1)^2 )))\n", +"clf();bode(h,1,1000);\n", +"disp('The open loop gain and the phase plots are given .It is seen that the crossover frequency is 15Hz,and the phase margin is 50degree')\n", +"disp('We know that the overshoot can be increased by decreasing the phase margin.In fact,in this case selecting wL=233 rad/s corresponding to phase margin of 43.5degree gives an overshoot of 20persent')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.4: PLLA_Ex_9_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"close\n", +"//chapter 9: Stability Analysis\n", +"//Example 9.4 page no 363\n", +"//given\n", +"clear\n", +"N=2\n", +"Kv=0.83*10^3//DC gain\n", +"B=1250//closed loop bandwidth\n", +"wn=1.27*10^3\n", +"wL=wn^2/Kv//corner frequency\n", +"s=poly(0,'s')\n", +"h=syslin('c',(1/((s^2/wn^2)+0.9*s/wn+1)))\n", +"clf();bode(h,1,1000);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.5: PLLA_Ex_9_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"close\n", +"//chapter 9: Stability Analysis\n", +"//Example 9.5 page no 368\n", +"//given\n", +"clear\n", +"Ka=(2.2e3)^2\n", +"wz=(2*%pi)/(2.2/sqrt((2.2e3)^2))\n", +"s=poly(0,'s')\n", +"h=syslin('c',(1000*(s/(wz+1))/(s^2/Ka +(s/wz) +1)))\n", +"clf();bode(h,1,1000);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.6: PLLA_Ex_9_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 9:Stability Analysis\n", +"//example 8.6 page no 373\n", +"//given\n", +"zeta=0.8//damping ratio\n", +"B=10^3//closed loop bandwidth\n", +"X=sqrt(1+2*zeta^2+sqrt(2+4*zeta^2+4*zeta^4))\n", +"Ka=(B/X)^2//loop gain\n", +"wn=sqrt(Ka)//\n", +"wz=wn/(2*zeta)//the system zero\n", +"mprintf('the closed loop gain is %3.2e (rad/s)^2 \n wn = %f rad/s \n the system has zero at %d rad/s',Ka,wn,wz)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.7: PLLA_Ex_9_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 9:Phase locked loop Analysis \n", +"//Example 9.7 page no 376\n", +"a=28//taking alpha as a\n", +"Ka=0.21*10^6\n", +"GF=20*log10(a)^1/2\n", +"disp(GF,'The value of gain is ')\n", +"disp('so we must determine where the uncompensated frequency response is -14.5dB ')\n", +"Wc=a^(1/4)*Ka^(1/2)\n", +"disp('The 28:1 lead ratio will increase the crossover frequency by a factor 2.3 The factor zero is placed at ')\n", +"Wz=Wc/sqrt(a)//systems zero\n", +"Wp=a*Wz//systems pole\n", +"mprintf('The crossover frequency is %3.2e rad/s \n The zero is placed at %d rad/s \n The pole is placed at %d rad/s ',Wc,Wz,Wp)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9: PLLA_Ex_9_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc\n", +"//Chapter 9:Phase locked loop Analysis \n", +"//Example 9.9 page no 380\n", +"disp('since the phase margin without time delay is 50 degree, a 10 degree phase lag can be introduced by the time delay at the crossover frequecy.That is ,')\n", +"Wc=1000//crossover frequency\n", +"thetaT=-0.174\n", +"T=thetaT/Wc//time delay\n", +"mprintf('The time delay is %3.2e ',T)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |