diff options
Diffstat (limited to 'sample_notebooks/VidyaSri')
-rwxr-xr-x | sample_notebooks/VidyaSri/Chapter_1.ipynb | 389 |
1 files changed, 389 insertions, 0 deletions
diff --git a/sample_notebooks/VidyaSri/Chapter_1.ipynb b/sample_notebooks/VidyaSri/Chapter_1.ipynb new file mode 100755 index 00000000..7a5ae89d --- /dev/null +++ b/sample_notebooks/VidyaSri/Chapter_1.ipynb @@ -0,0 +1,389 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:e7689de630b2babf67b8065d816d51134502d1f0c04e82cddeaf0e3e2d421795"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 - PULSE FUNDAMENTALS "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caption:Find (a)Pulse amplitude (b)PRF (c)PW (d)Duty cycle and (e)M/S ratio\n",
+ "v=1.#Vertical scale(Volt per division)\n",
+ "h=0.1#Horizontal scale(Milli sec per division)\n",
+ "pv=3.5#Amplitude of pulse in divisions\n",
+ "t=6.#Time in divisions\n",
+ "pw=2.5#Width of pulse\n",
+ "P=pv*v\n",
+ "print '%s %.1f' %('(a)Pulse Amplitude (in volts)=',P)\n",
+ "T=t*h\n",
+ "prf=(1/T)*1000\n",
+ "print '%s %.4f' %('(b)PRF(in pps)=',prf)\n",
+ "p=pw*h\n",
+ "print '%s %.2f' %('(c)PW (in ms)=',p)\n",
+ "sw=pv*h\n",
+ "d=(p/T)*100\n",
+ "print '%s %.6f' %('(d)Duty cycle(in %)=',d)\n",
+ "m=p/sw\n",
+ "print '%s %.7f' %('(e)M/S ratio=',m)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Pulse Amplitude (in volts)= 3.5\n",
+ "(b)PRF(in pps)= 1666.6667\n",
+ "(c)PW (in ms)= 0.25\n",
+ "(d)Duty cycle(in %)= 41.666667\n",
+ "(e)M/S ratio= 0.7142857\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caption:Determine (a)Pulse amplitude,tilt,rise time,fall time,PW,PRF,mark to space ratio,and duty cycle (b)tilt\n",
+ "vs=100.#Vertical scale(in mv/divisions)\n",
+ "hs=100.#Horizontal scale(in micro sec/division)\n",
+ "e1=380.#first peak of waveform(in mv)\n",
+ "e2=350.#second peak of waveform(in mv)\n",
+ "E=(e1+e2)/2.\n",
+ "t=(e1-e2)*100./E\n",
+ "tr=0.3*hs\n",
+ "tf=0.4*hs\n",
+ "T=5.*hs\n",
+ "prf=10.**6./T\n",
+ "pw=2.2*hs\n",
+ "sw=2.8*hs\n",
+ "ms=pw/sw\n",
+ "dc=(pw*100.)/T\n",
+ "print '%s %.f'%('(a)Pulse Amplitude(in mv)=',E)\n",
+ "print '%s %.7f'%('(a)tilt(in %)',t)\n",
+ "print '%s %.f'%('(a)rise time(in micro sec)=',tr)\n",
+ "print '%s %.f'%('(a)fall time(in micro sec)=',tf)\n",
+ "print '%s %.f'%('(a)PW(in micro sec)=',pw)\n",
+ "print '%s %.f'%('(a)PRF(in pps)=',prf)\n",
+ "print '%s %.7f'%('(a)M/s ratio=',ms)\n",
+ "print '%s %.f' %('(a)Duty cycle(in %)=',dc)\n",
+ "eb=0.5*vs\n",
+ "ee=2.25*vs\n",
+ "tb=eb*100./ee\n",
+ "print '%s %.6f' %('(b)Tilt(in %)=',tb)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Pulse Amplitude(in mv)= 365\n",
+ "(a)tilt(in %) 8.2191781\n",
+ "(a)rise time(in micro sec)= 30\n",
+ "(a)fall time(in micro sec)= 40\n",
+ "(a)PW(in micro sec)= 220\n",
+ "(a)PRF(in pps)= 2000\n",
+ "(a)M/s ratio= 0.7857143\n",
+ "(a)Duty cycle(in %)= 44\n",
+ "(b)Tilt(in %)= 22.222222\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caption:Determine average voltage level\n",
+ "vs=2.#Vertical scale(V/div)\n",
+ "hs=1.#Horizontal scale(ms/div)\n",
+ "v1=8.#Amplitude of signal in (+)ve direction (in volts)\n",
+ "v2=-1.#Amplitude of signal in (-)ve direction (in volts)\n",
+ "t1=0.8#Horizontal divisions for v1\n",
+ "t2=2.2#Horizontal divisions for v2\n",
+ "T=3.*hs\n",
+ "T1=t1*hs\n",
+ "T2=t2*hs\n",
+ "Va=((T1*v1)+(T2*v2))/T\n",
+ "print '%s %.1f' %('Average voltage (in volts)=',Va)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average voltage (in volts)= 1.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caption:Determine the upper 3db frequency of the amplifier\n",
+ "tr=1.#Rise time(in micro sec)\n",
+ "fu=0.35*10**6/tr\n",
+ "print '%s %.f' %('The upper 3db frequency of the amplifier(in hertz)=',fu)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The upper 3db frequency of the amplifier(in hertz)= 350000\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caption:Determine (a)Minimum upper cut frequency (b)Minimum pulse width and duty cycle\n",
+ "prf=1.5#in Khz\n",
+ "dc=3.#Duty cycle(in %)\n",
+ "pa=1.5#Amplitude of pulse(in Khz)\n",
+ "fu=1.#High frequency limit(in Mhz)\n",
+ "tr=10.#Rise time(in %)\n",
+ "pw=(dc/100.)*10.**3./pa\n",
+ "Tr=(tr/100.)*pw\n",
+ "fh=0.35*10.**6./Tr\n",
+ "print '%s %.1f' %('(a)Minimum upper cut frequency(in hertz)=',fh)\n",
+ "Tr2=0.35*10.**(-6.)/fu\n",
+ "Pw=10.*Tr2\n",
+ "dc=Pw*100.*(pa*1000.)\n",
+ "print '%s %.7f' %('(b)Pulse width(in sec) and Duty cycle(in %)=',Pw)\n",
+ "print '%s %.3f' %('(b)Duty cycle(in %)=',dc)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Minimum upper cut frequency(in hertz)= 175000.0\n",
+ "(b)Pulse width(in sec) and Duty cycle(in %)= 0.0000035\n",
+ "(b)Duty cycle(in %)= 0.525\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caption:Calculate (a)Rise time in output waveform (b)Minimum upper cut off frequency and print '%s %.2f' %layed rise time\n",
+ "import math\n",
+ "tr=10.#Rise time of input waveform(in micro sec)\n",
+ "fu=350.#Upper cut off frequency(in KHz)\n",
+ "ti=100.#Input rise time(in ns)\n",
+ "trc=0.35*(10.**(-3.))/350.\n",
+ "tro=math.sqrt(((tr)*(10.**(-6.)))**2.+(trc**2.))*10.**6.\n",
+ "print '%s %.6f' %('(a)Rise Time(in Micro sec)=',tro)\n",
+ "tc=ti*(10.**(-9.))/3.\n",
+ "fh=0.35*10.**(-6.)/tc\n",
+ "Tro=math.sqrt((ti*(10.**(-9.)))**2.+(tc**2.))*10.**9.\n",
+ "print '%s %.1f' %('(b)Minimum upper cut off frequency(in Mhz) and rise time(in ns)=',fh)\n",
+ "print '%s %.5f' %('(b)rise time(in ns)=',Tro)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)Rise Time(in Micro sec)= 10.049876\n",
+ "(b)Minimum upper cut off frequency(in Mhz) and rise time(in ns)= 10.5\n",
+ "(b)rise time(in ns)= 105.40926\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caption:Calculate lowest input frequency \n",
+ "import math\n",
+ "fl=10.#Lower cutoff frequency(in hertz)\n",
+ "t=0.02#Tilt on output waveform\n",
+ "f=math.pi*fl/(t*1000)\n",
+ "print '%s %.7f' %('Lowest input frequency(in Khz)=',f)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lowest input frequency(in Khz)= 1.5707963\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caption:Determine (a)upper cutoff frequency (b)lower cutoff frequency\n",
+ "import math\n",
+ "f=1.#frequency of square wave(in khz)\n",
+ "tr=200.#rise time of output(in ns)\n",
+ "t=0.03#fractional tilt\n",
+ "fh=0.35*10.**3./tr\n",
+ "print '%s %.2f' %('(a)upper cutoff frequency(in mhz)=',fh) \n",
+ "fl=f*t*1000./math.pi\n",
+ "print '%s %.7f' %('(b)Lower cutoff frequency(in hz)=',fl)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)upper cutoff frequency(in mhz)= 1.75\n",
+ "(b)Lower cutoff frequency(in hz)= 9.5492966\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caption:Determine upper and lower Frequencies\n",
+ "import math\n",
+ "tr=30.#Rise time(in micro sec)\n",
+ "PRF=2000.#Pulse repetition Frequency(in pps)\n",
+ "t=0.082#Tilt(in %)\n",
+ "Pw=220.#Pulse width(in micro sec)\n",
+ "fh=0.35*10.**(6.)/tr\n",
+ "fl=t*10.**6./(2.*math.pi*Pw)\n",
+ "print '%s %.3f' %('Upper frequency(in hz)=',fh)\n",
+ "print '%s %.6f' %('lower frequency(in hz)=',fl)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Upper frequency(in hz)= 11666.667\n",
+ "lower frequency(in hz)= 59.321388\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |