Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/resources/audit-util.js

Issue 2862373002: Compute tail time from Biquad coefficients (Closed)
Patch Set: Initialize tail_time_ in constructor Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 /** 6 /**
7 * @fileOverview This file includes legacy utility functions for the layout 7 * @fileOverview This file includes legacy utility functions for the layout
8 * test. 8 * test.
9 */ 9 */
10 10
11 // How many frames in a WebAudio render quantum.
12 let RENDER_QUANTUM_FRAMES = 128;
11 13
12 function writeString(s, a, offset) { 14 function writeString(s, a, offset) {
13 for (let i = 0; i < s.length; ++i) { 15 for (let i = 0; i < s.length; ++i) {
14 a[offset + i] = s.charCodeAt(i); 16 a[offset + i] = s.charCodeAt(i);
15 } 17 }
16 } 18 }
17 19
18 function writeInt16(n, a, offset) { 20 function writeInt16(n, a, offset) {
19 n = Math.floor(n); 21 n = Math.floor(n);
20 22
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 let length = Math.min(actual.length, expected.length); 339 let length = Math.min(actual.length, expected.length);
338 340
339 for (let k = 0; k < length; ++k) { 341 for (let k = 0; k < length; ++k) {
340 let diff = actual[k] - expected[k]; 342 let diff = actual[k] - expected[k];
341 signalPower += expected[k] * expected[k]; 343 signalPower += expected[k] * expected[k];
342 noisePower += diff * diff; 344 noisePower += diff * diff;
343 } 345 }
344 346
345 return signalPower / noisePower; 347 return signalPower / noisePower;
346 } 348 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698