summaryrefslogtreecommitdiff
path: root/sample_notebooks/AviralYadav/Chapter9.ipynb
blob: 0655eef8b00e1c1c6e5271d088e69bebb283ed5a (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
{

 "metadata": {

  "name": "",

  "signature": "sha256:349ae7afdee1d1b3c3dc4037b8dc3bb200738707d16369e5edfee0d065859f9b"

 },

 "nbformat": 3,

 "nbformat_minor": 0,

 "worksheets": [

  {

   "cells": [

    {

     "cell_type": "heading",

     "level": 1,

     "metadata": {},

     "source": [

      "Chapter 9: Signal Analysis"

     ]

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex9.1:pg-277"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# To find dynamic range of spectrum analyser\n",

      "\n",

      "# Given data\n",

      "I_p = +25.0; #Third order intercept point in dBm\n",

      "MDS = -85.0; #noise level in dBm\n",

      "\n",

      "#Calculations\n",

      "\n",

      "dynamic_range = 2/3.0*(I_p -MDS);\n",

      "print \"The dynamic range of the spectrum analyser =\",int(dynamic_range),\" dB\"\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The dynamic range of the spectrum analyser = 73  dB\n"

       ]

      }

     ],

     "prompt_number": 2

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex9.2:pg-277"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# To find minimum detectable signal\n",

      "\n",

      "import math\n",

      "\n",

      "# Given data\n",

      "NF = 20.0; #Noise figure in dB\n",

      "BW = 1*10.0**3; #Bandwidth in Hz\n",

      "\n",

      "#Calculations\n",

      "MDS=-114+10*math.log10((BW/(1*10.0**6)))+NF\n",

      "print \"The minimum detectable signal of the spectrum analyser = \",int(MDS),\" dBm\"\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The minimum detectable signal of the spectrum analyser =  -124  dBm\n"

       ]

      }

     ],

     "prompt_number": 13

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex9.3:pg-285"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# To find dynamic range and total frequency display\n",

      "\n",

      "import math\n",

      "# Given data\n",

      "T = 4.0; #Sample window in s\n",

      "f_s = 20*10.0**3; # sample frequency in Hz\n",

      "N = 10.0; #no of bits\n",

      "\n",

      "#Calculations\n",

      "f_r = 1/T;\n",

      "f_h = f_s/2.0; \n",

      "R_d = 20*math.log10(2.0**N);\n",

      "\n",

      "print \"The ratio of the spectral calculation = \",round(f_r,2),\" Hz\\n\"\n",

      "print \"The maximum calculated spectral frequency = \",int(f_h),\" Hz\\n\"\n",

      "print \"The dynamic range = \",int(R_d),\" dB\"\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The ratio of the spectral calculation =  0.25  Hz\n",

        "\n",

        "The maximum calculated spectral frequency =  10000  Hz\n",

        "\n",

        "The dynamic range =  60  dB\n"

       ]

      }

     ],

     "prompt_number": 15

    }

   ],

   "metadata": {}

  }

 ]

}