ABSTRACT

A filter can emphasize or de-emphasize certain parts of the frequency spectrum of a sound. Visually, it can be shown as a pair of graphs over the frequency domain called the frequency response, consisting of both magnitude response and phase response. This chapter focuses on Web Audio API’s two nodes that perform filtering, the BiquadFilterNode and the IIRFilterNode. The BiquadFilterNode implements common filters as second-order, or biquad, filters. Multiple BiquadFilterNode filters can be combined to form more complex filters. The filter parameters such as frequency can be changed over time for filter sweeps, a wah-wah effect, a phaser, and so on. The BiquadFilterNode can be used to build equalizers and manipulate sounds in interesting ways. There are many applications where a filter might be needed which cannot easily be built as a combination of the second-order filters available in the BiquadFilterNode. Thus, the Web Audio API provides the IIRFilterNode, which is an audio node that implements a general IIR filtering.