-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path17_machine_learning_avoidance.html
More file actions
423 lines (351 loc) · 14.4 KB
/
Copy path17_machine_learning_avoidance.html
File metadata and controls
423 lines (351 loc) · 14.4 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
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
<!DOCTYPE html>
<!--
To Do: Update callback functions and remove redundant or minimally effective
options from callback function menu; Add timer with Start/Reset button(s);
Replace text-based status display with bar graph including average/cumulative
statistics for current or most recent timed simulation that freezes at end of
timed simulation
-->
<html lang="en-US" style="display: flex;">
<head>
<title>HLSI Ex 17</title>
<meta charset="UTF-8"/>
<link rel="stylesheet" type="text/css" media="all" href="hlsi.css">
<link rel=stylesheet type=text/css href=sidebar.css />
<link rel=stylesheet type=text/css href=codemirror.min.css />
<link rel=stylesheet type=text/css href=blackboard.min.css />
<link href='https://css.gg/minimize-alt.css' rel='stylesheet'>
<style>
output {font-weight: bold;}
</style>
<script src=d3.v5.min.js></script>
<script src=fft.js></script>
<script src=common.js></script>
<script src=signal.js></script>
<script src=sliders.js></script>
<!-- <script src=powerSpectrumPlot.js></script> -->
<script src=powerSpectrumPlot_2D.js></script>
<script src=powerSpectrumPlot_3D.js></script>
<script src=spectralEfficiencyPlot.js></script>
<script src=sinrPlot_BarChart.js></script>
<script src="averageThroughputPlot_BarChart.js"></script>
<script src="modeController.js"></script>
<script src=label.js></script>
<script src=timer.js></script>
<script src=capacityBanner.js></script>
<script src=codemirror.min.js></script>
<script src=codeMirror_javascript.js></script>
<script src=scriptController.js></script>
<script src=capacityRunner_multisignal.js></script>
<script src=throughputPlotMultiSignals.js></script>
<script src=hoppingInterferer.js></script>
<script src="https://unpkg.com/d3-simple-slider"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.1/chart.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.0.0"></script>
<style>
.grid-container-main {
display: grid;
grid-template-columns: auto auto;
padding: 2px;
width: 75vw;
}
.grid-container {
display: grid;
grid-template-columns: auto auto;
padding: 2px;
}
.grid-item {
padding: 2px;
font-size: 30px;
text-align: center;
}
/* Style the tab */
.tab {
overflow: hidden;
border: 1px solid #ccc;
background-color: black;
width: fit-content;
border: groove;
border-radius: 8px;
height: 3rem;
}
/* Style the buttons inside the tab */
.tab button {
background-color: inherit;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 14px 16px;
transition: 0.3s;
font-size: 17px;
color: white;
/* width: 5vw; */
}
/* Change background color of buttons on hover */
.tab button:hover {
background-color: lightgray;
color: black;
}
/* Create an active/current tablink class */
.tab button.active {
background-color: darkkhaki;
color: black;
}
.timer {
margin-left: 2rem;
display: none;
width: 60vw;
justify-content: start;
}
.PU_controls {
display: flex;
flex-direction: row;
}
.argsTable{
height: 320px;
overflow-y: auto;
overflow-x: hidden;
display: block;
}
.minimizeBtn {
background-color: black; padding: 10px; border: groove; border-radius: 8px;
cursor: pointer;
}
.minimizeBtn:hover {
background-color: darkkhaki;
}
@media screen and (max-width: 1000px) {
.grid-container {
width: 25%;
grid-template-columns: none;
}
}
@media screen and (min-width: 1500px) {
.grid-container {
width: 25%;
grid-template-columns: auto auto;
}
}
</style>
</head>
<body style="margin:0;">
<!-- <h2>Exercise 17 Q-Learning Interferer Avoidance</h2>
<p><a href="index.html">[exercises]</a></p> -->
<section class="banner" style="position: fixed; z-index: 11; background: rgba(0,0,0,0.85)">
<label for="menu-control" class="hamburger">
<i class="hamburger__icon"></i>
<i class="hamburger__icon"></i>
<i class="hamburger__icon"></i>
</label>
<input type="checkbox" id="menu-control" class="menu-control">
<aside class="sidebar" style="z-index: 10;">
<nav class="sidebar__menu">
<a href="01_bw.html"><b>1</b> Bandwidth</a>
<a href="02_freq.html"><b>2</b> Frequency</a>
<a href="03_gn.html"><b>3</b> Gain</a>
<a href="04_freq_bw_gn.html"><b>4</b> Frequency, Bandwidth, and Gain</a>
<a href="05_capacity.html"><b>5</b> Information Capacity</a>
<a href="06_interference.html"><b>6</b> Interference and Information Capacity</a>
<a href="07_capacity.html"><b>7</b> Information Capacity</a>
<a href="08_capacity.html"><b>8</b> Information Capacity</a>
<a href="09_capacity.html"><b>9</b> Information Capacity</a>
<a href="10_capacity.html"><b>10</b> Information Capacity</a>
<a href="11_pathloss.html"><b>11</b> Path Loss</a>
<a href="12_pathloss_interference.html"><b>12</b> Path Loss with Interference</a>
<a href="13_manual_avoidance.html"><b>13</b> Manual Interferer Avoidance</a>
<a href="" onclick="alert('Exercise 14: reserved for future use')"><b>14</b> SAS (Spectrum Access System)</a>
<a href="15_rule_based_avoidance.html"><b>15</b> Rule Based Interferer Avoidance</a>
<a href="16_programmable_avoidance.html"><b>16</b> Programmable Interferer Avoidance</a>
<a href="17_machine_learning_avoidance.html" class="selected"><b>17</b> Machine Learning Interferer Avoidance</a>
<a href="18_machine_learning_time_based_avoidance.html"><b>18</b> Machine Learning With Periodic Interferer Avoidance</a>
<a href="19_rf_front_end_spectrum_sharing.html"><b>19</b> RF Front End Spectrum Sharing</a>
<a href="20_rf_front_end_spectrum_sharing.html"><b>20</b> Programmable RF Front End Spectrum Sharing</a>
<a href="21_rf_front_end_spectrum_sharing_with_interferer.html"><b>21</b> RF Front End Spectrum Sharing with Interferer</a>
<a href="22_rf_front_end_spectrum_sharing_with_interferer.html"><b>22</b> Programmable Spectrum Sharing with Interferer</a>
<a href="23_rf_front_end_spectrum_sharing_sliders_programmable.html"><b>23</b> RFFE Spectrum Sharing - Manual and Programmable</a>
<a href="25_rf_front_end_spectrum_sharing_menu.html"><b>25</b> RFFE Spectrum Sharing - Calculate SINR options menu</a>
<a href="26_rf_front_end_spectrum_sharing_ programmable.html"><b>26</b> RFFE Spectrum Sharing -- SINR Calculations Programmable</a>
</nav>
<label for="menu-control" class="sidebar__close"></label>
</aside>
<div style="margin-left: 6%; font-size: 1.3rem; margin-top: 0.3%; font-family: sans-serif; order: 1; width: inherit;"><span style="color: #ddd;">Exercise 17</span> Machine Learning Interferer Avoidance</div>
<div style="order: 2; margin-left: auto; margin-right: 2%; display: flex;">
<span style="font-size: 250%; font-family: monospace; letter-spacing: 2px; margin-left: auto; margin-right: 5px; color: #e6d9ba;"></span>
<div style="width: 20%;">
<img style="width: 100%;" src="images/wireless-logo.png">
</div>
</div>
</section>
<div class="content-section" style="margin: 0% 2%; margin-top: 5%;">
<div style="display: inline-flex;">
<div class="tab">
<button class="tablinks" onclick="onTabChange(event, 'normal', signalList)">Normal</button>
<button class="tablinks" onclick="onTabChange(event, 'timer', signalList)">Timer</button>
</div>
<div class="timer" id="timer">
<p id=capacityRunner></p>
</div>
</div>
<div class="PU_controls">
<p><label for="pu_mode">Type of co-existing signal:</label>
<select id="pu_mode" onchange="onPUModeChange()">
<option id="interference" value="interference">Interference</option>
<option id="radar_primary_user" value="radar_primary_user">Radar Primary User</option>
<option id="comms_primary_user" value="comms_primary_user">Comms Primary User</option>
</select>
</p>
<div id="sinr_thresholdDiv" style="margin-top: 1rem; margin-left: 1rem; display: none;">
<label for="sinr_threshold">SINR Threshold (dB)</label>
<input style="width: 3.5rem;" id="sinr_threshold" type="text" value="20"
oninput="this.value = this.value
.replace(/[^0-9.-]/g, '').replace(/(\..*?)\..*/g, '$1').replace(/^0[^.]/, '0').replace(/^[-]*[0-9]+[.]*[0-9]*[-]/, '0');" />
</div>
<div id="rate_thresholdDiv" style="margin-top: 1rem; margin-left: 1rem; display: none;">
<label for="rate_threshold">Data Rate Threshold (M bits/sec)</label>
<input style="width: 3.5rem;" id="rate_threshold" type="text" value="2"
oninput="this.value = this.value
.replace(/[^0-9.-]/g, '').replace(/(\..*?)\..*/g, '$1').replace(/^0[^.]/, '0').replace(/^[-]*[0-9]+[.]*[0-9]*[-]/, '0');" />
</div>
<div class="applyDiv" style="margin-top: 1rem; margin-left: 1rem;">
<input id="apply" type="button" value="Apply" onclick="onPUModeChange()">
</div>
</div>
<p id=capacityBanner></p>
<p>
<input type="range" id=freq />
</p>
<p>
<input type="range" id=bw />
</p>
<p>
<input type="range" id=mcs />
</p>
<p id=scriptController></p>
<p id=hoppingInterferer></p>
<p id=scriptController2></p>
</div>
<div style="display:flex; margin-left: 1%;">
<span style="font-size: 24px; margin-right: 8px;">3D</span>
<label class="switch">
<input id="psd_3d_checkbox" type="checkbox" onclick="power_spectral_density_3d_checkbox_change();">
<span class="slider round"></span>
</label>
</div>
<div class="grid-container-main">
<div class="grid-item">
<div id="psd_svg_figure_parent" style="float: left; margin-left: 1%;"></div>
</div>
<div class="grid-item">
<div class="grid-container">
<div class="grid-item" id="sinr_parent" style="width: 360px; height: 320px;">
<canvas id="sinr-bar-chart" style="width: 100%; height: 100%;"></canvas>
</div>
<div class="grid-item">
<div id="avg_throughput" style="width: 360px; height: 320px;">
<!-- <canvas id="avg-throughput-bar-chart" style="width: 100%; height: 100%; margin-top:-25px;"></canvas> -->
</div>
</div>
</div>
</div>
<div class="grid-item">
<div id="throughput-multisignal" style="width: 720px;"></div>
</div>
<div class="grid-item">
<!-- <div id="spectral_efficiency_parent" style="width: 720px;"></div> -->
</div>
</div>
</body>
<script>
'use strict';
var sig = new Signal(conf.sig0, '', {
bw_max: 38.0e6, // Hz
bw_init: 0.150e6, // Hz
gn_max: 1.0, // dB
gn_init: -10.0, // dB
gn_min: -8, // dB
mcs_init:11// array index int 0 to 11
//freq_init: 1785.0e6 // Hz
});
sig.freq = 1812.5e+6;
var interferer = new Signal(conf.sig0, 'interferer', {
bw_max: 38.0e6, // Hz
bw_init: 0.150e6, // Hz
gn_max: 0.0, // dB
gn_init: -30, // dB
gn_min: -40, // dB
freq_init: 1782.5e6 // Hz
//mcs_init: 11// array index int 0 to 11
});
var noise = Signal(conf.noise, "Noise", { gn_init: -40});
var signalList = [sig, interferer];
var num_channels = 8;
var epsilon = 1;
var minimum_epsilon = 0.25;
var decaying_constant = 0.99;
var qfunc = new Array(num_channels).fill(0);
var userData = {}
userData["bw_margin"] = 2.5e6;
userData['qfunc'] = qfunc;
userData['num_channels'] = num_channels;
userData['epsilon'] = epsilon;
userData['decaying_constant'] = decaying_constant;
var globalUserData = {}
globalUserData["bw_margin"] = 2.5e6;
globalUserData['qfunc'] = qfunc;
globalUserData['num_channels'] = num_channels;
globalUserData['epsilon'] = epsilon;
globalUserData['decaying_constant'] = decaying_constant;
globalUserData['minimum_epsilon'] = minimum_epsilon;
// Change the initial freq value for sig1, so we see it is different from
// sig2.
//sig1.freq = 1810.0e+6;
//new ScriptController([ sig, interferer ], {
// element: '#scriptController',
// functionFiles: 'functions/default_1_2.js'
//});
sync: sc
var sc = new ScriptController([sig,interferer], {
element: '#scriptController',
//functionFiles: "functions/HoppingInteference.js",
functionFiles: "functions/HoppingInteference.js",
postfix: [ '1','2' ]
});
new ScriptController([sig,interferer], {
element: '#scriptController2',
//functionFiles: "functions/HoppingInteference.js",
functionFiles: "functions/DesiredSignalQFunc.js",
postfix: [ '1','2' ],
sync:sc
});
//new ScriptController([sig,interferer], {
// functionFiles: "functions/DesiredSignalQFunc.js",
// postfix: [ '1','2' ]
//});
/*
new ScriptController([sig,interferer], {
functionFiles: "functions/interference_uses_upper_channels.js",
postfix: [ '1','2' ]
});
new ScriptController([sig,interferer], {
functionFiles: "functions/interference_uses_even_channels.js",
postfix: [ '1','2' ]
});
new ScriptController([sig,interferer], {
functionFiles: "functions/interference_uses_odd_channels.js",
postfix: [ '1','2' ]
});
*/
//HoppingInterferer(interferer, '#hoppingInterferer');
// console.log()
Slider(sig, 'freq', '#freq');
Slider(sig, 'bw', '#bw');
Slider(sig, 'mcs', '#mcs');
var funcs = null;
CapacityBanner(sig, '#capacityBanner');
PowerSpectrumPlot_2D();
ThroughputPlot([sig]);
//SpectralEfficiencyPlot(sig);
SinrPlot_BarChart.init([sig], "sinr-bar-chart", ["User Signal"], null, ["rgb(48, 25, 72)", "rgba(230,97,0)"]);
</script>
</html>