forked from vtwireless/HLSI
-
Notifications
You must be signed in to change notification settings - Fork 1
/
17_machine_learning_avoidance.html
171 lines (130 loc) · 3.97 KB
/
17_machine_learning_avoidance.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
<!DOCTYPE html>
<html lang="en-US">
<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=codemirror.min.css />
<link rel=stylesheet type=text/css href=blackboard.min.css />
<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=spectralEfficiencyPlot.js></script>
<script src=label.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=throughputPlot.js></script>
<script src=hoppingInterferer.js></script>
</head>
<body>
<h2>Exercise 17 Q-Learning Interferer Avoidance</h2>
<p><a href="index.html">[exercises]</a></p>
<p id=scriptController></p>
<p id=hoppingInterferer></p>
<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>
</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 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], {
//functionFiles: "functions/HoppingInteference.js",
functionFiles: "functions/HoppingInteference.js",
postfix: [ '1','2' ]
});
new ScriptController([sig,interferer], {
//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');
CapacityBanner(sig, '#capacityBanner');
PowerSpectrumPlot();
ThroughputPlot(sig);
//SpectralEfficiencyPlot(sig);
</script>
</html>