Skip to content

Minor issues with BiquadFilter AudioParams #2087

Closed

Description

@rtoy

Describe the issue
A few minor issues I noticed in the spec when I was looking at how some filters behave (at https://googlechromelabs.github.io/web-audio-samples/archive/demos/mag-phase.html).

  • The frequency attribute is allowed to be any finite float. I think this should probably be limited to the range from 0 Hz to the Nyquist frequency.
  • The detune attribute is likewise allowed to be any finite float. This should probably be limited a smaller range like for OscillatorNode.detune.
  • The gain attribute is any finite float. But since it's in dB, the
    range is actually much smaller since it would cause an overflow once it gets larger than about 770.

Finally, Q is a bit messy. First, for lowpass and highpass filters, Q is in dB, but is a linear value for other filter types.. Right now you can only tell if you look at the filter characterics to see how Q is used to determine the filter coefficients. We should make a note of that in the description of Q. It can be negative or positive in that case.

However, for the other filters such as bandpass, Q is a linear value. But negative values don't seem to be allowed. From https://www.w3.org/2011/audio/audio-eq-cookbook.html we can see that in this case, the Q value is related to the bandwidth for bandpass, notch, or peaking filters. Bandwidth is generally a non-negative number, so Q should be too.

Thus, we should make a note that Q is in dB for lowpass and highpass filters and can be positive or negative. For other filters, Q is linear and should be positive.

Activity

  1. added this to the Web Audio V1 milestone on Oct 24, 2019
  2. added a commit that references this issue on Oct 25, 2019
    35fd8ce
  3. added a commit that references this issue on Jan 17, 2020
  4. added a commit that references this issue on Nov 23, 2025
    dbdd3fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions