diff options
author | Prashant S | 2020-04-14 10:25:32 +0530 |
---|---|---|
committer | GitHub | 2020-04-14 10:25:32 +0530 |
commit | 06b09e7d29d252fb2f5a056eeb8bd1264ff6a333 (patch) | |
tree | 2b1df110e24ff0174830d7f825f43ff1c134d1af /Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad | |
parent | abb52650288b08a680335531742a7126ad0fb846 (diff) | |
parent | 476705d693c7122d34f9b049fa79b935405c9b49 (diff) | |
download | all-scilab-tbc-books-ipynb-master.tar.gz all-scilab-tbc-books-ipynb-master.tar.bz2 all-scilab-tbc-books-ipynb-master.zip |
Initial commit
Diffstat (limited to 'Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad')
9 files changed, 3870 insertions, 0 deletions
diff --git a/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/1-Introduction_to_Operational_Amplifier.ipynb b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/1-Introduction_to_Operational_Amplifier.ipynb new file mode 100644 index 0000000..6b59a5a --- /dev/null +++ b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/1-Introduction_to_Operational_Amplifier.ipynb @@ -0,0 +1,156 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1: Introduction to Operational Amplifier" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.1_a: Collector_current_and_dc_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Chapter1\n", +"//Page.No-4, \n", +"//Example_1_1_a, Figure.No-1.2\n", +"//Collector current and dc voltage\n", +"//Given:\n", +"clear;clc;\n", +"Vcc=6;Vbe5=0.7;Vee=6;Vbe3=6.7;Vbe6=0.7;Vbe7=0.7; // Voltage in volts\n", +"Rc1=6.7*10^3; // Resistance in ohms\n", +"Ic1=rand();\n", +"Vc1=Vcc-Rc1*Ic1;\n", +"Ve4=Vc1-Vbe5;\n", +"I4=(Ve4+Vee)/(9.1*10^3+5.5*10^3);\n", +"Vb3=5.5*10^3*I4-Vee;\n", +"Ve3=Vb3-Vbe3;\n", +"Ie3=(Ve3+Vbe3)/3.3*10^3;\n", +"Ic1=1.08*10^-3/2.765; // Since Ie3=2*Ic1,substituting in above equation and simplifying\n", +"printf('\n Collector current Ic1 is = %.5f A \n',Ic1) // Result\n", +"Vc1=Vcc-Rc1*Ic1;\n", +"printf('\n Voltage Vc1 is = %.2f V \n',Vc1) // Result\n", +"Ve4=Vc1-Vbe5;\n", +"printf('\n Voltage Ve4 is = %.2f V \n',Ve4) // Result\n", +"Ie4=(Ve4+Vee)/(29.2*10^3);\n", +"printf('\n Current Ie4 is = %.6f A \n',Ie4) // Result\n", +"Ic5=Ie4;\n", +"printf('\n Current Ic5 is = %.6f A \n',Ic5) // Result\n", +"Vc5=Vcc-3.8*10^3*Ic5;\n", +"printf('\n Voltage Vc5 is = %.2f V \n',Vc5) // Result\n", +"Ve6=Vc5-Vbe6;\n", +"printf('\n Voltage Ve6 is = %.2f V \n',Ve6) // Result\n", +"Ie6=(Ve6+Vee)/(15*10^3);\n", +"printf('\n Current Ie6 is = %.6f A \n',Ie6) // Result\n", +"Ve7=Ve6+Vbe7;\n", +"printf('\n Voltage Ve7 is = %.2f V \n',Ve7) // Result\n", +"I1=(Vcc-Ve7)/400;\n", +"printf('\n Current I1 is = %.6f A \n',I1) // Result\n", +"Ie8=I1;\n", +"printf('\n Current Ie8 is = %.6f A \n',Ie8) // Result\n", +"Ve8=-Vee+2*10^3*Ie8;\n", +"printf('\n Voltage Ve8 at the output terminal is = %.2f V \n',Ve8) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.1_b: Voltage_gain_of_the_opamp.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Chapter1\n", +"//Page.No-4, \n", +"//Example_1_1_b, Figure.No-1.2\n", +"//Voltage gain of the opamp\n", +"//Given:\n", +"clear;clc;\n", +"Ie1=0.39*10^-3;Ie4=0.298*10^-3;Ie6=0.678*10^-3; // Current in amps\n", +"Rc1=6.7*10^3;Rc5=3.8*10^3; // Resistance in ohms\n", +"beta_ac=150;\n", +"re1=(25*10^-3)/Ie1;\n", +"re2=re1;\n", +"re4=(25*10^-3)/Ie4;\n", +"re5=re4;\n", +"re6=(25*10^-3)/Ie6;\n", +"k=(Rc1*2*beta_ac*re4)/(Rc1+2*beta_ac*re4);\n", +"Ad1=k/re1;\n", +"printf('\n Voltage gain of the dual-input,balanced output-differential amplifier is = %.2f \n',Ad1) // Result\n", +"k1=(Rc5*beta_ac*(re6+15*10^3))/(Rc5+beta_ac*(re6+15*10^3));\n", +"Ad2=k1/(2*re5);\n", +"printf('\n Voltage gain of the dual-input,unbalanced output-differential amplifier is = %.1f \n',Ad2) // Result\n", +"Ad=82.55*22.6; // Using Ad=Ad1*Ad2\n", +"printf('\n Overall gain of the op-amp is = %.2f \n',Ad) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.1_c: Input_resistance_of_the_opamp.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Chapter1\n", +"//Page.No-4, \n", +"//Example_1_1_c, Figure.No-1.2\n", +"//Input resistance of the opamp\n", +"//Given:\n", +"clear;clc;\n", +"beta_ac=150;\n", +"re1=64.1; // Resistance in ohms\n", +"Ri=2*beta_ac*re1;\n", +"printf('\n Input resistance Ri is = %.1f ohm \n',Ri) // Result" + ] + } +], +"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/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/2-Interpretation_of_Data_Sheets_and_Characteristics_of_an_Opamp.ipynb b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/2-Interpretation_of_Data_Sheets_and_Characteristics_of_an_Opamp.ipynb new file mode 100644 index 0000000..9bfae7e --- /dev/null +++ b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/2-Interpretation_of_Data_Sheets_and_Characteristics_of_an_Opamp.ipynb @@ -0,0 +1,143 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: Interpretation of Data Sheets and Characteristics of an Opamp" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1_a: Output_voltage_for_Openloop_differential_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Chapter2\n", +"//Page.No-45, Figure.No-2.9\n", +"//Example_2_1_a\n", +"//Output voltage for open-loop differential amplifier\n", +"//Given:\n", +"clear;clc;\n", +"vin1=5*10^-6;vin2=-7*10^-6; // Both input voltages are in volts\n", +"A=200000; // Voltage gain\n", +"vo=A*(vin1-vin2); //Output voltage in volts\n", +"printf('\n Output voltage is vo = %.1f V dc \n',vo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1_b: Output_voltage_for_openloop_differential_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Chapter2\n", +"//Page.No-45, Figure.No-2.9\n", +"//EXAMPLE_2_1_b\n", +"//Output voltage for open-loop differential amplifier\n", +"//Given:\n", +"clear;clc;\n", +"vin1=10*10^-3;vin2=20*10^-3; // Both input voltages are in volts\n", +"A=200000; // Voltage gain\n", +"vo=A*(vin1-vin2); // Output voltage in volts\n", +"printf('\n Output voltage is vo = %.f V rms \n',vo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2_a: Output_voltage_for_inverting_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Chapter2\n", +"//Page.No-46, Figure.No-2.10\n", +"//Example_2_2_a\n", +"//Output voltage for inverting amplifier\n", +"//Given:\n", +"clear;clc;\n", +"vin=20*10^-3; // Input voltage in volts\n", +"A=200000; // Voltage gain\n", +"vo=-(A*vin); // Output voltage in volts\n", +"printf('\n Output voltage is vo = %.f V \n',vo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2_b: Output_voltage_for_inverting_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Chapter2\n", +"//Page.No-46, Figure.No-2.10\n", +"//Example_2_2_b\n", +"//Output voltage for inverting amplifier\n", +"//Given:\n", +"clear;clc;\n", +"vin=-50*10^-6; // Input voltage in volts\n", +"A=200000; // Voltage gain\n", +"vo=-(A*vin); // Output voltage in volts\n", +"printf('\n Output voltage is vo = %.f V \n',vo) // Result" + ] + } +], +"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/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/3-An_Opamp_with_Negative_Feedback.ipynb b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/3-An_Opamp_with_Negative_Feedback.ipynb new file mode 100644 index 0000000..b01b6f0 --- /dev/null +++ b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/3-An_Opamp_with_Negative_Feedback.ipynb @@ -0,0 +1,323 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: An Opamp with Negative Feedback" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1: Parameters_Of_voltageseries_feedback_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter3\n", +"// Page.No-75, Figure.No-3.2\n", +"// Example_3_1\n", +"// Parameters of voltage-series feedback amplifier\n", +"// Given\n", +"clear;clc;\n", +"R1=1000;Rf=10000;\n", +"A=200000; // Open-loop voltage gain\n", +"Ri=2*10^6; // Input resistance without feedback\n", +"Ro=75; // Output resistance without feedback\n", +"fo=5; // Break frequency of an Op-amp\n", +"Vsat=13; // Saturation voltage\n", +"B=R1/(R1+Rf); // Gain of the feedback circuit\n", +"Af=A/(1+A*B); // Closed-loop voltage gain\n", +"printf('\n Closed-loop voltage gain is Af = %.2f \n',Af) // Result\n", +"RiF=Ri*(1+A*B); // Input resistance with feedback\n", +"printf('\n Input resistance with feedback is RiF = %.2f ohms \n',RiF) // Result\n", +"RoF=Ro/(1+A*B); // Output resistance with feedback\n", +"printf('\n Output resistance with feedback is RoF = %f ohms \n',RoF) // Result\n", +"fF=fo*(1+A*B); // Bandwidth with feedback\n", +"printf('\n Bandwidth with feedback is vo = %.1f Hz \n',fF) // Result\n", +"VooT=Vsat/(1+A*B); // Total output offset voltage with feedback\n", +"printf('\n Total output offset voltage with feedback is VooT = %f V \n',VooT) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2: Parameters_Of_voltageseries_feedback_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter3\n", +"// Page.No-83, Figure.No-3.7\n", +"// Example_3_2\n", +"// Parameters of voltage-series feedback amplifier\n", +"// Given\n", +"clear;clc;\n", +"R1=1000;Rf=10000;\n", +"A=200000; // Open-loop voltage gain\n", +"Ri=2*10^6; // Input resistance without feedback\n", +"Ro=75; // Output resistance without feedback\n", +"fo=5; // Break frequency of an Op-amp\n", +"Vsat=13; // Saturation voltage\n", +"B=1; // Gain of the feedback circuit and it is equal to 1 for voltage follower\n", +"Af=A/(1+A*B); // Closed-loop voltage gain\n", +"printf('\n Closed-loop voltage gain is Af = %.f \n',Af) // Result\n", +"RiF=Ri*(1+A*B); // Input resistance with feedback\n", +"printf('\n Input resistance with feedback is RiF = %.1f ohms \n',RiF) // Result\n", +"RoF=Ro/(1+A*B); // Output resistance with feedback\n", +"printf('\n Output resistance with feedback is RoF = %f ohms \n',RoF) // Result\n", +"fF=fo*(1+A*B); // Bandwidth with feedback\n", +"printf('\n Bandwidth with feedback is vo = %.1f Hz \n',fF) // Result\n", +"VooT=Vsat/(1+A*B); // Total output offset voltage with feedback\n", +"printf('\n Total output offset voltage with feedback is VooT = %f V \n',VooT) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.3: Parameters_of_Voltageshunt_feedback_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter3\n", +"// Page.No-86, Figure.No-3.8\n", +"// Example_3_3\n", +"// Parameters of voltage-shunt feedback amplifier\n", +"// Given\n", +"clear;clc;\n", +"R1=470;Rf=4.7*10^3;\n", +"A=200000; // Open-loop voltage gain \n", +"Ri=2*10^6;// Input resistance without feedback\n", +"Ro=75; // Output resistance without feedback\n", +"fo=5; // Break frequency of an Op-amp\n", +"Vsat=13; // Saturation voltage\n", +"K=Rf/(R1+Rf); // Voltage attenuation factor\n", +"B=R1/(R1+Rf); // Gain of the feedback circuit\n", +"Af=-(A*K)/(1+A*B); // Closed-loop voltage gain\n", +"printf('\n Closed-loop voltage gain is Af = %.f \n',Af) // Result\n", +"X=Rf/(1+A);\n", +"RiF=R1+(X*Ri)/(X+Ri); // Input resistance with feedback\n", +"printf('\n Input resistance with feedback is RiF = %.1f ohms \n',RiF) // Result\n", +"RoF=Ro/(1+A*B); // Output resistance with feedback\n", +"printf('\n Output resistance with feedback is RoF = %f ohms \n',RoF) // Result\n", +"fF=fo*(1+A*B)/K; // Bandwidth with feedback\n", +"printf('\n Bandwidth with feedback is vo = %.2f Hz \n',fF) // Result\n", +"VooT=Vsat/(1+A*B); // Total output offset voltage with feedback\n", +"printf('\n Total output offset voltage with feedback is VooT = %f V \n',VooT) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4: Output_voltage_of_voltage_shunt_feedback_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter3\n", +"// Page.No-86, Figure.No-3.8\n", +"// Example_3_4\n", +"// Output voltage of voltage-shunt feedback amplifier\n", +"// Given\n", +"clear;clc;\n", +"R1=470;Rf=4.7*10^3;\n", +"A=200000; // Open-loop voltage gain\n", +"vin=1; // Input voltage in volts\n", +"K=Rf/(R1+Rf); // Voltage attenuation factor\n", +"B=R1/(R1+Rf); // Gain of the feedback circuit\n", +"Af=-(A*K)/(1+A*B); // Closed-loop voltage gain\n", +"vo=Af*vin; // Output voltage\n", +"printf('\n Output voltage is vo = %.f V \n',vo) // Result\n", +"t=0:0.1:2*%pi;\n", +"vo=-10*sin(t);\n", +"plot(t,vo);\n", +"title('Output Voltage');\n", +"xlabel('t');\n", +"ylabel('Vo');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5_a: Gain_input_resistance_of_the_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter3\n", +"// Page.No-96, Figure.No-3.14\n", +"// Example_3_5_a\n", +"// Gain Input resistance of the amplifier\n", +"// Given\n", +"clear;clc;\n", +"R1=1000;R2=1000;\n", +"Rf=10*10^3;R3=10*10^3;\n", +"AD=-Rf/R1; // Voltage gain\n", +"printf('\n Voltage gain is AD = %.f \n',AD) // Result\n", +"RiFx=R1; // Input resistance of inverting amplifier\n", +"printf('\n Input resistance of inverting amplifier is RiFx = %.f ohms \n',RiFx) // Result\n", +"RiFy=R2+R3; // Input resistance of non-inverting amplifier \n", +"printf('\n Input resistance of non-inverting amplifier is RiFy = %.f ohms \n',RiFy) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5_b: Output_voltage_of_an_Opamp.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter3\n", +"// Page.No-96, Figure.No-3.14\n", +"// Example_3_5_b\n", +"// Output voltage of an Op-amp\n", +"// Given\n", +"clear;clc;\n", +"vx=2.7;vy=3; //Both input voltages are in volts\n", +"Rf=10*10^3;R1=1000; // Both are in ohms\n", +"AD=-Rf/R1; // Voltage gain\n", +"vxy=vx-vy;\n", +"vo=AD*vxy; // Output voltage\n", +"printf('\n Output voltage is vo = %.f V \n',vo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6_a: Voltage_gain_and_input_resistance_of_the_Opamp.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter3\n", +"// Page.No-99, Figure.No-3.16\n", +"// Example_3_6_a\n", +"// Voltage gain and input resistance of Op-amp\n", +"// Given\n", +"clear;clc;\n", +"R1=680;R3=680; // Both are in ohms\n", +"RF=6800;R2=6800; // Both are in ohms\n", +"Ri=2*10^6; // Open-loop input resistance of the op-amp\n", +"vx=-1.5;vy=-2; // Both are in volts\n", +"A=200000; // Open-loop Gain\n", +"AD=1+RF/R1; // Voltage gain\n", +"printf('\n Voltage gain is AD = %.f \n',AD) // Result\n", +"B=R2/(R2+R3);\n", +"RiFy=Ri*(1+A*B); // Input resistance of first stage amplifier\n", +"printf('\n Input resistance of first stage amplifier is RiFy = %.1f ohms \n',RiFy) // Result\n", +"B=R1/(R1+RF);\n", +"RiFx=Ri*(1+A*B); // Input resistance of second stage amplifier\n", +"printf('\n Input resistance of second stage amplifier is RiFx = %.1f ohms \n',RiFx) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6_b: Output_voltage_of_the_Opamp.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter3\n", +"// Page.No-99, Figure.No-3.16\n", +"// Example_3_6_b\n", +"// Output voltage of the Op-amp\n", +"// Given\n", +"clear;clc;\n", +"R1=680;RF=6800 // Both are in ohms\n", +"vx=-1.5;vy=-2; // Both input voltages are in volts\n", +"AD=1+RF/R1; // Voltage gain\n", +"vxy=vx-vy;\n", +"vo=AD*vxy; // Output voltage\n", +"printf('\n Output voltage is vo = %.1f V \n',vo) // Result" + ] + } +], +"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/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/4-The_Practical_Opamp.ipynb b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/4-The_Practical_Opamp.ipynb new file mode 100644 index 0000000..e474a23 --- /dev/null +++ b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/4-The_Practical_Opamp.ipynb @@ -0,0 +1,723 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4: The Practical Opamp" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.10_a: Error_voltage_and_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-141, Figure.No-4.26\n", +"// Example_4_10_a\n", +"// Error voltage and output voltage\n", +"// Given\n", +"clear;clc;\n", +"delta_Vio=(30*10^-6); // Change in input offset voltage\n", +"delta_T=1; // Unit change in temperature\n", +"delta_Iio=(300*10^-12); // Change in input offset current\n", +"Vs=15;\n", +"R1=1*10^3;Rf=100*10^3;\n", +"Vin=1*10^-3; // Input voltage\n", +"k=25; // Amplifier is nulled at 25 deg\n", +"T=35-k; // Change in temperature\n", +"Ev=(1+Rf/R1)*(delta_Vio/delta_T)*T + Rf*(delta_Iio/delta_T)*T; // Error voltage\n", +"printf('\n Error voltage is = %.4f V dc \n',Ev) // Result\n", +"Vo=(1+Rf/R1)*Vin+Ev; // Output voltage\n", +"printf('\n Output voltage is = %.4f V \n',Vo) // Result \n", +"// (OR) \n", +"Vo=(1+Rf/R1)*Vin-Ev; // Output voltage\n", +"printf('\n Output voltage is = %.4f V \n',Vo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.10_b: Error_voltage_and_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-141, Figure.No-4.26\n", +"// Example_4_10_b\n", +"// Error voltage and output voltage\n", +"// Given\n", +"clear;clc;\n", +"delta_Vio=(30*10^-6); // Change in input offset voltage\n", +"delta_T=1; // Unit change in temperature\n", +"delta_Iio=(300*10^-12); // Change in input offset current\n", +"Vs=15;\n", +"R1=1*10^3;Rf=100*10^3;Rl=10*10^3;\n", +"Vin=10*10^-3; // Input voltage\n", +"k=25; // Amplifier is nulled at 25 deg\n", +"T=35-k; // Change in temperature\n", +"Ev=(1+Rf/R1)*(delta_Vio/delta_T)*T + Rf*(delta_Iio/delta_T)*T; // Error voltage\n", +"printf('\n Error voltage is = %.4f V dc \n',Ev) // Result\n", +"Vo=(1+Rf/R1)*Vin+Ev; // Output voltage\n", +"printf('\n Output voltage is = %.4f V dc \n',Vo) // Result \n", +"// (OR) \n", +"Vo=(1+Rf/R1)*Vin-Ev; // Output voltage\n", +"printf('\n Output voltage is = %.4f V dc \n',Vo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.11_a: Output_offset_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-141, Figure.No-4.28\n", +"// Example_4_11_a\n", +"// Output offset voltage\n", +"// Given\n", +"clear;clc;\n", +"delta_Vio=15.85*10^-6; // Change in input offset voltage\n", +"delta_V=1; // Unit change in supply voltage\n", +"V=2; // Change in supply voltage\n", +"R1=1*10^3;Rf=100*10^3;\n", +"delta_Voo=(1+Rf/R1)*(delta_Vio/delta_V)*V; // Change in output offset voltage\n", +"printf('\n Change in output offset voltage is = %.4f V \n',delta_Voo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.11_b: Output_offset_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-141, Figure.No-4.28\n", +"// Example_4_11_b\n", +"// Output offset voltage\n", +"// Given\n", +"clear;clc;\n", +"delta_Vio=15.85*10^-6; // Change in input offset voltage\n", +"delta_V=1; // Unit change in supply voltage\n", +"V=2; // Change in supply voltage\n", +"Vin=10*10^-3;\n", +"R1=1*10^3;Rf=100*10^3;\n", +"delta_Voo=(1+Rf/R1)*(delta_Vio/delta_V)*V; // Output offset voltage\n", +"Vo=(-Rf/R1)*Vin+delta_Voo; // Total output offset voltage\n", +"printf('\n Total output offset voltage is = %.4f V \n',Vo) // Result\n", +"// (OR)\n", +"Vo=(-Rf/R1)*Vin-delta_Voo; // Total output offset voltage\n", +"printf('\n Total output offset voltage is = %.4f V \n',Vo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.12: Output_ripple_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-141, Figure.No-4.28(b)\n", +"// Example_4_12\n", +"// Output ripple voltage\n", +"// Given\n", +"clear;clc;\n", +"delta_Vio=15.85*10^-6; // Change in input offset voltage\n", +"delta_V=1; // Unit change in supply voltage\n", +"V=10*10^-3; // Change in supply voltage\n", +"R1=1*10^3;Rf=100*10^3;\n", +"delta_Voo=(1+Rf/R1)*(delta_Vio/delta_V)*V; // Change in output offset voltage\n", +"printf('\n Change in output offset voltage is = %.6f V \n',delta_Voo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.13: Change_in_output_offset_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-136, Figure.No-4.24\n", +"// Example_4_13\n", +"// Change in output offset voltage\n", +"// Given\n", +"clear;clc;\n", +"delta_Vio=5*10^-6; // Change in input offset voltage\n", +"delta_t=1; // Unit change in time\n", +"delta_Iio=2*10^-9; // Change in input offset current\n", +"t=4; // Time elapsed(weeks)\n", +"R1=1*10^3;Rf=100*10^3;Rl=10*10^3;\n", +"delta_Voot=(1+Rf/R1)*(delta_Vio/delta_t)*t+Rf*(delta_Iio/delta_t)*t; // Change in output offset voltage\n", +"printf('\n Change in output offset voltage is = %.4f V \n',delta_Voot) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.14_a: Output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-153, Figure.No-4.32\n", +"// Example_4_14_a\n", +"// Output voltage\n", +"// Given\n", +"clear;clc;\n", +"R1=1*10^3;R2=1*10^3;Rf=10*10^3;R3=10*10^3;\n", +"vd=5*10^-3; // Differential voltage\n", +"vcm=2*10^-3; // Common-mode voltage\n", +"Ad=Rf/R1; // Closed-loop differential gain\n", +"vo=Ad*vd; // Output voltage\n", +"printf('\n Output voltage is = %.3f V \n',vo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.14_b: Output_common_mode_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-153, Figure.No-4.32\n", +"// Example_4_14_b\n", +"// Output common-mode voltage\n", +"// Given\n", +"clear;clc;\n", +"R1=1*10^3;R2=1*10^3;Rf=10*10^3;R3=10*10^3;\n", +"vd=5*10^-3; // Differential voltage\n", +"vcm=2*10^-3; // Common-mode voltage\n", +"Ad=Rf/R1; // Closed-loop differential gain\n", +"CMRRdb=90\n", +"CMRR=10^(90/20); // Using CMRRdb=20*log10(CMRR), to convert the CMRR(dB) value into its equuivalent numerical value\n", +"printf('\n CMRR is = %.2f \n',CMRR) // Result\n", +"vocm=(Ad*vcm)/CMRR; // Output common-mode voltage\n", +"printf('\n Output common-mode voltage is = %.8f V \n',vocm) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1: Design_of_Compensating_Network.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-114\n", +"// Example_4_1\n", +"// Design of Compensating Network\n", +"// Given\n", +"clear;clc;\n", +"V=10 // Supply voltage\n", +"Vio=10*10^-3; // Input offset voltage\n", +"Rc=10; // Assumption\n", +"Rb=(V/Vio)*Rc;\n", +"printf('\n Resistance Rb is = %.f ohms \n',Rb) // Result\n", +"Ra=Rb/2.5; // Since Rb>Rmax,let us choose Rb=10*Rmax where Rmax=Ra/4\n", +"printf('\n Resistance Ra is = %.f ohms \n',Ra) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.2: Max_Output_offset_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-121, Figure.No-4.13\n", +"// Example_4_2\n", +"// Max Output offset voltage\n", +"// Given\n", +"clear;clc;\n", +"R1=1*10^3;Rf=10*10^3;\n", +"Vio=10*10^-3; // Input offset voltage\n", +"Aoo=1+Rf/R1; // To find max value of Voo,we reduce input voltage vin to zero.\n", +"Voo=Aoo*Vio; // Max output offset voltage\n", +"printf('\n Max output offset voltage is = %.3f V dc \n',Voo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3: Design_of_input_offset_voltage_compensating_network.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-121, Figure.No-4.14\n", +"// Example_4_3\n", +"// Design of input offset voltage-compensating network\n", +"// Given\n", +"clear;clc;\n", +"R1=1*10^3;Rf=10*10^3;Rc=10;\n", +"Af=1+Rf/(R1+Rc); // Closed loop gain of non-inverting amplifier\n", +"printf('\n Closed loop gain of non-inverting amplifier is = %.1f \n',Af) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.4_a: Max_Output_offset_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-127, Figure.No-4.19\n", +"// Example_4_4_a\n", +"// Max Output offset voltage\n", +"// Given\n", +"clear;clc;\n", +"R1=470;Rf=47*10^3;\n", +"Vio=6*10^-3;\n", +"Ib=500*10^-9;\n", +"Vs=15;\n", +"// Max output offset voltage due to input offset voltage,Vio is :\n", +"Voo=(1+Rf/R1)*Vio; // Max output offset voltage\n", +"printf('\n Max output offset voltage is = %.3f V dc \n',Voo) // Result\n", +"// Max output offset voltage due to input offset voltage,Ib is :\n", +"VoIb=Rf*Ib; // Max output offset voltage\n", +"printf('\n Max output offset voltage due to input offset current,Ib is = %.6f V dc \n',VoIb) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.4_b: Effect_of_input_bias_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-127, Figure.No-4.19\n", +"// Example_4_4_b\n", +"// Effect of input bias current\n", +"// Given\n", +"clear;clc;\n", +"R1=470;Rf=47*10^3;\n", +"ROM=R1*Rf/(R1+Rf); // Parallel combination of R1 and Rf\n", +"printf('\n Parallel combination of R1 and Rf,i.e ROM is = %.1f ohm \n',ROM) // Approximately the value is 47 ohm" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.5_a: Max_Output_offset_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-127, Figure.No-4.19\n", +"// Example_4_5_a\n", +"// Max Output offset voltage\n", +"// Given\n", +"clear;clc;\n", +"R1=1*10^3;Rf=100*10^3;\n", +"Vio=6*10^-3;\n", +"Ib=500*10^-9;\n", +"Vs=15;\n", +"// Max output offset voltage due to input offset voltage,Vio is :\n", +"Voo=(1+Rf/R1)*Vio; // Max output offset voltage\n", +"printf('\n Max output offset voltage due to input offset voltage,Vio is = %.4f V dc \n',Voo) // Result\n", +"// Max output offset voltage due to input offset voltage,Ib is :\n", +"VoIb=Rf*Ib; // Max output offset voltage\n", +"printf('\n Max output offset voltage due to input offset current,Ib is = %.4f V dc \n',VoIb) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.5_b: Effect_of_input_bias_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-127, Figure.No-4.19\n", +"// Example_4_4_b\n", +"// Effect of input bias current\n", +"// Given\n", +"clear;clc;\n", +"R1=1*10^3;Rf=100*10^3;\n", +"ROM=R1*Rf/(R1+Rf); // Parallel combination of R1 and Rf\n", +"printf('\n Parallel combination of R1 and Rf,i.e ROM is = %.f ohm \n',ROM)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.6: Max_Output_offset_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-130, Figure.No-4.21\n", +"// Example_4_6\n", +"// Max Output offset voltage\n", +"// Given\n", +"clear;clc;\n", +"Iio=200*10^-9; // Input offset current\n", +"Rf=100*10^3;\n", +"VoIio=Rf*Iio; // Max output offset voltage\n", +"printf('\n Max output offset voltage due to input offset current,Ib is = %.4f V dc \n',VoIio) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.7: Total_Output_offset_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-132, Figure.No-4.22(a)\n", +"// Example_4_7\n", +"// Total Output offset voltage\n", +"// Given\n", +"clear;clc;\n", +"R1=1*10^3;Rf=10*10^3;\n", +"Vio=7.5*10^-3; // Max input offset voltage\n", +"Iio=50*10^-9; // Max input offset current\n", +"Ib=250*10^-9; // Max input bias current\n", +"// For figure 4.22(a)\n", +"VooT=(1+Rf/R1)*Vio+(Rf*Ib); // Since the current generated output offset voltage is due to input bias current Ib\n", +"printf('\n Max total output offset voltage due to input offset current,Ib is = %.4f V \n',VooT) // Result\n", +"\n", +"// For figure 4.22(b)\n", +"VooT=(1+Rf/R1)*Vio+(Rf*Iio); // Since the current generated output offset voltage is due to input offset current Ib\n", +"printf('\n Max total output offset voltage due to input offset current,Ib is = %.4f V \n',VooT) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.8_a: Error_voltage_and_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-136, Figure.No-4.24\n", +"// Example_4_8_a\n", +"// Error voltage and output voltage\n", +"// Given\n", +"clear;clc;\n", +"delta_Vio=(30*10^-6); // Change in input offset voltage\n", +"delta_T=1; // Unit change in temperature\n", +"delta_Iio=(300*10^-12); // Change in input offset current\n", +"Vs=15;\n", +"R1=1*10^3;Rf=100*10^3;Rl=10*10^3;\n", +"Vin=1*10^-3; // Input voltage\n", +"k=25; // Amplifier is nulled at 25 deg\n", +"T=35-k; // Change in temperature\n", +"Ev=(1+Rf/R1)*(delta_Vio/delta_T)*T + Rf*(delta_Iio/delta_T)*T; // Error voltage\n", +"printf('\n Error voltage is = %.4f V \n',Ev) // Result\n", +"Vo=-(Rf/R1)*Vin+Ev; // Output voltage\n", +"printf('\n Output voltage is = %.4f V \n',Vo) // Result \n", +"// (OR)\n", +"Vo=-(Rf/R1)*Vin-Ev; // Output voltage\n", +"printf('\n Output voltage is = %.4f V \n',Vo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.8_b: Error_voltage_and_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-136, Figure.No-4.24\n", +"// Example_4_8_b\n", +"// Error voltage and output voltage\n", +"// Given\n", +"clear;clc;\n", +"delta_Vio=(30*10^-6); // Change in input offset voltage\n", +"delta_T=1; // Unit change in temperature\n", +"delta_Iio=(300*10^-12); // Change in input offset current\n", +"Vs=15;\n", +"R1=1*10^3;Rf=100*10^3;Rl=10*10^3;\n", +"Vin=10*10^-3; // Input voltage\n", +"k=25; // Amplifier is nulled at 25 deg\n", +"T=35-k; // Change in temperature\n", +"Ev=(1+Rf/R1)*(delta_Vio/delta_T)*T + Rf*(delta_Iio/delta_T)*T; // Error voltage\n", +"printf('\n Error voltage is = %.4f V \n',Ev) // Result\n", +"Vo=-(Rf/R1)*Vin+Ev; // Output voltage\n", +"printf('\n Output voltage is = %.4f V \n',Vo) // Result \n", +"// (OR)\n", +"Vo=-(Rf/R1)*Vin-Ev; // Output voltage\n", +"printf('\n Output voltage is = %.4f V \n',Vo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.9_a: Error_voltage_and_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-136, Figure.No-4.24\n", +"// Example_4_9_a\n", +"// Error voltage and output voltage\n", +"// Given\n", +"clear;clc;\n", +"delta_Vio=(30*10^-6); // Change in input offset voltage\n", +"delta_T=1; // Unit change in temperature\n", +"delta_Iio=(300*10^-12); // Change in input offset current\n", +"Vs=15;\n", +"R1=1*10^3;Rf=100*10^3;Rl=10*10^3;\n", +"Vin=10*10^-3; // Input voltage\n", +"k=25; // Amplifier is nulled at 25 deg\n", +"T=55-k; // Change in temperature\n", +"Ev=(1+Rf/R1)*(delta_Vio/delta_T)*T + Rf*(delta_Iio/delta_T)*T; // Error voltage\n", +"printf('\n Error voltage is = %.4f V dc \n',Ev) // Result\n", +"Vo=-(Rf/R1)*Vin+Ev; // Output voltage\n", +"printf('\n Output voltage is = %.4f V \n',Vo) // Result \n", +"// (OR) \n", +"Vo=-(Rf/R1)*Vin-Ev; // Output voltage\n", +"printf('\n Output voltage is = %.4f V \n',Vo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.9_b: Output_waveform.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter4\n", +"// Page.No-136, Figure.No-4.24\n", +"// Example_4_9_b\n", +"// Output waveform\n", +"// Given\n", +"clear;clc;\n", +"t =0:0.1:2*%pi;\n", +"y = -1000*sin(t)+91.8;\n", +"a = gca();\n", +"a.x_label.text = 'Time';\n", +"a.y_label.text = 'Voltage';\n", +"a.title.text = 'Output waveform';\n", +"plot2d(t,y);\n", +"t1=0:0.1:2*%pi;\n", +"y1=91.8*(t1>=0);\n", +"b=gca();\n", +"b.line_style=3;\n", +"plot2d(t1,y1);" + ] + } +], +"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/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/5-Frequency_Response_of_an_Opamp.ipynb b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/5-Frequency_Response_of_an_Opamp.ipynb new file mode 100644 index 0000000..f636156 --- /dev/null +++ b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/5-Frequency_Response_of_an_Opamp.ipynb @@ -0,0 +1,129 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: Frequency Response of an Opamp" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1: Maximum_gai.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +" // Chapter5\n", +"// Page.No-171, Figure.No-5.4\n", +"// Example_5_1\n", +"// Maximum gain\n", +"// Given\n", +"clear;clc;\n", +"fo=5; // Break freq of the op-amp in Hz\n", +"s=%s;\n", +"A=200000; // Gain of the op-amp at 0 Hz\n", +"H=syslin('c',(A*fo*2*%pi)/((fo*2*%pi)+s));\n", +"fmin=1;\n", +"fmax=100000;\n", +"bode(H,fmin,fmax);\n", +"Aol=40;\n", +"printf('\n Maximum gain is = %.f dB \n ',Aol); // From the graph" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2: Gain_equation_and_break_frequencies.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Chapter5\n", +"//Page.No-172, Figure.No-5.5\n", +"//Example_5_2\n", +"//Gain equation and break frequencies\n", +"//Given:\n", +"clear;clc;\n", +"phase=-157.5; // Phase shift at about 3 MHz\n", +"f=3*10^6;\n", +"disp('Gain equation is Aol(f)=A/((1+(f/fo1)*j)*(1+(f/fo2)*j)),where fo1-first break frequency and fo2-second break frequency') // From the figure\n", +"fo1=6;\n", +"printf('\n First break frequency fo1 is = %.f Hz \n',fo1) // From the graph\n", +"k=-atand(f/fo1)-phase;\n", +"fo2=f/tand(k);\n", +"printf('\n Second break frequency fo2 is = %.1f Hz \n',fo2) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3: Stability_of_voltage_follower.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +" // Chapter5\n", +"// Page.No-83, Figure.No-3.7\n", +"// Example_5_3\n", +"// Stability of voltage follower\n", +"// Given\n", +"clear;clc;\n", +"fo=5; // Break freq of the op-amp in Hz\n", +"s=%s;\n", +"A=200000; // Gain of the op-amp at 0 Hz\n", +"H=syslin('c',(A*fo*2*%pi)/((fo*2*%pi)+s));\n", +"fmin=10;\n", +"fmax=1000000;\n", +"bode(H,fmin,fmax);\n", +"Aol=0;\n", +"printf('\n Magnitude at which voltage follower is stable is = %.f dB \n ',Aol); // From the graph" + ] + } +], +"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/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/6-General_Linear_Applications.ipynb b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/6-General_Linear_Applications.ipynb new file mode 100644 index 0000000..9c061fb --- /dev/null +++ b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/6-General_Linear_Applications.ipynb @@ -0,0 +1,649 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: General Linear Applications" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.10: Range_of_input_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-220, Figure.No-6.17\n", +"// Example_6_10\n", +"// Range of input voltage\n", +"// Given\n", +"clear;clc;\n", +"R1min=1*10^3;R1max=6.8*10^3;\n", +"io=1*10^-3; // Meter current for full-wave rectification\n", +"vin_min=1.1*R1min*io; // Minimum input voltage\n", +"printf('\n Minimum input voltage is = %.1f V \n',vin_min)\n", +"vin_max=1.1*R1max*io; // Maximum input voltage\n", +"printf('\n Maximum input voltage is = %.2f V \n',vin_max)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.11: Current_and_voltage_drop.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-222, Figure.No-6.18\n", +"// Example_6_11\n", +"// Current and voltage drop\n", +"// Given\n", +"clear;clc;\n", +"Vin=0.5;Vo=1.2;\n", +"R1=100;\n", +"Io=Vin/R1; // Current through diode\n", +"printf('\n Current through diode is = %.4f A \n',Io)\n", +"Vd=Vo-Vin; // Voltage drop across diode\n", +"printf('\n Voltage drop across diode is = %.1f V \n',Vd)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.12_a: Load_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-222, Figure.No-6.19\n", +"// Example_6_12_a\n", +"// Load current\n", +"// Given\n", +"clear;clc;\n", +"Vin=5;V1=1;\n", +"R=10*10^3;\n", +"Il=Vin/R; // Load current\n", +"printf('\n Load current is = %.5f A \n',Il)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.12_b: Output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-222, Figure.No-6.19\n", +"// Example_6_12_b\n", +"// Output voltage\n", +"// Given\n", +"clear;clc;\n", +"Vin=5;V1=1;\n", +"R=10*10^3;\n", +"Vo=2*V1; // Output voltage\n", +"printf('\n Output voltage is = %.f V \n',Vo)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.13: Range_of_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-222, Figure.No-6.20\n", +"// Example_6_13\n", +"// Range of output voltage\n", +"// Given\n", +"clear;clc;\n", +"R1=1*10^3;Rf=2.7*10^3;\n", +"Vref=2;\n", +"Io=0; // Since all the binary inputs D0 to D7 are logic zero\n", +"Vo_min=Io*Rf; // Minimum output voltage\n", +"printf('\n Minimum output voltage is = %.f V \n',Vo_min)\n", +"Io=(Vref/R1)*(1/2+1/4+1/8+1/16+1/32+1/64+1/128+1/256);\n", +"Vo_max=Io*Rf; // Maximum output voltage\n", +"printf('\n Maximum output voltage is = %.2f V \n',Vo_max)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.14: Change_in_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-228, Figure.No-6.21\n", +"// Example_6_14\n", +"// Change in output voltage\n", +"// Given\n", +"clear;clc;\n", +"Rf=3*10^3;\n", +"Vdc=5;\n", +"Rt=100*10^3; // Resistance at darkness\n", +"Vomin=-(Vdc/Rt)*Rf; // Min output voltage at darkness\n", +"printf('\n Min output voltage at darkness is = %.2f V \n',Vomin)\n", +"Rt=1.5*10^3; // Resistance at Illumination\n", +"Vomax=-(Vdc/Rt)*Rf; // Max output voltage at Illumination\n", +"printf('\n Max output voltage at Illumination is = %.f V \n',Vomax)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.15: Output_voltage_of_an_integrator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-230, Figure.No-6.23\n", +"// Example_6_15\n", +"// Output voltage of an integrator\n", +"// Given \n", +"clear;clc;\n", +"Vin=2; // Input voltage in volt\n", +"Vo0=0;\n", +"Vo1=-integrate('2','t',0,1);\n", +"disp(Vo1)\n", +"Vo2=-integrate('2','t',1,2)+Vo1;\n", +"disp(Vo2)\n", +"Vo3=-integrate('2','t',2,3)+Vo2;\n", +"disp(Vo3)\n", +"Vo4=-integrate('2','t',3,4)+Vo3;\n", +"disp(Vo4)\n", +"Vo=[Vo0 Vo1 Vo2 Vo3 Vo4];\n", +"t=[0 1 2 3 4];\n", +"plot(t,Vo);\n", +"title('Output Voltage');\n", +"xlabel('t');\n", +"ylabel('Vo');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.16_a: Design_of_differentiator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-238\n", +"// Example_6_16_a\n", +"// Design of differentiator\n", +"// Given\n", +"clear;clc;\n", +"C1=0.1*10^-6; // Assume\n", +"fa=1*10^3; // Freq at which gain is 0 dB\n", +"Rf=1/(2*%pi*fa*C1); // Using fa=1/(2*%pi*Rf*C1)\n", +"printf('\n Feedback resistance is = %.1f ohm \n',Rf)\n", +"Rf=1.5*10^3; // Approximation\n", +"fb=20*10^3; // Gain limiting freq\n", +"R1=1/(2*%pi*fb*C1);\n", +"printf('\n Resistance,R1 is = %.1f ohm \n',R1)\n", +"R1=82; // Approximation\n", +"Cf=R1*C1/Rf;\n", +"printf('\n Capacitance,Cf is = %.10f farad \n',Cf)\n", +"Cf=0.005*10^-6; // Approximation" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.16_b: Output_waveform_of_differentiator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-238\n", +"// Example_6_16_b\n", +"// Output waveform of differentiator\n", +"// Given\n", +"clear;clc;\n", +"step=0.01;\n", +"t=0:step:2*%pi;\n", +"dy=diff(sin(t))/step; //approximate differentiation of sine function\n", +"Vo=-1.5*10^3*0.1*10^-6*2*%pi*10^3*dy;\n", +"plot(Vo);\n", +"title('Output Voltage');\n", +"xlabel('t');\n", +"ylabel('Vo'); " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1: Bandwidth_of_the_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-193, Figure.No-6.3(a)\n", +"// Example_6_1\n", +"// Bandwidth of the amplifier\n", +"// Given\n", +"clear;clc;\n", +"R1=100;Rf=1*10^3;Rin=50;Rl=10*10^3;\n", +"Ci=0.1*10^-6; // Capacitance b/w 2 stages being coupled \n", +"RiF=R1; // ac input resistance of the second stage\n", +"Ro=Rin; // ac output resistance of the 1st stage\n", +"UGB=10^6; // Unity gain bandwidth\n", +"fl=1/(2*%pi*Ci*(RiF+Ro)); // Low-freq cutoff \n", +"printf('\n Low-freq cutoff is = %.1f Hz \n',fl) // Result\n", +"K=Rf/(R1+Rf);\n", +"Af=-Rf/R1; // closed loop voltage gain\n", +"fh=UGB*K/abs(Af); // High-freq cutoff\n", +"printf('\n High-freq cutoff is = %.1f Hz \n',fh) // Result\n", +"BW=fh-fl; // Bandwidth\n", +"printf('\n Bandwidth is = %.1f Hz \n',BW) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2_a: Bandwidth_of_the_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-193, Figure.No-6.4(c)\n", +"// Example_6_2_a\n", +"// Bandwidth of the amplifier\n", +"// Given\n", +"clear;clc;\n", +"R1=100*10^3;R2=100*10^3;R3=100*10^3;Rf=1*10^6;Rin=50;\n", +"Ci=0.1*10^-6; // Capacitance b/w 2 stages being coupled\n", +"Ro=Rin; // ac output resistance of the 1st stage\n", +"Vcc=15;\n", +"UGB=10^6; // Unity gain bandwidth\n", +"Rif=R2*R3/(R2+R3); // since Ri*(1+A*B)>>R2 or R3\n", +"fl=1/(2*%pi*Ci*(Rif+Ro)); // low-freq cutoff \n", +"printf('\n Low-freq cutoff is = %.1f Hz \n',fl) // Result\n", +"K=Rf/(R1+Rf);\n", +"Af=-Rf/R1; // closed loop voltage gain\n", +"fh=UGB*K/abs(Af); // High-freq cutoff\n", +"printf('\n High-freq cutoff is = %.1f Hz \n',fh) // Result\n", +"BW=fh-fl; // Bandwidth\n", +"printf('\n Bandwidth is = %.1f Hz \n',BW) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2_b: Max_output_voltage_swing.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-193, Figure.No-6.4(c)\n", +"// Example_6_2_b\n", +"// Max output voltage swing\n", +"// Given\n", +"clear;clc;\n", +"R1=100*10^3;R2=100*10^3;R3=100*10^3;Rf=1*10^6;Rin=50;\n", +"Ci=0.1*10^-6; // Capacitance b/w 2 stages being coupled\n", +"Ro=Rin; // ac output resistance of the 1st stage\n", +"UGB=10^6; // Unity gain bandwidth\n", +"Vcc=15;\n", +"printf('\n The ideal maximum output voltage swing is = %.f V pp \n',Vcc)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3: Components_of_peak_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-193, Figure.No-6.5(a)\n", +"// Example_6_3\n", +"// Components of peak amplifier\n", +"// Given\n", +"clear;clc;\n", +"fp=16*10^3; // Peak frequency\n", +"Af=10; // Gain at peak frequency\n", +"C=0.01*10^-6; // Assume\n", +"L=1/(((2*%pi*fp)^2)*10^-8); // Simplifying fp=1/(2*pi*sqrt(L*C))\n", +"printf('\n Inductance is = %.4f H \n',L)\n", +"L=10*10^-3; // Approximate\n", +"R=30; // Assume the value of internal resistance of the inductor\n", +"Xl=2*%pi*fp*L; // Inductive reactance\n", +"Qcoil=Xl/R; // Figure of merit of the coil\n", +"printf('\n Figure of merit of the coil is = %.1f \n',Qcoil)\n", +"Rp=(Qcoil)^2*R; // Parallel resistance of the tank circuit\n", +"printf('\n Parallel resistance of the tank circuit is = %.1f ohm \n',Rp)\n", +"R1=100; // Assume the value of internal resisrance of the coil\n", +"Rf=-Rp/(1-(Rp/(Af*R1))); // Simplifying Af=(Rf||Rp)/R1\n", +"printf('\n Feedback resistance is = %.1f ohm \n',Rf)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4: Output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-200, Figure.No-6.6\n", +"// Example_6_4\n", +"// Output voltage\n", +"// Given\n", +"clear;clc;\n", +"Va=1;Vb=2;Vc=3; // Input voltages in volts\n", +"Ra=3*10^3;Rb=3*10^3;Rc=3*10^3;Rf=1*10^3;\n", +"Vo=-((Rf/Ra)*Va+(Rf/Rb)*Vb+(Rf/Rc)*Vc); // Output voltage\n", +"printf('\n Output voltage is = %.f V \n',Vo)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5: Output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-203, Figure.No-6.7\n", +"// Example_6_5\n", +"// Output voltage\n", +"// Given\n", +"clear;clc;\n", +"Va=2;Vb=-3;Vc=4; // Input voltages in volts\n", +"R1=1*10^3;Rf=2*10^3;\n", +"V1=(Va+Vb+Vc)/3; // Voltage at non-inverting terminal\n", +"printf('\n Voltage at non-inverting terminal is = %.f V \n',V1)\n", +"Vo=(1+Rf/R1)*V1; // Output voltage\n", +"printf('\n Output voltage is = %.f V \n',Vo)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6: Output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-205, Figure.No-6.9\n", +"// Example_6_6\n", +"// Output voltage\n", +"// Given\n", +"clear;clc;\n", +"Va=2;Vb=3;Vc=4;Vd=5; // Input voltages in volts\n", +"R=1*10^3;\n", +"Vo=-Va-Vb+Vc+Vd; // Output voltage\n", +"printf('\n Output voltage is = %.f V \n',Vo)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.7: Output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-209, Figure.No-6.12\n", +"// Example_6_7\n", +"// Output voltage\n", +"// Given\n", +"clear;clc;\n", +"R1=1*10^3;Rf=4.7*10^3;Ra=100*10^3;Rb=100*10^3;Rc=100*10^3;\n", +"Vdc=5;\n", +"Rt=100*10^3; // Resistance of a thermistor\n", +"temp_coeff=1*10^3;\n", +"\n", +"// Output voltage at 0 degree\n", +"delta_R=-temp_coeff*(0-25); // Change in resistance\n", +"R=Ra; // Ra=Rb=Rc=R\n", +"Vo=((Rf*delta_R)/(R1*4*R))*Vdc;\n", +"printf('\n Output voltage at 0 degree is = %.2f V \n',Vo)\n", +"\n", +"// Output voltage at 100 degree\n", +"delta_R=-temp_coeff*(100-25); // Change in resistance\n", +"Vo=((Rf*delta_R)/(R1*4*R))*Vdc;\n", +"printf('\n Output voltage at 100 degree is = %.2f V \n',Vo)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.8: Change_in_resistance_in_straingage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-209, Figure.No-6.12\n", +"// Example_6_7\n", +"// Change in resistance in straingage\n", +"// Given\n", +"clear;clc;\n", +"A=-100; // Gain of the differential instrumentation amplifier\n", +"Ra=100;Rb=100;Rc=100;\n", +"Vdc=10;Vo=1;\n", +"R=Ra; // Ra=Rb=Rc=R\n", +"delta_R=(Vo*R)/(Vdc*abs(A)); // Change in resistance\n", +"printf('\n Change in resistance is = %.1f ohm \n',delta_R)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.9: Gain_of_the_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter6\n", +"// Page.No-216, Figure.No-6.14(a)\n", +"// Example_6_9\n", +"// Gain of the amplifier\n", +"// Given\n", +"clear;clc;\n", +"Vo=3.7;Vin=100*10^-3;\n", +"R1=100; // Assume\n", +"Rf=0.5*((Vo*R1)/Vin-1); // Feedback resisrance\n", +"printf('\n Feedback resisrance is = %.1f ohm \n',Rf)\n", +"A=(1+2*Rf/R1); // Gain of the differential amplifier\n", +"printf('\n Gain of the differential amplifier is = %.1f \n',A)" + ] + } +], +"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/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/7-Active_Filters_and_Oscillators.ipynb b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/7-Active_Filters_and_Oscillators.ipynb new file mode 100644 index 0000000..e42389a --- /dev/null +++ b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/7-Active_Filters_and_Oscillators.ipynb @@ -0,0 +1,960 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7: Active Filters and Oscillators" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.10: Design_of_notch_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-277\n", +"// Example_7_10\n", +"// Design of notch filter\n", +"// Given\n", +"clear;clc;\n", +"fn=60; // Notch-out frequency in Hz\n", +"C=0.068*10^-6; // Assumption\n", +"R=1/(2*%pi*fn*C);\n", +"printf('\n Resistance R is = %.1f ohm \n',R) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.11: Phase_angle.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-279\n", +"// Example_7_11\n", +"// Phase angle\n", +"// Given\n", +"clear;clc;\n", +"f=1*10^3; // Input frequency in Hz\n", +"C=0.01*10^-6; \n", +"R=15.9*10^3;\n", +"phi=-2*atand(2*%pi*f*C*R); // Phase angle\n", +"printf('\n Phase angle phi is = %.f deg \n',phi) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.12: Design_of_phase_shift_oscillator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-282\n", +"// Example_7_1\n", +"// Design of phase shift oscillator\n", +"// Given\n", +"clear;clc;\n", +"fo=200; // Frequency of oscillation\n", +"C=0.1*10^-6; // Assumption\n", +"R=0.065/(fo*C);\n", +"printf('\n Resistance R is = %.1f ohm \n',R) // Result\n", +"printf('\n Use Resistance R as 3.3 kohm \n')\n", +"R=3.3*10^3;\n", +"R1=10*R; // To prevent loading of amplifier\n", +"Rf=29*R1;\n", +"printf('\n Resistance Rf is = %.1f ohm \n',Rf) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.13: Design_of_wein_bridge_oscillator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-282\n", +"// Example_7_13\n", +"// Design of wein bridge oscillator\n", +"// Given\n", +"clear;clc;\n", +"fo=965; // Frequency of oscillation\n", +"C=0.05*10^-6; // Assumption\n", +"R=0.159/(fo*C);\n", +"printf('\n Resistance R is = %.1f ohm \n',R) // Result\n", +"R1=12*10^3; // Assumption\n", +"Rf=2*R1;\n", +"printf('\n Resistance Rf is = %.1f ohm \n',Rf) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.14: Design_of_quadrature_oscillator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-285\n", +"// Example_7_14\n", +"// Design of quadrature oscillator\n", +"// Given\n", +"clear;clc;\n", +"fo=159; // Frequency of oscillation\n", +"C=0.01*10^-6; // Assumption\n", +"R=0.159/(fo*C);\n", +"printf('\n Resistance values R1,R2,R3 is = %.1f ohm \n',R) // R1=R2=R3=R\n", +"printf('\n Capacitance values C1,C2,C3 is = %.8f farad \n',C) // C1=C2=C3=C" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.15: Design_of_squarewave_oscillator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-287\n", +"// Example_7_15\n", +"// Design of squarewave oscillator\n", +"// Given\n", +"clear;clc;\n", +"fo=1*10^3;; // Frequency of oscillation\n", +"R1=10*10^3; // Assumption\n", +"C=0.05*10^-6; // Assumption\n", +"R2=1.16*R1;\n", +"printf('\n Resistance R2 is = %.1f ohm \n',R2) // Result\n", +"R=1/(2*fo*C);\n", +"printf('\n Resistance R is = %.1f ohm \n',R) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.16: Design_of_triangular_wave_generator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-291\n", +"// Example_7_16\n", +"// Design of triangular wave generator\n", +"// Given\n", +"clear;clc;\n", +"fo=2*10^3; // Frequency of oscillation\n", +"vo=7; // Output voltage\n", +"Vsat=14; // Saturation voltage for opamp 1458\n", +"R3=40*10^3; // Assumption\n", +"R2=(vo*R3)/(2*Vsat);\n", +"printf('\n Resistance R2 is = %.1f ohm \n',R2) // Result\n", +"k=R3/(4*fo*R2); // Using fo=R3/(4*R1*C1*R2),k=R1*C1;\n", +"C1=0.05*10^-6; // Assumption\n", +"R1=k/C1;\n", +"printf('\n Resistance R1 is = %.1f ohm \n',R1) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.17_a: Nominal_frequency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-296\n", +"// Example_7_17_a\n", +"// Nominal frequency\n", +"// Given\n", +"clear;clc;\n", +"R2=1.5*10^3;\n", +"R1=10*10^3;\n", +"R3=10*10^3;\n", +"C1=0.001*10^-6;\n", +"V=12; // Supply voltage\n", +"Vc=R3*V/(R2+R3); // Using voltage divider rule\n", +"printf('\n Terminal voltage Vc is = %.2f V \n',Vc) // Result\n", +"fo=2*(V-Vc)/(V*R1*C1);\n", +"printf('\n Approximate Nominal freq fo is = %.1f Hz \n',fo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.17_b: Modulation_in_output_frequency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-296\n", +"// Example_7_17_b\n", +"// Modulation in output frequency\n", +"// Given\n", +"clear;clc;\n", +"R2=1.5*10^3;\n", +"R1=10*10^3;\n", +"R3=10*10^3;\n", +"C1=0.001*10^-6;\n", +"V=12; // Supply voltage\n", +"Vc1=9.5;\n", +"Vc2=11.5;\n", +"fo1=2*(V-Vc1)/(V*R1*C1);\n", +"printf('\n Approximate Nominal freq fo1 is = %.1f Hz \n',fo1) // Result\n", +"fo2=2*(V-Vc2)/(V*R1*C1);\n", +"printf('\n Approximate Nominal freq fo2 is = %.1f Hz \n',fo2) // Result\n", +"delta_fo=fo1-fo2; // Change in output freq\n", +"printf('\n Change in output freq delta_fo is = %.1f Hz \n',delta_fo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.1: Design_of_low_pass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-256\n", +"// Example_7_1\n", +"// Design of low pass filter\n", +"// Given\n", +"clear;clc;\n", +"fh=1*10^3; // Cut-off frequency\n", +"C=0.01*10^-6; // Assumption\n", +"R=1/(2*%pi*fh*C);\n", +"printf('\n Resistance R is = %.1f ohm \n',R) // Result\n", +"printf('\n Use 20 kohm POT as R \n')\n", +"R1=10*10^3; // Assumption\n", +"printf('\n Resistance R1 is = %.1f ohm \n',R1)\n", +"Rf=R1; // Sice passband gain is 2,R1 and Rf must be equal\n", +"printf('\n Resistance Rf is = %.1f ohm \n',Rf)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.2: Design_of_low_pass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-256\n", +"// Example_7_2\n", +"// Design of low pass filter\n", +"// Given\n", +"clear;clc;\n", +"fc0=1*10^3; // Original cut-off frequency\n", +"fc1=1.6*10^3; // New cut-off frequency\n", +"R=15.9*10^3; // Original resistance value\n", +"k=fc0/fc1;\n", +"Rnew=R*k;\n", +"printf('\n New Resistance Rnew is = %.1f ohm \n',Rnew) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.3: Frequency_response_of_low_pass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-257\n", +"// Example_7_3\n", +"// Frequency response of low pass filter\n", +"// Given\n", +"clear;clc;\n", +"Af=2; // Passband gain of the filter\n", +"fh=1000; // Cut-off frequency\n", +"f1=10; // Input freq in Hz\n", +"av1=Af/sqrt(1+(f1/fh)^2);\n", +"printf('\n Gain magnitude av1 at f1 is = %.2f \n',av1) // Result\n", +"f2=100; // Freq in Hz\n", +"av2=Af/sqrt(1+(f2/fh)^2);\n", +"printf('\n Gain magnitude av2 at f2 is = %.2f \n',av2) // Result\n", +"f3=200; // Freq in Hz\n", +"av3=Af/sqrt(1+(f3/fh)^2);\n", +"printf('\n Gain magnitude av3 at f3 is = %.2f \n',av3) // Result\n", +"f4=700; // Freq in Hz\n", +"av4=Af/sqrt(1+(f4/fh)^2);\n", +"printf('\n Gain magnitude av4 at f4 is = %.2f \n',av4) // Result\n", +"f5=1000; // Freq in Hz\n", +"av5=Af/sqrt(1+(f5/fh)^2);\n", +"printf('\n Gain magnitude av5 at f5 is = %.2f \n',av5) // Result\n", +"f6=3000; // Freq in Hz\n", +"av6=Af/sqrt(1+(f6/fh)^2);\n", +"printf('\n Gain magnitude av6 at f6 is = %.2f \n',av6) // Result\n", +"f7=7000; // Freq in Hz\n", +"av7=Af/sqrt(1+(f7/fh)^2);\n", +"printf('\n Gain magnitude av7 at f7 is = %.2f \n',av7) // Result\n", +"f8=10000; // Freq in Hz\n", +"av8=Af/sqrt(1+(f8/fh)^2);\n", +"printf('\n Gain magnitude av8 at f8 is = %.2f \n',av8) // Result\n", +"f9=30000; // Freq in Hz\n", +"av9=Af/sqrt(1+(f9/fh)^2);\n", +"printf('\n Gain magnitude av9 at f9 is = %.2f \n',av9) // Result\n", +"f10=100000; // Freq in Hz\n", +"av10=Af/sqrt(1+(f10/fh)^2);\n", +"printf('\n Gain magnitude av10 at f10 is = %.2f \n',av10) // Result\n", +"x=[f1 f2 f3 f4 f5 f6 f7 f8 f9 f10];\n", +"y=[av1 av2 av3 av4 av5 av6 av7 av8 av9 av10];\n", +"gainplot(x,y);\n", +"title('Frequency Response');\n", +"xlabel('Frequency(Hz)');\n", +"ylabel('Voltage gain(dB)');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.4_a: Design_of_second_order_low_pass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-256\n", +"// Example_7_4_a\n", +"// Design of second order low pass filter\n", +"// Given\n", +"clear;clc;\n", +"fh=1*10^3; // Cut-off frequency\n", +"C2=0.0047*10^-6; // Assumption\n", +"C3=C2;\n", +"R2=1/(2*%pi*fh*C2);\n", +"printf('\n Resistance R2 is = %.1f ohm \n',R2) // Result\n", +"R2=33*10^3; // Approximation\n", +"R3=R2;\n", +"printf('\n Resistance R3 is = %.1f ohm \n',R3) // Result\n", +"R1=27*10^3; // Assumption\n", +"Rf=0.586*R1;\n", +"printf('\n Resistance Rf is = %.1f ohm \n',Rf) // Result\n", +"printf('\n Use 20 kohm POT as Rf \n')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.4_b: Frequency_response_of_second_order_highpass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-260\n", +"// Example_7_4_b\n", +"// Frequency response of second order highpass filter\n", +"// Given\n", +"clear;clc;\n", +"Af=1.586; // Passband gain of the filter\n", +"fh=1000; // Cut-off frequency\n", +"f1=10; // Input freq in Hz\n", +"av1=Af/sqrt(1+(f1/fh)^4);\n", +"printf('\n Gain magnitude av1 at f1 is = %.2f \n',av1) // Result\n", +"f2=100; // Freq in Hz\n", +"av2=Af/sqrt(1+(f2/fh)^4);\n", +"printf('\n Gain magnitude av2 at f2 is = %.2f \n',av2) // Result\n", +"f3=200; // Freq in Hz\n", +"av3=Af/sqrt(1+(f3/fh)^4);\n", +"printf('\n Gain magnitude av3 at f3 is = %.2f \n',av3) // Result\n", +"f4=700; // Freq in Hz\n", +"av4=Af/sqrt(1+(f4/fh)^4);\n", +"printf('\n Gain magnitude av4 at f4 is = %.2f \n',av4) // Result\n", +"f5=1000; // Freq in Hz\n", +"av5=Af/sqrt(1+(f5/fh)^4);\n", +"printf('\n Gain magnitude av5 at f5 is = %.2f \n',av5) // Result\n", +"f6=3000; // Freq in Hz\n", +"av6=Af/sqrt(1+(f6/fh)^4);\n", +"printf('\n Gain magnitude av6 at f6 is = %.2f \n',av6) // Result\n", +"f7=7000; // Freq in Hz\n", +"av7=Af/sqrt(1+(f7/fh)^4);\n", +"printf('\n Gain magnitude av7 at f7 is = %.2f \n',av7) // Result\n", +"f8=10000; // Freq in Hz\n", +"av8=Af/sqrt(1+(f8/fh)^4);\n", +"printf('\n Gain magnitude av8 at f8 is = %.2f \n',av8) // Result\n", +"f9=30000; // Freq in Hz\n", +"av9=Af/sqrt(1+(f9/fh)^4);\n", +"printf('\n Gain magnitude av9 at f9 is = %.5f \n',av9) // Result\n", +"f10=100000; // Freq in Hz\n", +"av10=Af/sqrt(1+(f10/fh)^4);\n", +"printf('\n Gain magnitude av10 at f10 is = %.6f \n',av10) // Result\n", +"x=[f1 f2 f3 f4 f5 f6 f7 f8 f9 f10];\n", +"y=[av1 av2 av3 av4 av5 av6 av7 av8 av9 av10];\n", +"gainplot(x,y);\n", +"title('Frequency Response');\n", +"xlabel('Frequency(Hz)');\n", +"ylabel('Voltage gain(dB)');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.5_a: Design_of_highpass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-263\n", +"// Example_7_5_a\n", +"// Design of highpass filter\n", +"// Given\n", +"clear;clc;\n", +"fh=1*10^3; // Cut-off frequency\n", +"Af=2; // Passband gain of the filter\n", +"C=0.01*10^-6; // Assumption\n", +"R=1/(2*%pi*fh*C);\n", +"printf('\n Resistance R is = %.1f ohm \n',R) // Result\n", +"printf('\n Use 20 kohm POT as R \n')\n", +"R1=10*10^3; // Assumption\n", +"printf('\n Resistance R1 is = %.1f ohm \n',R1)\n", +"Rf=R1; // Sice passband gain is 2,R1 and Rf must be equal\n", +"printf('\n Resistance Rf is = %.1f ohm \n',Rf)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.5_b: Frequency_response_of_highpass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-263\n", +"// Example_7_5_b\n", +"// Frequency response of highpass filter\n", +"// Given\n", +"clear;clc;\n", +"Af=2; // Passband gain of the filter\n", +"fl=1000; // Cut-off frequency\n", +"f1=100; // Input freq in Hz\n", +"av1=(Af*(f1/fl))/sqrt(1+(f1/fl)^2);\n", +"printf('\n Gain magnitude av1 at f1 is = %.2f \n',av1) // Result\n", +"f2=200; // Freq in Hz\n", +"av2=(Af*(f2/fl))/sqrt(1+(f2/fl)^2);\n", +"printf('\n Gain magnitude av2 at f2 is = %.2f \n',av2) // Result\n", +"f3=400; // Freq in Hz\n", +"av3=(Af*(f3/fl))/sqrt(1+(f3/fl)^2);\n", +"printf('\n Gain magnitude av3 at f3 is = %.2f \n',av3) // Result\n", +"f4=700; // Freq in Hz\n", +"av4=(Af*(f4/fl))/sqrt(1+(f4/fl)^2);\n", +"printf('\n Gain magnitude av4 at f4 is = %.2f \n',av4) // Result\n", +"f5=1000; // Freq in Hz\n", +"av5=(Af*(f5/fl))/sqrt(1+(f5/fl)^2);\n", +"printf('\n Gain magnitude av5 at f5 is = %.2f \n',av5) // Result\n", +"f6=3000; // Freq in Hz\n", +"av6=(Af*(f6/fl))/sqrt(1+(f6/fl)^2);\n", +"printf('\n Gain magnitude av6 at f6 is = %.2f \n',av6) // Result\n", +"f7=7000; // Freq in Hz\n", +"av7=(Af*(f7/fl))/sqrt(1+(f7/fl)^2);\n", +"printf('\n Gain magnitude av7 at f7 is = %.2f \n',av7) // Result\n", +"f8=10000; // Freq in Hz\n", +"av8=(Af*(f8/fl))/sqrt(1+(f8/fl)^2);\n", +"printf('\n Gain magnitude av8 at f8 is = %.2f \n',av8) // Result\n", +"f9=30000; // Freq in Hz\n", +"av9=(Af*(f9/fl))/sqrt(1+(f9/fl)^2);\n", +"printf('\n Gain magnitude av9 at f9 is = %.2f \n',av9) // Result\n", +"f10=100000; // Freq in Hz\n", +"av10=(Af*(f10/fl))/sqrt(1+(f10/fl)^2);\n", +"printf('\n Gain magnitude av10 at f10 is = %.2f \n',av10) // Result\n", +"x=[f1 f2 f3 f4 f5 f6 f7 f8 f9 f10];\n", +"y=[av1 av2 av3 av4 av5 av6 av7 av8 av9 av10];\n", +"gainplot(x,y);\n", +"title('Frequency Response');\n", +"xlabel('Frequency(Hz)');\n", +"ylabel('Voltage gain(dB)');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.6_a: Determination_of_low_cutoff_frequency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-264\n", +"// Example_7_6\n", +"// Determination of low cutoff frequency\n", +"// Given\n", +"clear;clc;\n", +"R2=33*10^3;\n", +"R3=R2;\n", +"C2=0.0047*10^-6;\n", +"C3=C2;\n", +"fl=1/(2*%pi*sqrt(R2*R3*C2*C3));\n", +"printf('\n Low cutoff freq fl is = %.1f Hz \n',fl) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.6_b: Frequency_response_of_second_order_highpass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-264\n", +"// Example_7_6_b\n", +"// Frequency response of second order highpass filter\n", +"// Given\n", +"clear;clc;\n", +"Af=1.586; // Passband gain of the filter\n", +"fl=1000; // Cut-off frequency\n", +"f1=100; // Input freq in Hz\n", +"av1=Af/sqrt(1+(fl/f1)^4);\n", +"printf('\n Gain magnitude av1 at f1 is = %.5f \n',av1) // Result\n", +"f2=200; // Freq in Hz\n", +"av2=Af/sqrt(1+(fl/f2)^4);\n", +"printf('\n Gain magnitude av2 at f2 is = %.4f \n',av2) // Result\n", +"f3=700; // Freq in Hz\n", +"av3=Af/sqrt(1+(fl/f3)^4);\n", +"printf('\n Gain magnitude av3 at f3 is = %.4f \n',av3) // Result\n", +"f4=1000; // Freq in Hz\n", +"av4=Af/sqrt(1+(fl/f4)^4);\n", +"printf('\n Gain magnitude av4 at f4 is = %.4f \n',av4) // Result\n", +"f5=3000; // Freq in Hz\n", +"av5=Af/sqrt(1+(fl/f5)^4);\n", +"printf('\n Gain magnitude av5 at f5 is = %.4f \n',av5) // Result\n", +"f6=7000; // Freq in Hz\n", +"av6=Af/sqrt(1+(fl/f6)^4);\n", +"printf('\n Gain magnitude av6 at f6 is = %.4f \n',av6) // Result\n", +"f7=10000; // Freq in Hz\n", +"av7=Af/sqrt(1+(fl/f7)^4);\n", +"printf('\n Gain magnitude av7 at f7 is = %.4f \n',av7) // Result\n", +"f8=30000; // Freq in Hz\n", +"av8=Af/sqrt(1+(fl/f8)^4);\n", +"printf('\n Gain magnitude av8 at f8 is = %.4f \n',av8) // Result\n", +"f9=100000; // Freq in Hz\n", +"av9=Af/sqrt(1+(fl/f9)^4);\n", +"printf('\n Gain magnitude av9 at f9 is = %.4f \n',av9) // Result\n", +"x=[f1 f2 f3 f4 f5 f6 f7 f8 f9];\n", +"y=[av1 av2 av3 av4 av5 av6 av7 av8 av9];\n", +"gainplot(x,y);\n", +"title('Frequency Response');\n", +"xlabel('Frequency(Hz)');\n", +"ylabel('Voltage gain(dB)');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.7_a: Design_of_wide_bandpass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-270\n", +"// Example_7_7_a\n", +"// Design of wide bandpass filter\n", +"// Given\n", +"clear;clc;\n", +"fl=200; // Low cutoff freq in Hz\n", +"fh=1*10^3; // High cutoff freq in Hz\n", +"C1=0.01*10^-6; // Assumption\n", +"R1=1/(2*%pi*fh*C1);\n", +"printf('\n Resistance R1 is = %.1f ohm \n', R1) // Result\n", +"C=0.05*10^-6;\n", +"R=1/(2*%pi*fl*C);\n", +"printf('\n Resistance R is = %.1f ohm \n', R) // Result\n", +"printf('\n Bandpass Gain Af is = 4 \n') // Since gain of high pass and lowpass is set to 2\n", +"R1=10*10^3; // Assumption\n", +"printf('\n Resistance R1 is = %.1f ohm \n',R1)\n", +"Rf=R1; // Sice passband gain is 2,R1 and Rf must be equal\n", +"printf('\n Resistance Rf is = %.1f ohm \n',Rf)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.7_b: Frequency_response_of_bandpass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-270\n", +"// Example_7_7_b\n", +"// Frequency response of bandpass filter\n", +"// Given\n", +"clear;clc;\n", +"Aft=4; // Passband gain of the filter\n", +"fl=200; // Lower Cut-off frequency\n", +"fh=1000; // Higher Cut-off frequency\n", +"f1=10; // Input freq in Hz\n", +"av1=(Aft*(f1/fl))/sqrt((1+(f1/fl)^2)*(1+(f1/fh)^2));\n", +"printf('\n Gain magnitude av1 at f1 is = %.4f \n',av1) // Result\n", +"f2=30; // Freq in Hz\n", +"av2=(Aft*(f2/fl))/sqrt((1+(f2/fl)^2)*(1+(f2/fh)^2));\n", +"printf('\n Gain magnitude av2 at f2 is = %.4f \n',av2) // Result\n", +"f3=100; // Freq in Hz\n", +"av3=(Aft*(f3/fl))/sqrt((1+(f3/fl)^2)*(1+(f3/fh)^2));\n", +"printf('\n Gain magnitude av3 at f3 is = %.4f \n',av3) // Result\n", +"f4=200; // Freq in Hz\n", +"av4=(Aft*(f4/fl))/sqrt((1+(f4/fl)^2)*(1+(f4/fh)^2));\n", +"printf('\n Gain magnitude av4 at f4 is = %.4f \n',av4) // Result\n", +"f5=447.2; // Freq in Hz\n", +"av5=(Aft*(f5/fl))/sqrt((1+(f5/fl)^2)*(1+(f5/fh)^2));\n", +"printf('\n Gain magnitude av5 at f5 is = %.4f \n',av5) // Result\n", +"f6=700; // Freq in Hz\n", +"av6=(Aft*(f6/fl))/sqrt((1+(f6/fl)^2)*(1+(f6/fh)^2));\n", +"printf('\n Gain magnitude av6 at f6 is = %.4f \n',av6) // Result\n", +"f7=1000; // Freq in Hz\n", +"av7=(Aft*(f7/fl))/sqrt((1+(f7/fl)^2)*(1+(f7/fh)^2));\n", +"printf('\n Gain magnitude av7 at f7 is = %.4f \n',av7) // Result\n", +"f8=2000; // Freq in Hz\n", +"av8=(Aft*(f8/fl))/sqrt((1+(f8/fl)^2)*(1+(f8/fh)^2));\n", +"printf('\n Gain magnitude av8 at f8 is = %.4f \n',av8) // Result\n", +"f9=7000; // Freq in Hz\n", +"av9=(Aft*(f9/fl))/sqrt((1+(f9/fl)^2)*(1+(f9/fh)^2));\n", +"printf('\n Gain magnitude av9 at f9 is = %.4f \n',av9) // Result\n", +"f10=10000; // Freq in Hz\n", +"av10=(Aft*(f10/fl))/sqrt((1+(f10/fl)^2)*(1+(f10/fh)^2));\n", +"printf('\n Gain magnitude av10 at f10 is = %.4f \n',av10) // Result\n", +"x=[f1 f2 f3 f4 f5 f6 f7 f8 f9 f10];\n", +"y=[av1 av2 av3 av4 av5 av6 av7 av8 av9 av10];\n", +"gainplot(x,y);\n", +"title('Frequency Response');\n", +"xlabel('Frequency(Hz)');\n", +"ylabel('Voltage gain(dB)');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.7_c: Calculation_of_quality_factor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-270\n", +"// Example_7_7_c\n", +"// Calculation of quality factor\n", +"// Given\n", +"clear;clc;\n", +"fh=1*10^3; // Higher cut-off frequency\n", +"fl=200; // Lower cut-off frequency\n", +"fc=sqrt(fl*fh); // Center frequency\n", +"printf('\n Center frequency fc is = %.1f Hz \n',fc) // Result\n", +"Q=fc/(fh-fl); // Quality factor\n", +"printf('\n Quality factor Q is = %.2f \n',Q) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.8_a: Design_of_narrow_bandpass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-272\n", +"// Example_7_8_a\n", +"// Design of narrow bandpass filter\n", +"// Given\n", +"clear;clc;\n", +"fc=1*10^3; // Center frequency\n", +"Q=3; // Quality factor\n", +"Af=10; // Passband gain\n", +"C1=0.01*10^-6; // Assumption\n", +"C2=C1;\n", +"R1=Q/(2*%pi*fc*C1*Af);\n", +"R2=Q/(2*%pi*fc*C1*(2*Q^2-Af));\n", +"R3=Q/(%pi*fc*C1);\n", +"printf('\n Resistance R1 is = %.1f ohm \n', R1) // Result\n", +"printf('\n Resistance R2 is = %.1f ohm \n', R2) // Result\n", +"printf('\n Resistance R3 is = %.1f ohm \n', R3) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.8_b: Design_of_narrow_bandpass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-272\n", +"// Example_7_8_a\n", +"// Design of narrow bandpass filter\n", +"// Given\n", +"clear;clc;\n", +"fc0=1*10^3; // Original center frequency\n", +"fc1=1.5*10^3; // New center frequency\n", +"R2=5.97*10^3; // Original resistance\n", +"R2new=R2*(fc0/fc1)^2;\n", +"printf('\n Resistance R1 is = %.1f ohm \n', R2new) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.9: Design_of_wide_bandreject_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter7\n", +"// Page.No-274\n", +"// Example_7_9\n", +"// Design of wide bandreject filter\n", +"// Given\n", +"clear;clc;\n", +"fh=200; // Low cutoff freq in Hz\n", +"fl=1*10^3; // High cutoff freq in Hz\n", +"C2=0.01*10^-6; // Assumption\n", +"R2=1/(2*%pi*fl*C2);\n", +"printf('\n Resistance R2 of highpass section is = %.1f ohm \n', R2) // Result\n", +"C=0.05*10^-6;\n", +"R=1/(2*%pi*fh*C);\n", +"printf('\n Resistance R of lowpass section is = %.1f ohm \n', R) // Result\n", +"printf('\n Bandpass Gain Af is = 4 \n') // Since gain of high pass and lowpass is set to 2\n", +"R1=10*10^3; // Assumption\n", +"printf('\n Resistance R1 is = %.1f ohm \n',R1)\n", +"Rf=R1; // Since passband gain is 2,R1 and Rf must be equal\n", +"printf('\n Resistance Rf is = %.1f ohm \n',Rf)" + ] + } +], +"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/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/8-Comparators_and_Converters.ipynb b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/8-Comparators_and_Converters.ipynb new file mode 100644 index 0000000..20a0ac0 --- /dev/null +++ b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/8-Comparators_and_Converters.ipynb @@ -0,0 +1,266 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Comparators and Converters" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1: Threshold_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter8\n", +"// Page.No-320, Figure.No-8.4(a)\n", +"// Example_8_1\n", +"// Threshold voltage\n", +"// Given\n", +"clear;clc;\n", +"R1=100;R2=56*10^3;\n", +"vin=1; // Input voltage in volt\n", +"pos_Vsat=14; // Positive saturation voltage in volt\n", +"neg_Vsat=-14; // Negative saturation voltage in volt\n", +"Vut=(R1/(R1+R2))*(pos_Vsat); // Upper threshold voltage\n", +"printf('\n Upper threshold voltage is = %.4f V \n',Vut) // Result\n", +"Vlt=(R1/(R1+R2))*(neg_Vsat); // Lower threshold voltage\n", +"printf('\n Lower threshold voltage is = %.4f V \n',Vlt) // Result\n", +"t=0:0.1:2*%pi;\n", +"vut=0.5*sin(t);\n", +"subplot(2,1,1);\n", +"plot(t,vut);\n", +"title('Input Voltage');\n", +"xlabel('t');\n", +"ylabel('Vin');\n", +"c=0;\n", +"for i=0:0.1:2*%pi\n", +" c=c+1;\n", +"end\n", +"for i=1:c;\n", +"if vut(i)>0.025\n", +" v(i)=-14;\n", +"else if vut(i)<-0.025\n", +" v(i)=14;\n", +"end\n", +"end\n", +"end\n", +"subplot(2,1,2);\n", +"plot(t,v);\n", +"title('Output Waveform');\n", +"xlabel('t');\n", +"ylabel('Vo');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2: Output_voltage_swing.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter8\n", +"// Page.No-326, Figure.No-8.7(a)\n", +"// Example_8_2\n", +"// Output voltage swing\n", +"// Given\n", +"clear;clc;\n", +"vin=5*10^-3;\n", +"R=100;\n", +"Vd1=-0.7; // Output voltage during positive half-cycle of the input\n", +"Vd2=5.1; // Output voltage during negative half-cycle of the input\n", +"printf('\n Output voltage during positive half-cycle of the input is = %.1f V \n',Vd1) // Since zener diode is forward biased\n", +"printf('\n Output voltage during negative half-cycle of the input is = %.1f V \n',Vd2) // Since zener diode is reverse-biased\n", +"t=0:0.1:2*%pi;\n", +"vut=0.5*sin(t);\n", +"subplot(2,1,1);\n", +"plot(t,vut);\n", +"title('Input Voltage');\n", +"xlabel('t');\n", +"ylabel('Vin');\n", +"c=1;\n", +"for t=0:0.1:2*%pi\n", +"if t<%pi\n", +" v(c)=-0.7;\n", +" else\n", +" v(c)=5.1;\n", +"end\n", +"c=c+1;\n", +"subplot(2,1,2);\n", +"plot(v);\n", +"end\n", +"title('Output Waveform');\n", +"xlabel('t');\n", +"ylabel('Vo');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3: Output_frequencies.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter8\n", +"// Page.No-320, Figure.No-8.12\n", +"// Example_8_3\n", +"// Output frequencies\n", +"// Given\n", +"clear;clc;\n", +"Vin=2; // Input voltage\n", +"Fo1=2*10^3; // Output freq Fo when Vin=2V\n", +"Fo2=1*10^3; // Output freq Fo/2 when Vin=2V\n", +"printf('\n Output freq Fo is = %.f Hz \n',Fo1) // Result\n", +"printf('\n Output freq Fo/2 is = %.f Hz \n',Fo2) // Result\n", +"count=1;\n", +"for i=1:50; //for 5 cycles\n", +"if count<4;\n", +" v(i)=5;\n", +" else\n", +" v(i)=0;\n", +"end\n", +"if count<10\n", +" count=count+1;\n", +"else\n", +" count=1;\n", +"end\n", +"end\n", +"subplot(2,1,1);\n", +"plot(v);\n", +"title('Output Waveform');\n", +"xlabel('t(microsec)');\n", +"ylabel('Pulse freq output,Fo(V)');\n", +"for i=1:50; //for 5 cycles\n", +"if count<10;\n", +" v(i)=5;\n", +" else\n", +" v(i)=0;\n", +"end\n", +"if count<20\n", +" count=count+1;\n", +"else\n", +" count=1;\n", +"end\n", +"end\n", +"subplot(2,1,2);\n", +"plot(v);\n", +"title('Output Waveform');\n", +"xlabel('t(microsec)');\n", +"ylabel('Pulse freq output,Fo/2(V)');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4: Output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter8\n", +"// Page.No-335, Figure.No-8.14(a)\n", +"// Example_8_4\n", +"// Output voltage\n", +"// Given\n", +"clear;clc;\n", +"Vo=2.8; // At Finmax of 10kHz\n", +"Vo1=Vo/10; // Output voltage at Fin=1kHz\n", +"printf('\n Output voltage is = %.2f V \n',Vo1) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5: Output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter8\n", +"// Page.No-335, Figure.No-8.25(a)\n", +"// Example_8_5\n", +"// Output voltage\n", +"// Given\n", +"clear;clc;\n", +"vin=100*10^-3;\n", +"t=0:0.1:2*%pi;\n", +"i=1;\n", +"for t=0:0.1:2*%pi;\n", +" if t<=%pi\n", +" v(i)=vin*sin(t);\n", +" else\n", +" v(i)=0;\n", +" end\n", +" i=i+1;\n", +"end\n", +"t=0:0.1:2*%pi;\n", +"plot(t,v)" + ] + } +], +"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/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/9-Specialized_IC_Applications.ipynb b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/9-Specialized_IC_Applications.ipynb new file mode 100644 index 0000000..c758fb1 --- /dev/null +++ b/Op_Amps_And_Linear_Integrated_Circuits_by_R_A_Gayakwad/9-Specialized_IC_Applications.ipynb @@ -0,0 +1,521 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: Specialized IC Applications" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.10: Design_of_current_source.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-440\n", +"// Example_9_10\n", +"// Design of current source\n", +"// Given\n", +"clear;clc;\n", +"Vr=5; // Voltage in volt\n", +"Il=0.25; // Load current in ampere\n", +"Rl=48; // Load resistance in ohm\n", +"dropout_volt=2; // Constant for IC7805C\n", +"R=Vr/Il; // Approximate result sice Iq is negligible in the eq. Il=(Vr/Il)+Iq where Iq is quiescent current\n", +"printf('\n Resistance R is = %.f ohm \n',R) // Result\n", +"Vl=Rl*Il;\n", +"Vo=Vr+Vl;\n", +"printf('\n Output voltage Vo is = %.f V \n',Vo) // Result\n", +"Vin=Vo+dropout_volt;\n", +"printf('\n Min input voltage Vin is = %.f V \n',Vin) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.11: Design_of_voltage_regulator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-444\n", +"// Example_9_11\n", +"// Design of voltage regulator\n", +"// Given\n", +"clear;clc;\n", +"Vo_min=5; // Min output voltage in volt\n", +"Vo_max=12; // Max output voltage in volt\n", +"Vref=1.25; // Reference voltage in volt\n", +"Iadj=100*10^-6; // Adjustment pin current in ampere\n", +"R1=240; // Assumption\n", +"R2_min=R1*(Vo_min-Vref)/(Vref+Iadj*R1); // Using Vo_min=Vref*(1+R2/R1)+Iadj*R2\n", +"printf('\n Resistance R2_min is = %.1f ohm \n',R2_min) // Result\n", +"R2_max=R1*(Vo_max-Vref)/(Vref+Iadj*R1); // Using Vo_max=Vref*(1+R2/R1)+Iadj*R2\n", +"printf('\n Resistance R2_max is = %.1f ohm \n',R2_max) // Result\n", +"printf('\n Therefore resistance should be varied from R2_min to R2_max values.To do this we take R2 as 3kohm potentiometer \n')\n", +"C2=1*10^-6; // Added to the circuit to improve transient response\n", +"C3=1*10^-6; // Added to the circuit to obtain high ripple rejection ratios" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.12: Design_of_stepdown_switching_regulator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-453\n", +"// Example_9_12\n", +"// Design of stepdown switching regulator\n", +"// Given\n", +"clear;clc;\n", +"Iomax=500*10^-3; // Max output current in ampere\n", +"Vo=5; // Output voltage in volt\n", +"Vd=1.25; // Voltage drop across the power diode in volt\n", +"Vin=12; // Input voltage in volt\n", +"Vs=1.1; // Output saturation voltage in volt\n", +"Vripple=50*10^-3; // Output ripple voltage in volt\n", +"Vref=1.245; // Reference voltage in volt\n", +"Vr2=1.2; // Voltage across resistance R2 in volt\n", +"Ipk=2*Iomax; // Sense current in ampere\n", +"printf('\n Sense current,Ipk is = %.f A \n',Ipk) // Result\n", +"Rsc=0.33/Ipk; // Sense resistance in ohm\n", +"printf('\n Sense resistance,Rsc is = %.2f ohm \n',Rsc) // Result\n", +"K=(Vo+Vd)/(Vin-Vs-Vo); // K= ton/toff\n", +"printf('\n Constant K = %.2f \n',K) // Result\n", +"printf('\n i.e, ton is K times of toff \n')\n", +"f=20*10^3; // Assuming operating freq in Hz\n", +"T=1/f;\n", +"toff=T/2.06; // Using ton+toff=T and substituting for ton\n", +"printf('\n OFF time period,toff is = %.8f sec \n',toff) // Result\n", +"ton=1.06*toff;\n", +"printf('\n ON time period,ton is = %.8f sec \n',ton) // Result\n", +"Ct=45*10^-5*toff; // Oscillator timing capacitance in farad\n", +"printf('\n Oscillator timing capacitance,Ct is = %.10f F \n',Ct) // Result\n", +"L=((Vo+Vd)/Ipk)*toff; // Inductance in henry\n", +"printf('\n Inductance,L is = %.8f H \n',L) // Result\n", +"Co=Ipk*((ton+toff)/(8*Vripple)); // Output capacitance in farad\n", +"printf('\n Output capacitance,Co is = %.7f F \n',Co) // Result\n", +"I2=0.1*10^-3; // Assuming the current through R2\n", +"R2=Vref/I2; // Resistance R2 in ohm\n", +"printf('\n Resistance R2 is = %.1f ohm \n',R2) // Result\n", +"R2=12*10^3; // Taking approximate value\n", +"R1=(R2*(Vo-Vr2))/Vr2; // Using Vr2=(R1*Vo)/R1+R2, voltage divider rule\n", +"printf('\n Resistance R1 is = %.1f ohm \n',R1) // Result\n", +"efficiency=((Vin-Vs+Vd)/Vin)*(Vo/(Vo+Vd))*100;\n", +"printf('\n efficiency is = %.1f \n',efficiency) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.13: Design_of_stepdown_switching_regulator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-458\n", +"// Example_9_13\n", +"// Design of stepdown switching regulator\n", +"// Given\n", +"clear;clc;\n", +"Iomax=3; // Max output current in ampere\n", +"Vo=5; // Output voltage in volt\n", +"Vd=1.25; // Voltage drop across the power diode in volt\n", +"Vin=12; // Input voltage in volt\n", +"Vs=1.1; // Output saturation voltage in volt\n", +"Vripple=50*10^-3; // Output ripple voltage in volt\n", +"Vref=1.245; // Reference voltage in volt\n", +"Vr2=1.2; // Voltage across resistance R2 in volt\n", +"Ipk=2*Iomax; // Sense current in ampere\n", +"printf('\n Sense current,Ipk is = %.f A \n',Ipk) // Result\n", +"Rsc=0.33/Ipk; // Sense resistance in ohm\n", +"printf('\n Sense resistance,Rsc is = %.3f ohm \n',Rsc) // Result\n", +"K=(Vo+Vd)/(Vin-Vs-Vo); // K= ton/toff\n", +"printf('\n Constant K = %.2f \n',K) // Result\n", +"printf('\n i.e, ton is K times of toff \n')\n", +"f=20*10^3; // Assuming operating freq in Hz\n", +"T=1/f;\n", +"toff=T/2.06; // Using ton+toff=T and substituting for ton\n", +"printf('\n OFF time period,toff is = %.8f sec \n',toff) // Result\n", +"ton=1.06*toff;\n", +"printf('\n ON time period,ton is = %.8f sec \n',ton) // Result\n", +"Ct=45*10^-5*toff; // Oscillator timing capacitance in farad\n", +"printf('\n Oscillator timing capacitance,Ct is = %.10f F \n',Ct) // Result\n", +"L=((Vo+Vd)/Ipk)*toff; // Inductance in henry\n", +"printf('\n Inductance,L is = %.8f H \n',L) // Result\n", +"Co=Ipk*((ton+toff)/(8*Vripple)); // Output capacitance in farad\n", +"printf('\n Output capacitance,Co is = %.7f F \n',Co) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.1: Second_order_inverting_butterworth_lowpass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-387\n", +"// Example_9_1\n", +"// Second order inverting butterworth lowpass filter\n", +"// Given\n", +"clear;clc;\n", +"dc_gain=5;\n", +"f1=2*10^3; // Cutoff freq in Hz\n", +"Q=10; // Figure of merit\n", +"R2=(316*10^3)/10; // Resistance R2\n", +"printf('\n Resistance R2 is = %.1f ohm \n',R2) // Result\n", +"R3=(100*10^3)/((3.16*Q)-1);\n", +"printf('\n Resistance R3 is = %.1f ohm \n',R3) // Result\n", +"printf('\n Resistance R1 is Open \n') // Result\n", +"R4=(5.03*10^7)/f1;\n", +"printf('\n Resistance R4 is = %.1f ohm \n',R4) // Result\n", +"R5=R4;\n", +"printf('\n Resistance R5 is = %.1f ohm \n',R5) // Result\n", +"R6=1.8*10^3; // Assumption\n", +"R7=dc_gain*R6;\n", +"printf('\n Resistance R7 is = %.1f ohm \n',R7) // Result and its a potentiometer\n", +"R8=(R6*R7)/(R6+R7);\n", +"printf('\n Resistance R8 is = %.3f ohm \n',R8) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.2: Second_order_inverting_butterworth_bandpass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-388\n", +"// Example_9_2\n", +"// Second order inverting butterworth bandpass filter\n", +"// Given\n", +"clear;clc;\n", +"f1=5*10^3; // Center freq in Hz\n", +"Q=10; // Figure of merit\n", +"R2=100*10^3; // Constant for band-pass filter\n", +"printf('\n Resistance R2 is = %.1f ohm \n',R2) // Result\n", +"R3=(100*10^3)/((3.48*Q)-1);\n", +"printf('\n Resistance R3 is = %.1f ohm \n',R3) // Result\n", +"printf('\n Resistance R1 is Open \n') // Result\n", +"R4=(5.03*10^7)/f1;\n", +"printf('\n Resistance R4 is = %.1f ohm \n',R4) // Approximately 10kohm\n", +"R5=R4;\n", +"printf('\n Resistance R5 is = %.1f ohm \n',R5) // Approximately 10kohm and its a potentiometer" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.3: Design_of_notch_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-390\n", +"// Example_9_3\n", +"// Design of notch filter\n", +"// Given\n", +"clear;clc;\n", +"f1=5*10^3; // notch freq in Hz\n", +"Q=10; // Figure of merit\n", +"R2=100*10^3; // Constant for band-pass filter\n", +"printf('\n Resistance R2 is = %.1f ohm \n',R2) // Result\n", +"R3=(100*10^3)/((3.48*Q)-1);\n", +"printf('\n Resistance R3 is = %.1f ohm \n',R3) // Result\n", +"printf('\n Resistance R1 is Open \n') // Result\n", +"R4=(5.03*10^7)/f1;\n", +"printf('\n Resistance R4 is = %.1f ohm \n',R4) // Approximately 10kohm\n", +"R5=R4;\n", +"printf('\n Resistance R5 is = %.1f ohm \n',R5) // Approximately 10kohm and its a potentiometer\n", +"R6=10*10^3; // Assumption\n", +"printf('\n Resistance R6 is = %.1f ohm \n',R6) // Result\n", +"R7=R6;\n", +"printf('\n Resistance R7 is = %.1f ohm \n',R7) // Result\n", +"R8=R6;\n", +"printf('\n Resistance R8 is = %.1f ohm \n',R8) // Result\n", +"R9=(R6*R7*R8)/(R6*R7+R6*R8+R7*R8); // Since R6||R7||R8\n", +"printf('\n Resistance R9 is = %.1f ohm \n',R9) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.4: Second_order_butterworth_lowpass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-398\n", +"// Example_9_4\n", +"// Second order butterworth lowpass filter\n", +"// Given\n", +"clear;clc;\n", +"f1=500; // Cut-off freq in Hz\n", +"Holp=-2; // Passband gain\n", +"R1=10*10^3; // Assumption\n", +"R2=-R1*Holp; // Using Holp=-R2/R1;\n", +"printf('\n Resistance R2 is = %.1f ohm \n',R2) // Result\n", +"Q=0.707; // Figure of merit Q is fixed for second order butterworth low-pass filter\n", +"R3=Q*R2; // Using Q=R3/R2\n", +"printf('\n Resistance R3 is = %.1f ohm \n',R3) // Approximately 15kohm" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.5: Value_of_capacitor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-402, Figure.No-9.16(a)\n", +"// Example_9_5\n", +"// Value of capacitor\n", +"// Given\n", +"clear;clc;\n", +"Ra=10*10^3; // Resistance in ohm\n", +"tp=10*10^-3; // Output pulse width\n", +"C=tp/(1.1*Ra);\n", +"printf('\n Capacitance C is = %.9f farad \n',C) // Approximately 1uF" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.6: Value_of_resistor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-402, Figure.No-9.16(a)\n", +"// Example_9_6\n", +"// Value of resistor\n", +"// Given\n", +"clear;clc;\n", +"f=2*10^3; // Freq of input trigger signal in Hz\n", +"C=0.01*10^-6;\n", +"tp=1.2/f;\n", +"Ra=tp/(1.1*C);\n", +"printf('\n Resistance Ra is = %.1f ohm \n',Ra) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.7: Value_of_tc_td_and_f0.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-402, Figure.No-9.21(a)\n", +"// Example_9_7\n", +"// Value of tc,td and f0\n", +"// Given\n", +"clear;clc;\n", +"Ra=2.2*10^3; // Resistance in ohm\n", +"Rb=3.9*10^3; // Resistance in ohm\n", +"C=0.1*10^-6; // capacitance in farad\n", +"tc=0.69*(Ra+Rb)*C; // Charging time of the capacitor\n", +"printf('\n Charging time of the capacitor is = %.6f sec \n',tc) // Result\n", +"td=0.69*Rb*C; // Discharging time of the capacitor\n", +"printf('\n Discharging time of the capacitor is = %.6f sec \n',td) // Result\n", +"T=tc+td;\n", +"fo=1/T // Freq of oscillation\n", +"printf('\n Freq of oscillation is = %.1f Hz \n',fo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.8: Freq_of_free_running_ramp_generator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-412, Figure.No-9.24(a)\n", +"// Example_9_8\n", +"// Freq of free running ramp generator\n", +"// Given\n", +"clear;clc;\n", +"R=10*10^3; // Resistance in ohm\n", +"Vcc=5 // Supply voltage in volt\n", +"Vbe=0.7 // Base to emitter voltage in volt\n", +"C=0.05*10^-6; // Capacitance in farad\n", +"Ic=(Vcc-Vbe)/R; // Collector current in ampere\n", +"fo=(3*Ic)/(Vcc*C);\n", +"printf('\n Freq of free running ramp generator is = %.1f Hz \n',fo) // Result" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9: Value_of_fout_fl_fc.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Chapter9\n", +"// Page.No-423, Figure.No-9.33(a)\n", +"// Example_9_9\n", +"// Value of fout,fl,fc\n", +"// Given\n", +"clear;clc;\n", +"R1=12*10^3; // Resistance in ohm\n", +"V_plus=10 // Supply voltage in volt\n", +"V_minus=-10 // Supply voltage in volt\n", +"C1=0.01*10^-6; // Capacitance in farad\n", +"C2=10*10^-6; // Capacitance in farad\n", +"fout=1.2/(4*R1*C1);\n", +"printf('\n Free running frequency of VCO is = %.1f Hz \n',fout) // Result\n", +"V=V_plus-V_minus;\n", +"fl=(8*fout)/V;\n", +"printf('\n Lock range frequency of VCO is = %.1f Hz \n',fl) // Result\n", +"fc=sqrt(fl/(2*%pi*3.6*10^3*C2));\n", +"printf('\n Capture range frequency of VCO is = %.2f Hz \n',fc) // Result" + ] + } +], +"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 +} |