{
 "metadata": {
  "name": "",
  "signature": "sha256:efde35bc6b39332bcbdd0902e3c4730008212f1e0c635f78b359c0a32b2006c0"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter10:Feedback in Amplifiers"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 - Pg 368"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine the gain of feedback amplifier\n",
      "#given\n",
      "A=100.;#internal gain\n",
      "B=0.1;#feedback factor\n",
      "Af=A/(1.+A*B);\n",
      "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Af,\"\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The gain of feedback amplifier = 9.09 \n",
        "\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 - Pg 368"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine the gain of feedback amplifier in dB\n",
      "#given\n",
      "import math\n",
      "Ad=60.;#dB      #internal gain in dB\n",
      "A=10.**(Ad/20.);    #internal gain\n",
      "B=1./20.;#feedback factor\n",
      "Af=A/(1.+A*B);\n",
      "Afd=20.*math.log10(Af);\n",
      "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Afd,\"dB\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The gain of feedback amplifier = 25.85 dB\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E3 - Pg 368"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the percentage of output fed back to input\n",
      "#given\n",
      "A=600.;#internal gain\n",
      "Af=50.;#gain of feedback amplifier\n",
      "B=(A/Af-1.)/A;\n",
      "print '%s %.3f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The percentage of output fed back to input = 1.833 percent\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E4 - Pg 368"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the internal gain and percentage of output fed back to input\n",
      "#given\n",
      "Af=80.;#gain of feedback amplifier\n",
      "Vi=0.05;#V#input with feedback\n",
      "Vi_=4.*10.**-3.;#V#input without feedback\n",
      "Vo_=Af*Vi;\n",
      "A=Vo_/Vi_;\n",
      "print '%s %.f %s' %(\"The internal gain is =\",A,\"\\n\");\n",
      "B=(A/Af-1.)/A;\n",
      "print '%s %.2f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The internal gain is = 1000 \n",
        "\n",
        "The percentage of output fed back to input = 1.15 percent\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E5 - Pg 369"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the gain with and without feedback and feedback factor\n",
      "#given\n",
      "Vo_=5.;#V         #output voltage\n",
      "Vi=0.2;#V    #input with feedback\n",
      "Vi_=0.05;#V   #input without feedback\n",
      "A=Vo_/Vi_;\n",
      "Af=Vo_/Vi;\n",
      "print '%s %.f %s' %(\"The gain without feedback is =\",A,\"\\n\");\n",
      "print '%s %.f %s' %(\"The gain with feedback is =\",Af,\"\\n\");\n",
      "B=(A/Af-1.)/A;\n",
      "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The gain without feedback is = 100 \n",
        "\n",
        "The gain with feedback is = 25 \n",
        "\n",
        "The feedback factor = 3 percent\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E6 - Pg 369"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the gain of feedback amplifier and feedback factor\n",
      "#given\n",
      "A=100.;      #internal gain\n",
      "N=20.;#dB   #negative feedback\n",
      "B=(10.**(-N/(-20.))-1.)/A;      #taking antilog\n",
      "Af=A/(1.+A*B);\n",
      "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n",
      "print '%s %.f %s' %(\"The gain of the feedback amplifier is =\",Af,\"\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The feedback factor = 9 percent\n",
        "\n",
        "The gain of the feedback amplifier is = 10 \n",
        "\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E7 - Pg 371"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate percentage change in the overall gain\n",
      "#given\n",
      "A=1000.;#internal gain\n",
      "N=40.;#dB#negative feedback\n",
      "D=10.**((-N)/-20.);#D=(1+AB)desensitivity\n",
      "dA_A=10.;#percent#dA/A\n",
      "dAf_Af=dA_A/D;#dAf/Af\n",
      "print '%s %.1f %s' %(\"The percentage change in the overall gain =\",dAf_Af,\"percent\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The percentage change in the overall gain = 0.1 percent\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E8 - Pg 371"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate percentage change in the overall gain\n",
      "#given\n",
      "Adb=60.;#dB#internal gain in dB\n",
      "B=0.005;#feedback factor\n",
      "A=10.**(Adb/(20.));#taking antilog\n",
      "dA_A=-12.;#percent #dA/A\n",
      "D=(1.+A*B);#D=(1+AB)desensitivity\n",
      "dAf_Af=dA_A/D;#dAf/Af\n",
      "print '%s %.f %s' %(\"The percentage change in the overall gain reduces by =\",-dAf_Af,\"percent\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The percentage change in the overall gain reduces by = 2 percent\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E9 - Pg 374"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine the input resistance of feedback amplifier\n",
      "#given\n",
      "A=250.;#internal gain\n",
      "B=0.1;#feedback factor\n",
      "Ri=1.1*10.**3.;#ohm    #input resistance\n",
      "Rif=Ri*(1.+A*B);\n",
      "print '%s %.1f %s' %(\"The input resistance of feedback amplifier =\",Rif/1000,\"kohm\");\n",
      "\n",
      "#The ans in book is incorrect due to use of (2+A*B) instead of (1+A*B) the ans in book is 29.7 kohm\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The input resistance of feedback amplifier = 28.6 kohm\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E10 - Pg 374"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the percentage of negative feedback to input\n",
      "#given\n",
      "Adb=60.;#dB      #internal gain in dB\n",
      "A=10.**(Adb/(20.));      #taking antilog\n",
      "Ro=12.*10.**3.;#ohm      #output resistance\n",
      "Rof=600.;#ohm\n",
      "B=(Ro/Rof-1.)/A;\n",
      "print '%s %.1f %s' %(\"The percentage of negative feedback to input =\",B*100,\"percent\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The percentage of negative feedback to input = 1.9 percent\n"
       ]
      }
     ],
     "prompt_number": 10
    }
   ],
   "metadata": {}
  }
 ]
}