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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/iirfilter.html

Issue 1885723003: Implement Biquad lowpass and highpass filters according to spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Test Basic IIRFilterNode Operation</title> 4 <title>Test Basic IIRFilterNode Operation</title>
5 <script src="../resources/js-test.js"></script> 5 <script src="../resources/js-test.js"></script>
6 <script src="resources/compatibility.js"></script> 6 <script src="resources/compatibility.js"></script>
7 <script src="resources/audio-testing.js"></script> 7 <script src="resources/audio-testing.js"></script>
8 <script src="resources/biquad-filters.js"></script> 8 <script src="resources/biquad-filters.js"></script>
9 </head> 9 </head>
10 10
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 var snr = 10*Math.log10(computeSNR(actual, expected)); 232 var snr = 10*Math.log10(computeSNR(actual, expected));
233 Should("SNR for IIRFIlter for Biquad " + filterType, snr).beGreaterT hanOrEqualTo(snrThreshold); 233 Should("SNR for IIRFIlter for Biquad " + filterType, snr).beGreaterT hanOrEqualTo(snrThreshold);
234 }).then(done); 234 }).then(done);
235 }; 235 };
236 } 236 }
237 237
238 // Thresholds here are experimentally determined. 238 // Thresholds here are experimentally determined.
239 var biquadTestConfigs = [{ 239 var biquadTestConfigs = [{
240 filterType: "lowpass", 240 filterType: "lowpass",
241 snrThreshold: 91.222, 241 snrThreshold: 91.221,
242 errorThreshold: { 242 errorThreshold: {
243 relativeThreshold: 4.15e-5 243 relativeThreshold: 4.9834e-5
244 } 244 }
245 }, { 245 }, {
246 filterType: "highpass", 246 filterType: "highpass",
247 snrThreshold: 107.246, 247 snrThreshold: 105.4590,
248 errorThreshold: { 248 errorThreshold: {
249 absoluteThreshold: 2.9e-6, 249 absoluteThreshold: 2.9e-6,
250 relativeThreshold: 3e-5 250 relativeThreshold: 3e-5
251 } 251 }
252 }, { 252 }, {
253 filterType: "bandpass", 253 filterType: "bandpass",
254 snrThreshold: 104.060, 254 snrThreshold: 104.060,
255 errorThreshold: { 255 errorThreshold: {
256 absoluteThreshold: 2e-7, 256 absoluteThreshold: 2e-7,
257 relativeThreshold: 8.7e-4 257 relativeThreshold: 8.7e-4
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 var expected = result.getChannelData(0); 545 var expected = result.getChannelData(0);
546 var actual = result.getChannelData(1); 546 var actual = result.getChannelData(1);
547 547
548 Should("4-th order IIRFilter (biquad ref)", 548 Should("4-th order IIRFilter (biquad ref)",
549 actual, { 549 actual, {
550 verbose: true, 550 verbose: true,
551 precision: 5 551 precision: 5
552 }) 552 })
553 .beCloseToArray(expected, { 553 .beCloseToArray(expected, {
554 // Thresholds experimentally determined. 554 // Thresholds experimentally determined.
555 absoluteThreshold: 8.4e-8, 555 absoluteThreshold: 1.59e-7,
556 relativeThreshold: 5e-7, 556 relativeThreshold: 2.11e-5,
557 }); 557 });
558 558
559 var snr = 10*Math.log10(computeSNR(actual, expected)); 559 var snr = 10*Math.log10(computeSNR(actual, expected));
560 Should("SNR of 4-th order IIRFilter (biquad ref)", snr) 560 Should("SNR of 4-th order IIRFilter (biquad ref)", snr)
561 .beGreaterThanOrEqualTo(110.684); 561 .beGreaterThanOrEqualTo(108.947);
562 }).then(done); 562 }).then(done);
563 }); 563 });
564 564
565 audit.defineTask("finish", function (done) { 565 audit.defineTask("finish", function (done) {
566 finishJSTest(); 566 finishJSTest();
567 done(); 567 done();
568 }); 568 });
569 569
570 audit.runTasks(); 570 audit.runTasks();
571 successfullyParsed = true; 571 successfullyParsed = true;
572 </script> 572 </script>
573 </body> 573 </body>
574 </html> 574 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698