@thi.ng/dsp 4.0.7 → 4.1.2
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/CHANGELOG.md +217 -112
- package/README.md +1 -1
- package/delay.js +2 -2
- package/dev/fftjs.js +512 -0
- package/fft.js +1 -1
- package/filter-response.js +1 -1
- package/internal/take.js +1 -1
- package/package.json +272 -267
- package/power.js +4 -4
- package/window.js +1 -1
package/package.json
CHANGED
|
@@ -1,271 +1,276 @@
|
|
|
1
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
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
2
|
+
"name": "@thi.ng/dsp",
|
|
3
|
+
"version": "4.1.2",
|
|
4
|
+
"description": "Composable signal generators, oscillators, filters, FFT, spectrum, windowing & related DSP utils",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "./index.js",
|
|
7
|
+
"typings": "./index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/dsp#readme",
|
|
14
|
+
"funding": [
|
|
15
|
+
{
|
|
16
|
+
"type": "github",
|
|
17
|
+
"url": "https://github.com/sponsors/postspectacular"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "patreon",
|
|
21
|
+
"url": "https://patreon.com/thing_umbrella"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"author": "Karsten Schmidt <k+npm@thi.ng>",
|
|
25
|
+
"license": "Apache-2.0",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "yarn clean && tsc --declaration",
|
|
28
|
+
"clean": "rimraf '*.js' '*.d.ts' '*.map' doc",
|
|
29
|
+
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
30
|
+
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
31
|
+
"doc:readme": "yarn doc:stats && tools:readme",
|
|
32
|
+
"doc:stats": "tools:module-stats",
|
|
33
|
+
"pub": "yarn npm publish --access public",
|
|
34
|
+
"test": "testament test"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@thi.ng/api": "^8.3.2",
|
|
38
|
+
"@thi.ng/checks": "^3.1.2",
|
|
39
|
+
"@thi.ng/errors": "^2.1.2",
|
|
40
|
+
"@thi.ng/math": "^5.1.2",
|
|
41
|
+
"@thi.ng/random": "^3.2.2",
|
|
42
|
+
"@thi.ng/transducers": "^8.1.2"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@microsoft/api-extractor": "^7.18.19",
|
|
46
|
+
"@thi.ng/testament": "^0.2.2",
|
|
47
|
+
"rimraf": "^3.0.2",
|
|
48
|
+
"tools": "^0.0.1",
|
|
49
|
+
"typedoc": "^0.22.9",
|
|
50
|
+
"typescript": "^4.5.2"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"allpass",
|
|
54
|
+
"analysis",
|
|
55
|
+
"audio",
|
|
56
|
+
"biquad",
|
|
57
|
+
"channel",
|
|
58
|
+
"clipping",
|
|
59
|
+
"composition",
|
|
60
|
+
"datastructure",
|
|
61
|
+
"delay",
|
|
62
|
+
"dsp",
|
|
63
|
+
"envelope",
|
|
64
|
+
"feedback",
|
|
65
|
+
"fft",
|
|
66
|
+
"filter",
|
|
67
|
+
"generator",
|
|
68
|
+
"impulse",
|
|
69
|
+
"iterator",
|
|
70
|
+
"lfo",
|
|
71
|
+
"math",
|
|
72
|
+
"noise",
|
|
73
|
+
"oscillator",
|
|
74
|
+
"signal",
|
|
75
|
+
"svf",
|
|
76
|
+
"synthesis",
|
|
77
|
+
"typescript",
|
|
78
|
+
"waveform",
|
|
79
|
+
"waveshaper",
|
|
80
|
+
"windowing"
|
|
81
|
+
],
|
|
82
|
+
"publishConfig": {
|
|
83
|
+
"access": "public"
|
|
84
|
+
},
|
|
85
|
+
"engines": {
|
|
86
|
+
"node": ">=12.7"
|
|
87
|
+
},
|
|
88
|
+
"files": [
|
|
89
|
+
"*.js",
|
|
90
|
+
"*.d.ts",
|
|
91
|
+
"internal"
|
|
92
|
+
],
|
|
93
|
+
"exports": {
|
|
94
|
+
".": {
|
|
95
|
+
"import": "./index.js"
|
|
96
|
+
},
|
|
97
|
+
"./add": {
|
|
98
|
+
"import": "./add.js"
|
|
99
|
+
},
|
|
100
|
+
"./addg": {
|
|
101
|
+
"import": "./addg.js"
|
|
102
|
+
},
|
|
103
|
+
"./adsr": {
|
|
104
|
+
"import": "./adsr.js"
|
|
105
|
+
},
|
|
106
|
+
"./agen": {
|
|
107
|
+
"import": "./agen.js"
|
|
108
|
+
},
|
|
109
|
+
"./allpass": {
|
|
110
|
+
"import": "./allpass.js"
|
|
111
|
+
},
|
|
112
|
+
"./alt": {
|
|
113
|
+
"import": "./alt.js"
|
|
114
|
+
},
|
|
115
|
+
"./anti-alias": {
|
|
116
|
+
"import": "./anti-alias.js"
|
|
117
|
+
},
|
|
118
|
+
"./api": {
|
|
119
|
+
"import": "./api.js"
|
|
120
|
+
},
|
|
121
|
+
"./aproc": {
|
|
122
|
+
"import": "./aproc.js"
|
|
123
|
+
},
|
|
124
|
+
"./biquad": {
|
|
125
|
+
"import": "./biquad.js"
|
|
126
|
+
},
|
|
127
|
+
"./bounce": {
|
|
128
|
+
"import": "./bounce.js"
|
|
129
|
+
},
|
|
130
|
+
"./complex": {
|
|
131
|
+
"import": "./complex.js"
|
|
132
|
+
},
|
|
133
|
+
"./const": {
|
|
134
|
+
"import": "./const.js"
|
|
135
|
+
},
|
|
136
|
+
"./convert": {
|
|
137
|
+
"import": "./convert.js"
|
|
138
|
+
},
|
|
139
|
+
"./cosine": {
|
|
140
|
+
"import": "./cosine.js"
|
|
141
|
+
},
|
|
142
|
+
"./curve": {
|
|
143
|
+
"import": "./curve.js"
|
|
144
|
+
},
|
|
145
|
+
"./dcblock": {
|
|
146
|
+
"import": "./dcblock.js"
|
|
147
|
+
},
|
|
148
|
+
"./delay": {
|
|
149
|
+
"import": "./delay.js"
|
|
150
|
+
},
|
|
151
|
+
"./feedback-delay": {
|
|
152
|
+
"import": "./feedback-delay.js"
|
|
153
|
+
},
|
|
154
|
+
"./fft": {
|
|
155
|
+
"import": "./fft.js"
|
|
156
|
+
},
|
|
157
|
+
"./filter-response": {
|
|
158
|
+
"import": "./filter-response.js"
|
|
159
|
+
},
|
|
160
|
+
"./foldback": {
|
|
161
|
+
"import": "./foldback.js"
|
|
162
|
+
},
|
|
163
|
+
"./impulse-train": {
|
|
164
|
+
"import": "./impulse-train.js"
|
|
165
|
+
},
|
|
166
|
+
"./impulse": {
|
|
167
|
+
"import": "./impulse.js"
|
|
168
|
+
},
|
|
169
|
+
"./integrator": {
|
|
170
|
+
"import": "./integrator.js"
|
|
171
|
+
},
|
|
172
|
+
"./iterable": {
|
|
173
|
+
"import": "./iterable.js"
|
|
174
|
+
},
|
|
175
|
+
"./line": {
|
|
176
|
+
"import": "./line.js"
|
|
177
|
+
},
|
|
178
|
+
"./madd": {
|
|
179
|
+
"import": "./madd.js"
|
|
180
|
+
},
|
|
181
|
+
"./mapg": {
|
|
182
|
+
"import": "./mapg.js"
|
|
183
|
+
},
|
|
184
|
+
"./mix": {
|
|
185
|
+
"import": "./mix.js"
|
|
186
|
+
},
|
|
187
|
+
"./mul": {
|
|
188
|
+
"import": "./mul.js"
|
|
189
|
+
},
|
|
190
|
+
"./multiplex": {
|
|
191
|
+
"import": "./multiplex.js"
|
|
192
|
+
},
|
|
193
|
+
"./onepole": {
|
|
194
|
+
"import": "./onepole.js"
|
|
195
|
+
},
|
|
196
|
+
"./osc-additive": {
|
|
197
|
+
"import": "./osc-additive.js"
|
|
198
|
+
},
|
|
199
|
+
"./osc-cos": {
|
|
200
|
+
"import": "./osc-cos.js"
|
|
201
|
+
},
|
|
202
|
+
"./osc-dsf": {
|
|
203
|
+
"import": "./osc-dsf.js"
|
|
204
|
+
},
|
|
205
|
+
"./osc-mix": {
|
|
206
|
+
"import": "./osc-mix.js"
|
|
207
|
+
},
|
|
208
|
+
"./osc-parabolic": {
|
|
209
|
+
"import": "./osc-parabolic.js"
|
|
210
|
+
},
|
|
211
|
+
"./osc-rect": {
|
|
212
|
+
"import": "./osc-rect.js"
|
|
213
|
+
},
|
|
214
|
+
"./osc-saw": {
|
|
215
|
+
"import": "./osc-saw.js"
|
|
216
|
+
},
|
|
217
|
+
"./osc-sin": {
|
|
218
|
+
"import": "./osc-sin.js"
|
|
219
|
+
},
|
|
220
|
+
"./osc-tri": {
|
|
221
|
+
"import": "./osc-tri.js"
|
|
222
|
+
},
|
|
223
|
+
"./osc-wavetable": {
|
|
224
|
+
"import": "./osc-wavetable.js"
|
|
225
|
+
},
|
|
226
|
+
"./osc": {
|
|
227
|
+
"import": "./osc.js"
|
|
228
|
+
},
|
|
229
|
+
"./pink-noise": {
|
|
230
|
+
"import": "./pink-noise.js"
|
|
231
|
+
},
|
|
232
|
+
"./pipe": {
|
|
233
|
+
"import": "./pipe.js"
|
|
234
|
+
},
|
|
235
|
+
"./power": {
|
|
236
|
+
"import": "./power.js"
|
|
237
|
+
},
|
|
238
|
+
"./product": {
|
|
239
|
+
"import": "./product.js"
|
|
240
|
+
},
|
|
241
|
+
"./reciprocal": {
|
|
242
|
+
"import": "./reciprocal.js"
|
|
243
|
+
},
|
|
244
|
+
"./serial": {
|
|
245
|
+
"import": "./serial.js"
|
|
246
|
+
},
|
|
247
|
+
"./sincos": {
|
|
248
|
+
"import": "./sincos.js"
|
|
249
|
+
},
|
|
250
|
+
"./sum": {
|
|
251
|
+
"import": "./sum.js"
|
|
252
|
+
},
|
|
253
|
+
"./svf": {
|
|
254
|
+
"import": "./svf.js"
|
|
255
|
+
},
|
|
256
|
+
"./sweep": {
|
|
257
|
+
"import": "./sweep.js"
|
|
258
|
+
},
|
|
259
|
+
"./waveshaper": {
|
|
260
|
+
"import": "./waveshaper.js"
|
|
79
261
|
},
|
|
80
|
-
"
|
|
81
|
-
|
|
262
|
+
"./white-noise": {
|
|
263
|
+
"import": "./white-noise.js"
|
|
82
264
|
},
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
265
|
+
"./window": {
|
|
266
|
+
"import": "./window.js"
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"thi.ng": {
|
|
270
|
+
"related": [
|
|
271
|
+
"math"
|
|
87
272
|
],
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"./add": {
|
|
93
|
-
"import": "./add.js"
|
|
94
|
-
},
|
|
95
|
-
"./addg": {
|
|
96
|
-
"import": "./addg.js"
|
|
97
|
-
},
|
|
98
|
-
"./adsr": {
|
|
99
|
-
"import": "./adsr.js"
|
|
100
|
-
},
|
|
101
|
-
"./agen": {
|
|
102
|
-
"import": "./agen.js"
|
|
103
|
-
},
|
|
104
|
-
"./allpass": {
|
|
105
|
-
"import": "./allpass.js"
|
|
106
|
-
},
|
|
107
|
-
"./alt": {
|
|
108
|
-
"import": "./alt.js"
|
|
109
|
-
},
|
|
110
|
-
"./anti-alias": {
|
|
111
|
-
"import": "./anti-alias.js"
|
|
112
|
-
},
|
|
113
|
-
"./api": {
|
|
114
|
-
"import": "./api.js"
|
|
115
|
-
},
|
|
116
|
-
"./aproc": {
|
|
117
|
-
"import": "./aproc.js"
|
|
118
|
-
},
|
|
119
|
-
"./biquad": {
|
|
120
|
-
"import": "./biquad.js"
|
|
121
|
-
},
|
|
122
|
-
"./bounce": {
|
|
123
|
-
"import": "./bounce.js"
|
|
124
|
-
},
|
|
125
|
-
"./complex": {
|
|
126
|
-
"import": "./complex.js"
|
|
127
|
-
},
|
|
128
|
-
"./const": {
|
|
129
|
-
"import": "./const.js"
|
|
130
|
-
},
|
|
131
|
-
"./convert": {
|
|
132
|
-
"import": "./convert.js"
|
|
133
|
-
},
|
|
134
|
-
"./cosine": {
|
|
135
|
-
"import": "./cosine.js"
|
|
136
|
-
},
|
|
137
|
-
"./curve": {
|
|
138
|
-
"import": "./curve.js"
|
|
139
|
-
},
|
|
140
|
-
"./dcblock": {
|
|
141
|
-
"import": "./dcblock.js"
|
|
142
|
-
},
|
|
143
|
-
"./delay": {
|
|
144
|
-
"import": "./delay.js"
|
|
145
|
-
},
|
|
146
|
-
"./feedback-delay": {
|
|
147
|
-
"import": "./feedback-delay.js"
|
|
148
|
-
},
|
|
149
|
-
"./fft": {
|
|
150
|
-
"import": "./fft.js"
|
|
151
|
-
},
|
|
152
|
-
"./filter-response": {
|
|
153
|
-
"import": "./filter-response.js"
|
|
154
|
-
},
|
|
155
|
-
"./foldback": {
|
|
156
|
-
"import": "./foldback.js"
|
|
157
|
-
},
|
|
158
|
-
"./impulse-train": {
|
|
159
|
-
"import": "./impulse-train.js"
|
|
160
|
-
},
|
|
161
|
-
"./impulse": {
|
|
162
|
-
"import": "./impulse.js"
|
|
163
|
-
},
|
|
164
|
-
"./integrator": {
|
|
165
|
-
"import": "./integrator.js"
|
|
166
|
-
},
|
|
167
|
-
"./iterable": {
|
|
168
|
-
"import": "./iterable.js"
|
|
169
|
-
},
|
|
170
|
-
"./line": {
|
|
171
|
-
"import": "./line.js"
|
|
172
|
-
},
|
|
173
|
-
"./madd": {
|
|
174
|
-
"import": "./madd.js"
|
|
175
|
-
},
|
|
176
|
-
"./mapg": {
|
|
177
|
-
"import": "./mapg.js"
|
|
178
|
-
},
|
|
179
|
-
"./mix": {
|
|
180
|
-
"import": "./mix.js"
|
|
181
|
-
},
|
|
182
|
-
"./mul": {
|
|
183
|
-
"import": "./mul.js"
|
|
184
|
-
},
|
|
185
|
-
"./multiplex": {
|
|
186
|
-
"import": "./multiplex.js"
|
|
187
|
-
},
|
|
188
|
-
"./onepole": {
|
|
189
|
-
"import": "./onepole.js"
|
|
190
|
-
},
|
|
191
|
-
"./osc-additive": {
|
|
192
|
-
"import": "./osc-additive.js"
|
|
193
|
-
},
|
|
194
|
-
"./osc-cos": {
|
|
195
|
-
"import": "./osc-cos.js"
|
|
196
|
-
},
|
|
197
|
-
"./osc-dsf": {
|
|
198
|
-
"import": "./osc-dsf.js"
|
|
199
|
-
},
|
|
200
|
-
"./osc-mix": {
|
|
201
|
-
"import": "./osc-mix.js"
|
|
202
|
-
},
|
|
203
|
-
"./osc-parabolic": {
|
|
204
|
-
"import": "./osc-parabolic.js"
|
|
205
|
-
},
|
|
206
|
-
"./osc-rect": {
|
|
207
|
-
"import": "./osc-rect.js"
|
|
208
|
-
},
|
|
209
|
-
"./osc-saw": {
|
|
210
|
-
"import": "./osc-saw.js"
|
|
211
|
-
},
|
|
212
|
-
"./osc-sin": {
|
|
213
|
-
"import": "./osc-sin.js"
|
|
214
|
-
},
|
|
215
|
-
"./osc-tri": {
|
|
216
|
-
"import": "./osc-tri.js"
|
|
217
|
-
},
|
|
218
|
-
"./osc-wavetable": {
|
|
219
|
-
"import": "./osc-wavetable.js"
|
|
220
|
-
},
|
|
221
|
-
"./osc": {
|
|
222
|
-
"import": "./osc.js"
|
|
223
|
-
},
|
|
224
|
-
"./pink-noise": {
|
|
225
|
-
"import": "./pink-noise.js"
|
|
226
|
-
},
|
|
227
|
-
"./pipe": {
|
|
228
|
-
"import": "./pipe.js"
|
|
229
|
-
},
|
|
230
|
-
"./power": {
|
|
231
|
-
"import": "./power.js"
|
|
232
|
-
},
|
|
233
|
-
"./product": {
|
|
234
|
-
"import": "./product.js"
|
|
235
|
-
},
|
|
236
|
-
"./reciprocal": {
|
|
237
|
-
"import": "./reciprocal.js"
|
|
238
|
-
},
|
|
239
|
-
"./serial": {
|
|
240
|
-
"import": "./serial.js"
|
|
241
|
-
},
|
|
242
|
-
"./sincos": {
|
|
243
|
-
"import": "./sincos.js"
|
|
244
|
-
},
|
|
245
|
-
"./sum": {
|
|
246
|
-
"import": "./sum.js"
|
|
247
|
-
},
|
|
248
|
-
"./svf": {
|
|
249
|
-
"import": "./svf.js"
|
|
250
|
-
},
|
|
251
|
-
"./sweep": {
|
|
252
|
-
"import": "./sweep.js"
|
|
253
|
-
},
|
|
254
|
-
"./waveshaper": {
|
|
255
|
-
"import": "./waveshaper.js"
|
|
256
|
-
},
|
|
257
|
-
"./white-noise": {
|
|
258
|
-
"import": "./white-noise.js"
|
|
259
|
-
},
|
|
260
|
-
"./window": {
|
|
261
|
-
"import": "./window.js"
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
"thi.ng": {
|
|
265
|
-
"related": [
|
|
266
|
-
"math"
|
|
267
|
-
],
|
|
268
|
-
"year": 2015
|
|
269
|
-
},
|
|
270
|
-
"gitHead": "852cd2450617c86d15d18477dc634f17f04202eb"
|
|
271
|
-
}
|
|
273
|
+
"year": 2015
|
|
274
|
+
},
|
|
275
|
+
"gitHead": "e8a7c2a40191b391cef182c2978e5a6c85987a87\n"
|
|
276
|
+
}
|
package/power.js
CHANGED
|
@@ -7,7 +7,7 @@ import { isComplex } from "./complex.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export const integralT = (window) => {
|
|
9
9
|
let sum = 0;
|
|
10
|
-
for (let i = window.length; --
|
|
10
|
+
for (let i = window.length; i-- > 0;) {
|
|
11
11
|
sum += window[i];
|
|
12
12
|
}
|
|
13
13
|
return sum;
|
|
@@ -19,7 +19,7 @@ export const integralT = (window) => {
|
|
|
19
19
|
*/
|
|
20
20
|
export const integralTSquared = (window) => {
|
|
21
21
|
let sum = 0;
|
|
22
|
-
for (let i = window.length; --
|
|
22
|
+
for (let i = window.length; i-- > 0;) {
|
|
23
23
|
sum += window[i] ** 2;
|
|
24
24
|
}
|
|
25
25
|
return sum;
|
|
@@ -31,7 +31,7 @@ export const integralTSquared = (window) => {
|
|
|
31
31
|
*/
|
|
32
32
|
export const integralF = ([real, img]) => {
|
|
33
33
|
let sum = 0;
|
|
34
|
-
for (let i = real.length; --
|
|
34
|
+
for (let i = real.length; i-- > 0;) {
|
|
35
35
|
sum += Math.hypot(real[i], img[i]);
|
|
36
36
|
}
|
|
37
37
|
return sum;
|
|
@@ -43,7 +43,7 @@ export const integralF = ([real, img]) => {
|
|
|
43
43
|
*/
|
|
44
44
|
export const integralFSquared = ([real, img]) => {
|
|
45
45
|
let sum = 0;
|
|
46
|
-
for (let i = real.length; --
|
|
46
|
+
for (let i = real.length; i-- > 0;) {
|
|
47
47
|
sum += real[i] ** 2 + img[i] ** 2;
|
|
48
48
|
}
|
|
49
49
|
return sum;
|
package/window.js
CHANGED
|
@@ -30,7 +30,7 @@ export const window = (fn, lenOfBuf) => {
|
|
|
30
30
|
* @param out
|
|
31
31
|
*/
|
|
32
32
|
export const applyWindow = (signal, window, out = signal) => {
|
|
33
|
-
for (let i = signal.length; --
|
|
33
|
+
for (let i = signal.length; i-- > 0;) {
|
|
34
34
|
out[i] = signal[i] * window[i];
|
|
35
35
|
}
|
|
36
36
|
return out;
|