Web Audio API
The createIIRFilter() method of the BaseAudioContext interface creates an IIRFilterNode, which represents a general infinite impulse response (IIR) filter which can be configured to serve as various types of filter.
[!NOTE] The IIRFilterNode.IIRFilterNode constructor is the recommended way to create an IIRFilterNode; see Creating an AudioNode.
Syntax
createIIRFilter(feedforward, feedback)
Parameters
feedforward- : An array of floating-point values specifying the feedforward (numerator) coefficients for the transfer function of the IIR filter. The maximum length of this array is 20, and at least one value must be nonzero.
feedback- : An array of floating-point values specifying the feedback (denominator) coefficients for the transfer function of the IIR filter. This array may have up to 20 members, the first of which must not be zero.
Return value
An IIRFilterNode implementing the filter with the specified feedback and feedforward coefficient arrays.
Exceptions
InvalidStateErrorDOMException- : Thrown if all of the
feedforwardcoefficients are 0, or if the firstfeedbackcoefficient is 0.
- : Thrown if all of the
NotSupportedErrorDOMException- : Thrown if one or both of the input arrays exceeds 20 members.
Specifications
Browser compatibility
See also
- Using the Web Audio API
- IIRFilterNode
- AudioNode
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
