From 6a7df213e0038208796706bc2e2e716885fa52cf Mon Sep 17 00:00:00 2001 From: Raymond Toy Date: Fri, 2 Jun 2017 08:36:21 -0700 Subject: [PATCH 1/2] Fix #1226: IIRFilter.getFrequency inconsistent with BiquadFilter `IIRFilter.getFrequency` should return NaN for invalid frequencies just like `BiquadFilter.getFrequency` does. Basically just copied the text from biquad to iirfilter. Also took this opportunity to mark the computation as being synchronous just like BiquadFilter. --- index.html | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 9992dc13f..35d6bb95a 100644 --- a/index.html +++ b/index.html @@ -9796,8 +9796,11 @@

- Given the current filter parameter settings, calculates the - frequency response for the specified frequencies. + Given the current filter parameter + settings, synchronously calculates the frequency response for the + specified frequencies. The three parameters MUST be + Float32Arrays of the same length, or an + InvalidAccessError MUST be thrown.

@@ -9811,19 +9814,37 @@

Float32Array magResponse

- This parameter specifies an output array receiving the linear - magnitude response values. If this array is shorter than - frequencyHz a - NotSupportedError MUST be signaled. +

+ This parameter specifies an output array receiving the linear + magnitude response values. +

+

+ If a value in the frequencyHz parameter is not + within [0; sampleRate/2], where sampleRate is + the value of the sampleRate + property of the AudioContext, the corresponding value + at the same index of the magResponse array MUST + be NaN. +

Float32Array phaseResponse
- This parameter specifies an output array receiving the phase - response values in radians. If this array is shorter than - frequencyHz a - NotSupportedError MUST be signaled. +

+ This parameter specifies an output array receiving the phase + response values in radians. +

+

+ If a value in the frequencyHz parameter is not + within [0; sampleRate/2], where sampleRate is + the value of the sampleRate + property of the AudioContext, the corresponding value + at the same index of the phaseResponse array + MUST be NaN. +

From 4c896b01dc85ca54d046903bd27fafedc9909cdb Mon Sep 17 00:00:00 2001 From: Raymond Toy Date: Wed, 7 Jun 2017 13:55:13 -0700 Subject: [PATCH 2/2] Fix typo --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 35d6bb95a..518372f11 100644 --- a/index.html +++ b/index.html @@ -9796,7 +9796,7 @@

- Given the current filter parameter + Given the current filter parameter settings, synchronously calculates the frequency response for the specified frequencies. The three parameters MUST be Float32Arrays of the same length, or an