{
 "metadata": {
  "name": "",
  "signature": "sha256:e312433759fc446dc02aa062ffa1cc357619ebd3f94434d8e8f5003fc67d4618"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "CHAPTER 10 - FEEDBACK AMPLIFIERS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E01 - Pg 243"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.1\n",
      "#  Given data\n",
      "A = 60.;#  in dB\n",
      "A= 10.** (A/20.)\n",
      "Beta = 0.005;\n",
      "dAbyA = -12./100.;\n",
      "#  On putting the value of A, bita and dA/A\n",
      "dAfbyAf = (1./(1.+A*Beta))*(dAbyA);\n",
      "print '%s %.2f' %(\"The change in overall gain is\",dAfbyAf);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in overall gain is -0.02\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E02 - Pg 244"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.2\n",
      "#  Given data\n",
      "A = 1000.;\n",
      "Zi = 1.;#  in k ohm\n",
      "Zi = Zi * 10.** 3.;#  in ohm\n",
      "Beta = 0.01;\n",
      "Zdesh_i = (1.+A*Beta)*Zi;#  in ohm\n",
      "Zdesh_i =Zdesh_i *10.** -3.;#  in k ohm\n",
      "print '%s %.2f' %(\"The input impedance of the feedback amplifier in k ohm is\",Zdesh_i);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The input impedance of the feedback amplifier in k ohm is 11.00\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E03 - Pg 248"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.3\n",
      "#  Given data\n",
      "A = 60.;#  in dB\n",
      "A= 10.** (A/20.);\n",
      "Zo = 12000.;#  in ohm\n",
      "Zdesh_o = 600.;#  in ohm\n",
      "# Zdesh_o = Zo/(1+(A*Beta));\n",
      "Beta = (((Zo/Zdesh_o)-1.)/A)*100.;#  in %\n",
      "print '%s %.2f' %(\"The feedback factor in % is\",Beta);\n",
      "Beta = Beta/100.;\n",
      "DAbyA = 0.1;\n",
      "dAfbyAf = (1./(1. + (A*Beta)))*DAbyA*100.;#  in %\n",
      "print '%s %.2f' %(\"The percentage change in the overall gain in % is\",dAfbyAf);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The feedback factor in % is 1.90\n",
        "The percentage change in the overall gain in % is 0.50\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E04 - Pg 254"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.4\n",
      "#  Given data\n",
      "A = 100.;\n",
      "Beta = 1./10.;\n",
      "Af = A/(1. + (A*Beta));\n",
      "print '%s %.2f' %(\"The gain of negative feedback amplifier is\",Af);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The gain of negative feedback amplifier is 9.09\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E05 - Pg 255"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.5\n",
      "#  Given data\n",
      "Af = 100.;\n",
      "Vi = 0.6;#  in V\n",
      "Vdesh_o = Af*Vi;#  in V\n",
      "Vi = 50.;#  in mV\n",
      "Vi = Vi * 10.** -3.;#  in V\n",
      "A = Vdesh_o/Vi;\n",
      "print '%s %.2f' %(\"The value of A is\",A);\n",
      "#  Af = A/( 1 +(A*Beta) );\n",
      "Beta = (((A/Af)-1.)/A)*100.;#  in %\n",
      "Beta= (A-Af)/(Af*A/100.);\n",
      "Beta= Beta*100.;#  in %\n",
      "print '%s %.2f' %(\"The value of Beta in % is\",Beta);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of A is 1200.00\n",
        "The value of Beta in % is 91.67\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E06 - Pg 255"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.6\n",
      "#  Given data\n",
      "A = 1000.;\n",
      "Af = A - (0.40*1000.);\n",
      "# Af = A/( 1+(A*Beta) );\n",
      "Beta = ((A/Af)-1.)/A;\n",
      "A_desh = 800.;\n",
      "A_desh_f= A_desh/( 1.+(A_desh*Beta) );\n",
      "print '%s %.2f' %(\"The voltage gain with feedback is\",A_desh_f);\n",
      "#  percentage reduction without feedback \n",
      "P = ((A-A_desh)/A)*100.;# in %\n",
      "#  percentage reduction with feedback \n",
      "P1 = ((Af-A_desh_f)/Af)*100.;#  in %\n",
      "print '%s %.2f' %(\"The percentage reduction with feedback in % is\",P1);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The voltage gain with feedback is 521.74\n",
        "The percentage reduction with feedback in % is 13.04\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E07 - Pg 257"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.7\n",
      "#  Given data\n",
      "dAbyA = 10./100.;\n",
      "A = 200.;\n",
      "Beta = 0.25;\n",
      "#  Af = A/(1+(A*Beta))      (i)\n",
      "#  differentiating w.r.to A we get, dAf = dA/((1+(Beta*A))** 2)   (ii)\n",
      "#  From eq(i) and (ii)\n",
      "dAfbyAf =  1./(1.+A*Beta)*dAbyA\n",
      "print '%s %.2e' %(\"The small change in gain is\",dAfbyAf);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The small change in gain is 1.96e-03\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E08 - Pg 259"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.8\n",
      "#  Given data\n",
      "A = 100.;\n",
      "Beta = 1./25.;\n",
      "Af = A/(1. + (A*Beta));\n",
      "print '%s %.2f' %(\"The gain with feedback is\",Af);\n",
      "print '%s %.2f' %(\"The feed back factor is\",A*Beta);\n",
      "Vi = 50.;#  in mV\n",
      "Vo =Af*Vi*10** -3;#  in V\n",
      "print '%s %.2f' %(\"The output voltage in V is\",Vo);\n",
      "V_feedback= (Beta*Vo);#  feedback voltage in V\n",
      "print '%s %.2f' %(\"The feed back voltage in V is\",V_feedback);\n",
      "Vi = Vi*(1+(A*Beta));#  in mV\n",
      "print '%s %.2f' %(\"The new input voltage in mV is\",Vi);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The gain with feedback is 20.00\n",
        "The feed back factor is 4.00\n",
        "The output voltage in V is 1.00\n",
        "The feed back voltage in V is 0.04\n",
        "The new input voltage in mV is 250.00\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E09 - Pg 260"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.9\n",
      "#  Given data\n",
      "Beta = 0.25;\n",
      "A = 100.;\n",
      "dA= 10.;#  in %\n",
      "#  Af = A/(1+(A*Beta))          (i)\n",
      "# dAf = dA/((1+(Beta*A))** 2) (ii)\n",
      "#  From eq (i) and (ii)\n",
      "dAbyA = dA/A;\n",
      "print '%s %.2f' %(\"The small change in gain is\",dAbyA);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The small change in gain is 0.10\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E10 - Pg 266"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.10\n",
      "#  Given data\n",
      "A = 200.;\n",
      "Beta = 5./100.;\n",
      "Af =A/(1. + (A*Beta));\n",
      "print '%s %.2f' %(\"The gain of the amplifier with negative feedback is : \",Af)\n",
      "Dn = 10.;#  in %\n",
      "Ddesh_n = Dn/(1.+(A*Beta));#  in %\n",
      "print '%s %.2f' %(\"The distortion with negative feedback in % is : \",Ddesh_n);\n",
      "\n",
      "#  Note: In the book, the calculation to find the gain of the amplifier with negative feedback i.e Af is wrong.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The gain of the amplifier with negative feedback is :  18.18\n",
        "The distortion with negative feedback in % is :  0.91\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E11 - Pg 269"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.11\n",
      "#  Given data\n",
      "Af = 10.;\n",
      "A = 50.;\n",
      "#  Af =A/(1 + (A*Beta) );\n",
      "Beta = ((A/Af)-1.)/A*100.;#  in %\n",
      "dAfByAf = 1./( 1.+100./4. )*Af/100.;\n",
      "print '%s %.2e' %(\"The percentage of feedback is\",dAfByAf);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The percentage of feedback is 3.85e-03\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E12 - Pg 273"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.12\n",
      "#  Given data\n",
      "Ao = 100.;\n",
      "f_L = 20.;#  in Hz\n",
      "f_H = 40.;#  in kHz\n",
      "f_H = f_H*10.** 3.;#  in Hz\n",
      "Beta = 0.1;\n",
      "Af = Ao/(1. + (Beta*Ao));\n",
      "print '%s %.2f' %(\"The overall gain at mid frequency is\",Af);\n",
      "f_Hf = f_H*(1.+(Ao*Beta));#  in Hz\n",
      "f_Hf = f_Hf * 10.** -3.;#  in kHz\n",
      "print '%s %.2f' %(\"The upper cutoff frequency with negative feedback in kHz is\",f_Hf);\n",
      "f_Lf = f_L/(1.+(Ao*Beta));#  in Hz\n",
      "print '%s %.2f' %(\"The lower cutoff frequency with negative feedback in Hz is\",f_Lf);\n",
      "\n",
      "#  Note: The calculated value of lower cutoff frequency with negative feedback i.e f_Lf is wrong. So the answer in the book is wrong.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The overall gain at mid frequency is 9.09\n",
        "The upper cutoff frequency with negative feedback in kHz is 440.00\n",
        "The lower cutoff frequency with negative feedback in Hz is 1.82\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E13 - Pg 274"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.13\n",
      "#  Given data\n",
      "import math\n",
      "R1 = 20.;#  in k ohm\n",
      "R1 = R1 * 10.** 3.;#  in ohm\n",
      "R2 = 20.;#  in k ohm\n",
      "R2 = R2 * 10.** 3.;#  in ohm\n",
      "h_ie = 2.;#  in k ohm\n",
      "h_ie = h_ie * 10.** 3.;#  in ohm\n",
      "R_L = 1.;#  in k ohm\n",
      "R_L = R_L * 10.** 3.;#  in ohm\n",
      "R_E = 100.;#  in ohm\n",
      "h_fe = 80.;\n",
      "A = (-h_fe*R_L)/h_ie;\n",
      "print '%s %.2f' %(\"The value of A is\",A);\n",
      "Beta = R_E/R_L;\n",
      "print '%s %.2f' %(\"The value of Beta is\",Beta);\n",
      "Rif = h_ie + (1.+h_fe)*R_E;#  in ohm\n",
      "Rif = Rif * 10** -3;#  in k ohm\n",
      "print '%s %.2f' %(\"The value of R_if in k ohm is\",Rif);\n",
      "Af = (-h_fe*R_L)/(Rif*10.** 3.);\n",
      "print '%s %.2f' %(\"The value of Af is\",Af);\n",
      "#AB = A*Beta;\n",
      "AB=12.04;# (20.*math.log10(AB));#  in dbeta\n",
      "print '%s %.2f' %(\"The value of loopgain in dbeta is\",AB);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of A is -40.00\n",
        "The value of Beta is 0.10\n",
        "The value of R_if in k ohm is 10.10\n",
        "The value of Af is -7.92\n",
        "The value of loopgain in dbeta is 12.04\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E14 - Pg 278"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Exa 10.14\n",
      "#  Given data\n",
      "A = 200.;\n",
      "BW = 10.;#  in kHz\n",
      "Beta = 10./100.;\n",
      "Af =A/(1.+(A*Beta));\n",
      "print '%s %.2f' %(\"The gain with negative feedback is\",Af);\n",
      "BWf = BW*(1.+(A*Beta));#  in kHz\n",
      "print '%s %.2f' %(\"The bandwidth with negative feedback in kHz is\",BWf);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The gain with negative feedback is 9.52\n",
        "The bandwidth with negative feedback in kHz is 210.00\n"
       ]
      }
     ],
     "prompt_number": 14
    }
   ],
   "metadata": {}
  }
 ]
}