@audio/stft 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/stft.js +4 -1
package/package.json
CHANGED
package/stft.js
CHANGED
|
@@ -56,7 +56,10 @@ export function stftBatch(data, process, opts) {
|
|
|
56
56
|
let sc = scratch(N, half)
|
|
57
57
|
let pos = 0
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
// Start a frame at every hop up to the last sample so the tail keeps the
|
|
60
|
+
// steady-state overlap count — bounding by `pos + N <= outLen` would stop
|
|
61
|
+
// N−hop samples early (tail under-normalized) and drop inputs shorter than N.
|
|
62
|
+
while (pos < outLen) {
|
|
60
63
|
let sf = frame(data, pos, win, half, process, state, ctx, sc)
|
|
61
64
|
for (let i = 0; i < N && pos + i < outLen; i++) {
|
|
62
65
|
out[pos + i] += sf[i] * win[i]
|