IIRFilterNode - Web APIs 编辑

The IIRFilterNode interface of the Web Audio API is a AudioNode processor which implements a general infinite impulse response (IIR)  filter; this type of filter can be used to implement tone control devices and graphic equalizers as well. It lets the parameters of the filter response be specified, so that it can be tuned as needed.

Number of inputs1
Number of outputs1
Channel count mode"max"
Channel countSame as on the input
Channel interpretation"speakers"

Typically, it's best to use the BiquadFilterNode interface to implement higher-order filters. There are several reasons why:

  • Biquad filters are typically less sensitive to numeric quirks.
  • The filter parameters of biquad filters can be automated.
  • All even-ordered IIR filters can be created using BiquadFilterNode.

However, if you need to create an odd-ordered IIR filter, you'll need to use IIRFilterNode. You may also find this interface useful if you don't need automation, or for other reasons.

Once the node has been created, you can't change its coefficients.

IIRFilterNodes have a tail-time reference; they continue to output non-silent audio with zero input. As an IIR filter, the non-zero input continues forever, but this can be limited after some finite time in practice, when the output has approached zero closely enough. The actual time that takes depends on the filter coefficients provided.

Constructor

IIRFilterNode()
Creates a new instance of an IIRFilterNode object.

Properties

This interface has no properties of its own; however, it inherits properties from its parent, AudioNode.

Methods

Inherits methods from its parent, AudioNode. It also has the following additional methods:

getFrequencyResponse()
Uses the filter's current parameter settings to calculate the response for frequencies specified in the provided array of frequencies.

Examples

You can find a simple IIR filter demo live on Codepen. Also see the source code on GitHub. It includes some different coefficient values for different lowpass frequencies — you can change the value of the filterNumber constant to a value between 0 and 3 to check out the different available effects.

Also see our Using IIR filters guide for a full explanation.

Specifications

SpecificationStatusComment
Web Audio API
The definition of 'IIRFilterNode' in that specification.
Working DraftInitial Definition

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:96 次

字数:5193

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文