BiquadFilterNode

« Web Audio API

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.

The BiquadFilterNode interface represents a simple low-order filter. It is an AudioNode that can represents different kind of filters, tone controls device or graphics equalizers. A BiquadFilterNode always has exactly one input and one output.

  • Number of inputs 1
  • Number of outputs 1
  • Channel count mode "max"
  • Channel count 2 (not used in the default count mode)
  • Channel interpretation "speakers"

Properties

Inherits properties from its parent, AudioNode.

BiquadFilterNode.frequency
Is a k-rate AudioParam of a double representing a frequency in the different filtering algorithm. Expressed in Hertz, its default value is 350 and a nominal range  of 10 to the Nyquist frequency, that is half of the sample rate. (Though the AudioParam returned is read-only, the value it represents is not.)
BiquadFilterNode.Q
Is a k-rate AudioParam of a double representing a Q factor, or quality factor. It is a dimensionless value and its default value is 1 and a nominal range of 0.0001 to 1000. (Though the AudioParam returned is read-only, the value it represents is not.)
BiquadFilterNode.gain
Is a k-rate AudioParam of a double representing the gain used in the filter algorithm. Positive it is a real gain, negative it is an attenuation. It is expressed in dB, has a default value of 0 and a nominal range of -40 to 40. (Though the AudioParam returned is read-only, the value it represents is not.)
BiquadFilterNode.type
Is a string value defining the kind of filter the node is implemented:

The meaning of the different parameters depending of the type of the filter
type Description frequency Q gain
lowpass Standard second-order resonant lowpass filter with 12dB/octave rolloff. Frequencies below the cutoff pass through; frequencies above it are attenuated. The cutoff frequency Indicates how peaked the frequency is around the cutoff. The greater the value is, the greater is the peak Not used
highpass Standard second-order resonant highpass filter with 12dB/octave rolloff. Frequencies below the cutoff are attenuated; frequencies above it pass through. The cutoff frequency Indicates how peaked the frequency is around the cutoff. The greater the value is, the greater is the peak Not used
bandpass Standard second-order bandpass filter. Frequencies outside the given range of frequencies are attenuated; the frequencies inside it pass through. The center of the range of frequencies. Controls the width of the frequency band. The greater Q is, the larger is the frequency band. Not used
lowshelf Standard second-order lowshelf filer. Frequencies lower than the frequency get a boost, or an attenuation; frequencies over it are unchanged. The upper limit of the frequencies getting a boost, or an attenuation Not used The boost, in dB, to be applied; if negative, it will be an attenuation.
highshelf Standard second-order highshelf filer. Frequencies higher than the frequency get a boost, or an attenuation; frequencies lower than it are unchanged. The lower limit of the frequencies getting a boost, or an attenuation Not used The boost, in dB, to be applied; if negative, it will be an attenuation.
peaking Frequencies inside the range get a boost, or an attenuation; frequencies outside it are unchanges. The middle of the frequency range getting a boost, or an attenauation Controls the width of the frequency band. The greater Q is, the larger is the frequency band. The boost, in dB, to be applied; if negative, it will be an attenuation.
notch Standard notch filter, also called band-stop or band-rejection filter. It is the opposite of a bandpass filter: frequencies outside the give range of frequencies pass through; frequencies inside it are attenuated. The center of the range of frequencies. Controls the width of the frequency band. The greater Q is, the larger is the frequency band. Not used
allpass Standard second-order allpass filter. Let all frequencies through, but change the phase-relationship between the various frequencies. The frequency with the maximal group delay, that is the frequency where the center of the phase transition occurs. Controls how sharp is the transition at the medium frequency. The larger this parameter is, the sharper the transition it, and the larger the transition. Not used

 

Methods

Inherits methods from its parent, AudioNode.

BiquadFilterNode.getFrequencyResponse()
From the current filter parameter settings, calculates the frequency response for frequencies specified in the frequencyHz array of frequencies. The results are stored in two output array: magResponse receiving the linear magnitude and phaseResponse receiving the phase response in radians.

Examples

 

Specifications

Specification Status Comment
Web Audio API Working Draft  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes)webkit Activated on Nightly only Not supported Not supported ?
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support Not supported Activated on Nightly only Not supported Not supported ?

See also

  • Using Web Audio

Document Tags and Contributors

Contributors to this page: Sheppy, kscarfone, teoli
Last updated by: kscarfone,