forked from Palakis/circles-sines-signals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sampling3.html
134 lines (115 loc) · 5.65 KB
/
sampling3.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
<html>
<head>
<title>Circles Sines and Signals - Sine Wave Aliasing</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"> SINE WAVE ALIASING
<div class="subheader" style="font-size: 14px"> MULTIPLES OF THE SAMPLING RATE </div>
</div>
<table class="figureTable">
<tr>
<td style="vertical-align: top;">
<div class="text" style="margin-left: 0px">
If you aren’t already convinced that sampling is a tricky business, take a look at the following theorem.<sup>1</sup><br/><br/>
<p class="quote" style="text-align: center">
<b> The Sampled Sine Wave Theorem</b><br/><br/>
Given a sampling rate of <b>SR</b> hertz,
and an integer <b>k</b>, </br><br/>
A sine wave at a frequency of <b>F</b> is indistinguishable from a sine wave at a frequency of <b>F + (k × SR)</b> after sampling.
</p>
<br/>
<p>
If we’re sampling at a rate of <span class="inlineexample"> 6 Hz </span>, this theorem tells us that a sine wave with a frequency of <span class="inlineexample"> 1 Hz </span> is indistinguishable from sine waves at <span class="inlineexample">7 Hz</span>, <span class="inlineexample">13 Hz</span>, <span class="inlineexample">19 Hz</span> and so on after the sampling process.
</p>
<p>
<i>Figure 1</i> shows an animation which demonstrates this phenomenon for 8 potential aliases of a <span class="inlineexample">1 Hz</span> sine wave which was sampled at a rate of <span class="inlineexample">6 Hz</span>. I’ve decided to loop the animation after showing 8 aliases, but I assure you that it’s possible to continue playing this game for an infinite number of aliases to the left and right of the original (blue) sine wave. While we wont really deal with negative frequencies in this essay, it’s worth noting that they are a useful construct that you might encounter in the literature.
</p>
<br/>
<table>
<tr class="figureCaption">
<td width="100%">
<b>Figure 1.</b> All Sampled Sine Waves Have Aliases<br/>
<sub>Aliases of a 1 Hz sine wave sampled at 6 Hz</sub>
</td>
</tr>
<tr>
<td>
<svg id="sinc" class="svgWithText" width="750" height="390" style=""></svg>
<script type="text/javascript" src="js/sine_aliasing.js"></script>
</td>
</tr>
</table>
<p>
This theorem implies a quite impressive conclusion: <i>Every</i> sampled sine wave has an <i>infinite</i> number of aliases. You can easily identify these aliases by adding multiples of the sampling frequency to the frequency of the original sine wave. This theorem tells us that - without context - any sine wave is indistinguishable from an infinite number of other sine waves after sampling.
</p>
<p>
I’m not introducing this theorem to dishearten you, but simply to reinforce the notion that sampling isn’t a trivial thing. We’ve seen how sampling can go wrong, and we’ve introduced a theorem which allows us to ensure that our sampling is sound. For now, we leave sampling behind and dive into the Discrete Fourier Transform.
</p>
<br/><br/>
</td>
<td class="figureExplanation" style="">
<b>1.</b>
I'm actually not sure if this theorem has a name, so I've decided to call it the “Sampled Sine Wave Theorem”. I've taken it directly from Lyon's very good textbook on DSP, <a href="http://www.amazon.com/Understanding-Digital-Signal-Processing-Edition/dp/0137027419"> Understanding Digital Signal Processing</a>.<br/><br/>
</td>
</tr>
</table><br/>
<div class="title" id="footer"></div><script type="text/javascript" src="menu.js"></script></body>
</html>