summaryrefslogtreecommitdiff
path: root/tools/editor/dct.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/dct.js')
-rw-r--r--tools/editor/dct.js31
1 files changed, 0 insertions, 31 deletions
diff --git a/tools/editor/dct.js b/tools/editor/dct.js
deleted file mode 100644
index e48ce2b..0000000
--- a/tools/editor/dct.js
+++ /dev/null
@@ -1,31 +0,0 @@
-const dctSize = 512; // Default DCT size, read from header
-
-// --- Utility Functions for Audio Processing ---
-// JavaScript equivalent of C++ idct_512
-function javascript_idct_512(input) {
- const output = new Float32Array(dctSize);
- const PI = Math.PI;
- const N = dctSize;
-
- for (let n = 0; n < N; ++n) {
- let sum = input[0] / 2.0;
- for (let k = 1; k < N; ++k) {
- sum += input[k] * Math.cos((PI / N) * k * (n + 0.5));
- }
- output[n] = sum * (2.0 / N);
- }
- return output;
-}
-
-// Hanning window for smooth audio transitions (JavaScript equivalent)
-function hanningWindow(size) {
- const window = new Float32Array(size);
- const PI = Math.PI;
- for (let i = 0; i < size; i++) {
- window[i] = 0.5 * (1 - Math.cos((2 * PI * i) / (size - 1)));
- }
- return window;
-}
-
-const hanningWindowArray = hanningWindow(dctSize); // Pre-calculate window
-