BaseAudioContext: createIIRFilter() method
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
ThecreateIIRFilter() method of theBaseAudioContext interface creates anIIRFilterNode, which represents a generalinfinite impulse response (IIR) filter which can be configured to serve as various types of filter.
Note:TheIIRFilterNode()constructor is the recommended way to create anIIRFilterNode; seeCreating an AudioNode.
In this article
Syntax
createIIRFilter(feedforward, feedback)Parameters
feedforwardAn array of floating-point values specifying the feedforward (numerator)coefficients for the transfer function of the IIR filter. The maximum length of thisarray is 20, and at least one value must be nonzero.
feedbackAn array of floating-point values specifying the feedback (denominator) coefficientsfor the transfer function of the IIR filter. This array may have up to 20 members, thefirst of which must not be zero.
Return value
AnIIRFilterNode implementing the filter with the specified feedback andfeedforward coefficient arrays.
Exceptions
InvalidStateErrorDOMExceptionThrown if all of the
feedforwardcoefficients are 0, or if the firstfeedbackcoefficient is 0.NotSupportedErrorDOMExceptionThrown if one or both of the input arrays exceeds 20 members.
Specifications
| Specification |
|---|
| Web Audio API> # dom-baseaudiocontext-createiirfilter> |