forked from Palakis/circles-sines-signals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
discrete_signals.html
198 lines (167 loc) · 8.51 KB
/
discrete_signals.html
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
190
191
192
193
194
195
196
197
198
<html>
<head>
<title>Circles Sines and Signals - Discrete Signals</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="third_party/d3/d3.min.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
jax: ["input/TeX","input/MathML","output/SVG"],
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
}
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ TeX: { extensions: ["color.js"] }});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config(
{
SVG: {linebreaks: { automatic:true }},
displayAlign: "center"
}
);
</script>
<script type="text/javascript"
src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG">
</script>
<link href='//fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Vollkorn:400italic,400' rel='stylesheet' type='text/css'>
<style>
@import url("fontello-b1d57784/css/fontello.css");
@import url("style.css");
</style>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-59785365-1', 'auto');
ga('send', 'pageview');
</script>
<link rel="icon" type="" href="favicon.ico"></head>
<body>
<div class="title">
<table width="900">
<tr>
<td width="90%">
<div class="bigheader" id="titleinfo">
</div>
</td>
</tr>
<tr>
<td width="70%">
<br/>
<div id="menu" class="menu" style="margin-left: 45; ">
<table> <tr id="menurow"> </tr> </table>
</div>
<!-- -->
</td>
</tr>
</table>
</div>
<div class="littleheader"> DISCRETE SIGNALS
<div class="subheader" style="font-size: 14px"> SAMPLING AND SIGNAL NOTATION </div>
</div>
<table class="figureTable">
<tr>
<td style="vertical-align: top;">
<div class="text" style="margin-left: 0px">
<p>
When you periodically measure the value of some quantity, you’re <i>sampling</i>. Each one of your measurements is referred to as a <i>sample</i>. Discrete signals are simply lists of samples, and are usually generated by sampling real-world continuous signals.<sup>1</sup> As an example, let’s think about the process of sampling the altitude of a plane over the course of a two hour long flight. In the following animation, we’ll generate a discrete signal by sampling the plane’s altitude every ten minutes.
</p>
<br/><br/>
<table>
<tr class="figureCaption">
<td width="100%">
<b>Figure 1.</b> Sampling the Altitude of a Plane During a Two Hour Long Flight
</td>
</tr>
<tr>
<td>
<div id="animatedWrapper" class="animation" style="position: relative;">
<svg id="plane2" class="svgWithText" width="700" height="180" style="padding-top: 0px; margin-left: 30px;"></svg>
<script type="text/javascript" src="js/plane_sampling.js"></script>
</div>
</td>
</tr>
</table>
<br/>
Each of the blue dots in <i>Figure 1</i> is a <i>sample</i>.
Instead of plotting our samples on a two-dimensional image, we might instead choose to represent our signal using a more conventional pen-and-paper type notation. In other words, we can represent our discrete signal as a simple list of numbers,<sup>2</sup>
<p class="example" style="font-family: lato; color: #333;">
<b>
altitude = [0,
6000,
15000,
20000,
35000,
32000,
31000,
31000,
27000,
12000,
3500,
1200,
0]
</b>
</p>
<p>
We can refer to a particular sample by index. For example, <span class="inlineexample"> altitude[4] </span> is <span class="inlineexample">35,000</span> and <span class="inlineexample"> altitude[8] </span> is <span class="inlineexample">27,000</span>. Note that the indexes start from zero. The first sample is at index <span class="inlineexample">0</span>, the second sample is at index <span class="inlineexample">1</span>, the third at index <span class="inlineexample">2</span>, and so on.
</p>
</td>
<td class="figureExplanation" style="">
<b>1.</b>
It's also possible to construct a discrete signal by sampling another discrete signal. This process is referred to as <i>re-sampling</i>. Discrete signals may also be constructed or synthesized. Really, a discrete signal is just a list of numbers. Write down any list of numbers and you've successfully created a discrete signal.<br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/>
<b>2.</b>
If you’re familiar with computer programming, you’ll notice the similarity with arrays and lists. If it's handy for you to think of discrete signals as arrays or lists, go for it. <br/><br/>
</td>
</tr>
</table><br/>
<table class="figureTable">
<tr>
<td style="vertical-align: top;">
<div class="text" style="margin-left: 0px">
<p>
If we want to know <i>when</i> a particular sample was taken, we need an extra bit of information known as the <i>sampling period</i>. The sampling period is the duration in-between consecutive samples. Recall that our samples were created by measuring the plane’s altitude every ten minutes. This means that our sampling period is <span class="inlineexample">10 minutes</span>. If you’re more mathematically inclined, you can choose to write it like this (read as, “ten minutes per sample”).
</p>
<div style="font-family: lato; color: #333; padding-left: 20px; text-align: center">
<b>sampling period</b> = <b>10</b> minutes / <b>1</b> sample
</div>
</p><br/>
Once we know the sampling period, it’s possible to figure out the time when a particular sample was taken by multiplying its index by the sampling period:
<br/><br/>
<div style="font-family: lato; color: #333; padding-left: 20px; text-align: center">
<b>time of third sample</b> = <b>2</b> × <b>10</b> minutes / <b>1</b> sample = <b>20</b> minutes
</div>
<br/>
It’s very important to note that proper interpretation of a discrete signal requires <i>context</i>. We need to know the sampling period in order to make sense of the values. Without knowledge of the sampling period, the values are more or less meaningless.
<td class="figureExplanation" style="">
</td>
</tr>
</table>
<div class="littleheader"> DID WE MISS ANYTHING?
<div class="subheader" style="font-size: 14px"> A CLOSER LOOK AT THE SAMPLING PERIOD </div>
</div>
<table class="figureTable">
<tr>
<td style="vertical-align: top;">
<div class="text" style="margin-left: 0px">
<p>
You might have noticed that we lost an important piece of information about the flight by choosing to sample the plane’s altitude every ten minutes. Replay the animation in <i>Figure 1</i> and notice that between 60 and 70 minutes into the flight the plane makes a rapid descent before returning to its cruising altitude. This is the most interesting and anomalous part of the flight (perhaps the pilot was forced to take evasive action due to bad weather), but we have absolutely <i>no</i> record of this in our discrete signal. Our sampling period was poorly chosen, and as a result, we’ve irrevocably lost valuable information.
</p>
<p>
If a discrete signal is meant to represent some physical phenomenon we must think carefully about our choice of sampling period to ensure that the discrete representation is faithful. A large part of signal processing theory is concerned with the proper determination of sampling period.
In the next section, we’ll look a bit more closely at the sampling period and the further consequences of sampling too infrequently.
</p>
</td>
<td class="figureExplanation" style="">
</td>
</tr>
</table><br/><br/>
</div>
<div class="title" id="footer"></div><script type="text/javascript" src="menu.js"></script></body>
</html>