-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsampSzLab.html
More file actions
153 lines (120 loc) · 4.08 KB
/
sampSzLab.html
File metadata and controls
153 lines (120 loc) · 4.08 KB
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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Tests of noisy vector spaces</title>
</head>
<body>
<h2>
Tests of statistical features of vector spaces (Fourier transformations)
</h2>
<h3>Summary</h3>
This page shows how expected values and variances changes in different vector spaces (Fourier transformations). This is useful in determining how signal to noise (SNR) and signal to noise and distortion (SINAD) changes.
SNR is usually improved at the expense of specificity of location. SNR is dependent on the sampling set. The relation is usually that SNR improves
with the square root of the sampling set size. This will test if a subset of transformations have somewhat lower than expected SNR for n-radix intervals for lower n due to zero elements in the basis vectors.
<h3>
Derivation
</h3>
The result is straightforward arithmetics on expected value and variance. Expected value is assumed to be a scaling of a basis vector.
<h3>
Simulations
</h3>
<div class="barGraph" style="display: none;">
<div style=" height: 22px;" class="bar"></div><!--
--><div style="height: 11px;" class="bar"></div><!--
--><div style="height: 6px;" class="bar"></div><!--
--><div style="height: 49px;" class="bar"></div><!--
--><div style="height: 278px;" class="bar"></div>
</div>
<hr>
<div style="display: none;">
<div>
<hr>
D3 svg
</div>
<svg id="visualisation" width="1000" height="500"></svg>
</div>
<hr>
<div style="display: none;">
<div>
<hr>
<span>2D ll Canvas</span>
</div>
<canvas id="chCanvas" width="1024" height="1024" style="border:1px solid #000000;"></canvas>
</div>
<hr>
<div>
<div>
<hr>
<span style="display: block;">D3/Simple Chart DIV</span>
</div>
<div id="d3SimpleCanvas" style=" width=1024px; height=1024px; border:1px solid #000000;"></div>
</div>
<hr>
<div style="display: none;">
<span>Google charts</span>
<div id="barchart_material" style="width: 900px; height: 500px;"></div>
</div>
</body>
<style>
.graph {
/* width: 50px;
height: 50px;
*/
border: 1px solid #aeaeae;
background-color: #eaeaea;
}
.bar {
/*width: 8px; */
width: 10%;
margin: 1px;
display: inline-block;
position: relative;
background-color: #aeaeae;
vertical-align: baseline;
}
/* Simple bar chart */
.barSimp {
background-color: #aeaeae;
display: inline-block;
/* border: 0.5px solid black;
*/ vertical-align: baseline;
}
</style>
<!--<link rel="stylesheet" href="//cdn.jsdelivr.net/jqplot/1.0.8/jquery.jqplot.css">-->
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.4.0/MathJax.js"></script>
<!--<script src="http://cdn.rawgit.com/nnnick/Chart.js/master/Chart.js"></script>-->
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/1.0.1/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jsxgraph/0.99.1/jsxgraphcore.js"></script>
<!-- script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.js"></script -->
<!--<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>-->
<script src="https://www.google.com/jsapi"></script>
<!--<script src="//cdn.jsdelivr.net/jqplot/1.0.8/jquery.jqplot.js"></script>-->
<script>
var exports = {};
</script>
<script src="sampSzLab.js"> </script>
<script>
var myLab = new SampSzLab();
myLab.plotDOMid = "chCanvas";
/* function draw() {
var ctx = (a canvas context);
ctx.canvas.width = Math.floor(0.9 * window.innerWidth);
ctx.canvas.height = Math.floor(0.7 * window.innerHeight);
}
*/
// Drawing charts
myLab.sampSz = 64;
myLab.multiplier = 1;
var cosV = myLab.frequencyBasis();
myLab.basisFunc = Math.sin;
var sinV = myLab.frequencyBasis();
var iter = cosV.map(function(v, i) {return i+1});
var chCtx = document.getElementById('chCanvas').getContext("2d");
var dataset = cosV.map(function(d, i) {
return d*d;
}
);
</script>
</html>