- Sections and slides rewritten in Swedish; German law and institutions replaced by Swedish/CEPT/ITU equivalents (PTS, SSA, PTSFS 2025:1, SSMFS 2008:18), unverified statements marked "% TODO VERIFY" - New toc: INSTEG, HAREC, UPPGRADERING; section idents are Swedish (see ident-map.tsv) - Exam-question tags, BNetzA question pool, solutions and the German SWL course removed - Static pages, snippets, applets, READMEs and image alt-texts translated - TikZ labels translated; SVG drawings regenerated (drawing 689 still fails to build upstream: it references a missing photo) - Changed from the original: not endorsed by DARC e.V., SSA or PTS Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
122 lines
3.8 KiB
HTML
122 lines
3.8 KiB
HTML
<html>
|
|
<script src="https://www.50ohm.de/assets/jquery/3.7.1/jquery.min.js"></script>
|
|
<script src="https://www.50ohm.de/assets/chartjs/4.4.1/chart.min.js"></script>
|
|
<link rel="stylesheet" href="https://www.50ohm.de/assets/katex/katex.min.css">
|
|
<p>Här kan du prova det hela en gång till. Med reglagen ställer du in amplituden $a$ och perioden $T$ för en sinussvängning.</p>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
Amplitud:
|
|
</td>
|
|
<td>
|
|
<input type="range" class="slider" value="50" min="0" max="100" id="amplitude">
|
|
</td>
|
|
<td>
|
|
$a$=<div id="tamplitude" style="display:inline-block;">50%</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
Period:
|
|
</td>
|
|
<td>
|
|
<input type="range" class="slider" value="1" min="1" max="10" id="period">
|
|
</td>
|
|
<td>
|
|
$T$=<div id="tperiod" style="display:inline-block;">1s</div> och $f$=<div id="tfrequency" style="display:inline-block;">1Hz</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<p><canvas id="Sine" style="max-height:200px;"></canvas></p>
|
|
|
|
<script>
|
|
// Script by DL9MJ, 2024
|
|
var a = 50;
|
|
var p = 1;
|
|
var max = 2*Math.PI*1/p*4;
|
|
var steps = Math.PI/128;
|
|
|
|
sine = new Chart("Sine", {
|
|
type: 'scatter',
|
|
data: {
|
|
labels: [],
|
|
datasets: [
|
|
{
|
|
fill: false,
|
|
pointRadius: 0,
|
|
lineTension: 0.8,
|
|
showLine: true,
|
|
borderColor: "#00AEDF",
|
|
data: [],
|
|
},
|
|
]
|
|
},
|
|
options: {
|
|
responsive:true,
|
|
plugins: {
|
|
legend: {
|
|
display: false,
|
|
}
|
|
},
|
|
scales: {
|
|
y: {
|
|
min: -100,
|
|
max: +100,
|
|
ticks: {
|
|
callback: function(value, index, ticks) {
|
|
return value + "%";
|
|
}
|
|
}
|
|
},
|
|
x: {
|
|
min: 0,
|
|
max: 24,
|
|
title: {
|
|
display: true,
|
|
text: 'Tid'
|
|
},
|
|
ticks: {
|
|
stepSize: 1,
|
|
callback: function(val, index) {
|
|
return val+"s";
|
|
},
|
|
}
|
|
}
|
|
},
|
|
}
|
|
});
|
|
|
|
generateValues(0, max, steps);
|
|
|
|
$("#amplitude").on("change", function() {
|
|
a = $(this).val();
|
|
generateValues(0, max, steps);
|
|
});
|
|
|
|
$("#period").on("change", function() {
|
|
p = $(this).val();
|
|
generateValues(0, max, steps);
|
|
});
|
|
|
|
function generateValues(i1, i2, step = 1) {
|
|
// Reset all values:
|
|
sine.data.datasets[0].data = [];
|
|
sine.data.labels = [];
|
|
|
|
// Generate new Data:
|
|
for (let x = i1; x <= i2; x += step) {
|
|
// Set I:
|
|
sine.data.datasets[0].data.push(a*Math.sin(2*Math.PI*1/p*x));
|
|
sine.data.labels.push(x);
|
|
}
|
|
|
|
// Update Graphs
|
|
sine.update();
|
|
|
|
// Set Text:
|
|
$('#tamplitude').html(a+"%");
|
|
$('#tperiod').html(p+"s");
|
|
$('#tfrequency').html((1/p).toFixed(2).replace(".", ",")+" Hz");
|
|
}
|
|
</script>
|
|
</html> |