summaryrefslogtreecommitdiff
path: root/sample_notebooks/SandeshNaik/ch3.ipynb
blob: 2f2e44d3297197700e8b74fb82da0b99f127108a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
{
 "metadata": {
  "name": "",
  "signature": "sha256:ab5dad51b8bb4848e05fe479e673fa81caef98b1e0130b3768c6e1580871f987"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3: Negative Feedback"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1, Page 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "Aol=200;\n",
      "f2_ol=10000;     # in Hz\n",
      "B=0.04;\n",
      "\n",
      "#Calculations&Results\n",
      "Asp=Aol/(1+B*Aol);\n",
      "print \"Asp %.2f \\n \"%Asp;            #Result\n",
      "print \"Approximately Asp =1/B equal to %.0f \\n\"%(1/B);#result\n",
      "S=Aol/Asp;\n",
      "print \"S =%.0f \\n\"%S;\n",
      "f2_sp=f2_ol*S;\n",
      "print \"f2_sp %.0f Hz\"%f2_sp;       #Result"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Asp 22.22 \n",
        " \n",
        "Approximately Asp =1/B equal to 25 \n",
        "\n",
        "S =9 \n",
        "\n",
        "f2_sp 90000 Hz\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2, Page 76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "Asp1=20.\n",
      "Asp=10**(Asp1/20);\n",
      "\n",
      "#Calculations&Results\n",
      "print \"Asp =%.0f\\n\"%Asp;#Result\n",
      "#Rf/Ri=Asp-1;\n",
      "print \"Rf/Ri=%.0f \\n\"%(Asp-1);#Result\n",
      "print \"Rf must be 9 times larger than Ri. \\n There are many possibilities  \";#Result"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Asp =10\n",
        "\n",
        "Rf/Ri=9 \n",
        "\n",
        "Rf must be 9 times larger than Ri. \n",
        " There are many possibilities  \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3, Page 82"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "Zin_ol=300*10**3;       #in Ohms\n",
      "Zout=100;       #in Ohms\n",
      "Aol=50000.;\n",
      "Zout_ol=100.;\n",
      "Asp=100;\n",
      "\n",
      "#Calculations&Results\n",
      "S=Aol/Asp;\n",
      "print \"S = %.0f\"%S;#Result\n",
      "Zin_sp=S*Zin_ol;\n",
      "print \"Zin_sp = %.0f Ohm\"%Zin_sp;#Result\n",
      "Zout_sp=Zout_ol/S;\n",
      "print \"Zout_sp = %.1f Ohm\"%Zout_sp;#Result\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "S = 500\n",
        "Zin_sp = 150000000 Ohm\n",
        "Zout_sp = 0.2 Ohm\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4, Page 88"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "R1=9000;        # in Ohm\n",
      "R2=1000.;        #in Ohm\n",
      "\n",
      "#Calculations&Results\n",
      "B=R2/(R1+R2);\n",
      "print \"B is %.2f\\n\"%B;#Result\n",
      "#Aps=1/B;\n",
      "Aps=(R1+R2)/R2;\n",
      "print \"Aps = %.0f \\n \"%Aps;#Result"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "B is 0.10\n",
        "\n",
        "Aps = 10 \n",
        " \n"
       ]
      }
     ],
     "prompt_number": 4
    }
   ],
   "metadata": {}
  }
 ]
}