Commit 67926a91 authored by rtoy's avatar rtoy Committed by Commit bot

Test FFT scaling for all orders

Previously we only tested FFTs up to size 2048, but the AnalyserNode
supports up to 32768.  Test all sizes.

BUG=676722
TEST=realtimeanalyser-fft-scaling.html

Review-Url: https://codereview.chromium.org/2629543005
Cr-Commit-Position: refs/heads/master@{#443461}
parent e317130c
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
<script> <script>
let audit = Audit.createTaskRunner(); let audit = Audit.createTaskRunner();
// The number of analysers. We have analysers from size for each of the possible sizes of 32, // The number of analysers. We have analysers from size for each of the
// 64, 128, 256, 512, 1024 and 2048 for a total of 7. // possible sizes of 2^5 to 2^15 for a total of 11.
let numberOfAnalysers = 7; let numberOfAnalysers = 11;
let sampleRate = 44100; let sampleRate = 44100;
let nyquistFrequency = sampleRate / 2; let nyquistFrequency = sampleRate / 2;
...@@ -34,7 +34,9 @@ ...@@ -34,7 +34,9 @@
// determined experimentally. // determined experimentally.
// //
// See https://code.google.com/p/chromium/issues/detail?id=341596. // See https://code.google.com/p/chromium/issues/detail?id=341596.
let peakThreshold = [-14.43, -13.56, -13.56, -13.56, -13.56, -13.56, -13.56]; let peakThreshold = [-14.43, -13.56, -13.56, -13.56, -13.56, -13.56,
-13.56, -13.56, -13.56, -13.56, -13.56
];
function checkResult(order, analyser, should) { function checkResult(order, analyser, should) {
return function () { return function () {
...@@ -68,9 +70,10 @@ ...@@ -68,9 +70,10 @@
audit.define("FFT scaling tests", function (task, should) { audit.define("FFT scaling tests", function (task, should) {
task.describe("Test Scaling of FFT in AnalyserNode"); task.describe("Test Scaling of FFT in AnalyserNode");
let tests = []; let tests = [];
for (let k = 5; k < 12; ++k) for (let k = 5; k <= 15; ++k)
tests.push(runTest(k, should)); tests.push(runTest(k, should));
// The order in which the tests finish is not important.
Promise.all(tests) Promise.all(tests)
.then(task.done.bind(task)); .then(task.done.bind(task));
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment