-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewi16.html
More file actions
executable file
·46 lines (38 loc) · 1.28 KB
/
viewi16.html
File metadata and controls
executable file
·46 lines (38 loc) · 1.28 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
<!DOCTYPE html><html lang="ja"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><link rel="icon" href="data:">
<title>DFT DataViewer</title>
</head><body>
<h1>DFT DataViewer</h1>
<div id=chart1></div>
<script type="module">
import { CBOR } from "https://js.sabae.cc/CBOR.js";
import { DataViewer } from "./DataViewer.js";
//const fn = "./sekaideichiban.wav-r.cbor";
//const fn = "./sekaideichiban.wav-p.cbor";
//const fn = "./sekaideichiban.wav-re.cbor";
//const fn = "./sekaideichiban.wav-re.f32.bin"; // for dft
//const fn = "./sekaideichiban.wav-im.f32.bin";
const fns = [
"./sekaideichiban.wav-r-idft.i16.bin", // for idft
"./sekaideichiban.wav-r-idftjs.i16.bin", // ok for idft
"./sekaideichiban.wav-r-idftst.i16.bin", // ok for idft
"./sekaideichiban.wav-r.i16.bin", // original
];
for (const fn of fns) {
const data = new Int16Array(await (await fetch(fn)).arrayBuffer());
console.log(data);
const showChart = (bindto, data, data2, data3) => {
const view = new DataViewer(data);
document.getElementById(bindto.substring(1)).appendChild(view);
};
showChart("#chart1", data);
}
</script>
<style>
data-viewer {
display: block;
width: 100%;
height: 300px;
}
</style>
<hr>
<a href=https://github.com/code4fukui/DFT/>src on GitHub</a>