Skip to content

Commit 6979dbd

Browse files
committed
Better default window function
1 parent 90242f9 commit 6979dbd

File tree

37 files changed

+182
-14
lines changed

37 files changed

+182
-14
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
## version 10.4.2 - 2020-01-22
4+
Better sinc resampling.
5+
36
## version 10.4.1 - 2020-01-21
47
Faster sinc resampling.
58

dist/wavefile.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resampler/interpolator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class Interpolator {
9090
* The sinc kernel.
9191
* @type {Function}
9292
*/
93-
this.kernel_ = sincKernel_(details.sincWindow || gaussianWindow_);
93+
this.kernel_ = sincKernel_(details.sincWindow || window_);
9494
}
9595

9696
/**
@@ -187,8 +187,8 @@ export class Interpolator {
187187
* @return {number}
188188
* @private
189189
*/
190-
function gaussianWindow_(x) {
191-
return Math.exp(-x * x);
190+
function window_(x) {
191+
return Math.exp(-x / 2 * x / 2);
192192
}
193193

194194
/**

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wavefile",
3-
"version": "10.4.1",
3+
"version": "10.4.2",
44
"description": "Create, read and write wav files according to the specs.",
55
"homepage": "https://github.com/rochars/wavefile",
66
"author": "Rafael da Silva Rocha <[email protected]>",
@@ -73,7 +73,7 @@
7373
"test-sr-point": "node ./node_modules/mocha/bin/_mocha test/resampler-full/point.js -R dot --timeout=1600000",
7474
"test-sr-linear": "node ./node_modules/mocha/bin/_mocha test/resampler-full/linear.js -R dot --timeout=1600000",
7575
"test-sr-cubic": "node ./node_modules/mocha/bin/_mocha test/resampler-full/cubic.js -R dot --timeout=1600000",
76-
"test-sr-sinc": "node ./node_modules/mocha/bin/_mocha test/resampler-full/sinc.js test/resampler-full/sinc-IIR.js -R dot --timeout=1600000",
76+
"test-sr-sinc": "node ./node_modules/mocha/bin/_mocha test/resampler-full/sinc.js test/resampler-full/sinc-IIR.js test/resampler-full/sinc-no-lpf.js -R dot --timeout=1600000",
7777
"test-umd": "node ./node_modules/mocha/bin/_mocha test/resampler test/dist test/src --umd --recursive -R dot --timeout=240000",
7878
"test-tsc": "tsc ./test/TypeScript/index.ts && node -r esm ./test/TypeScript/index.js",
7979
"test-cli": "wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)